mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-24 12:29:04 +08:00
scrap: rename coder.rs to codec.rs
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
6677fc9b30
commit
399ddc8bef
@ -13,7 +13,7 @@ use std::time::{Duration, Instant};
|
||||
use std::{io, thread};
|
||||
|
||||
use docopt::Docopt;
|
||||
use scrap::coder::{EncoderApi, EncoderCfg};
|
||||
use scrap::codec::{EncoderApi, EncoderCfg};
|
||||
use webm::mux;
|
||||
use webm::mux::Track;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::{
|
||||
coder::{EncoderApi, EncoderCfg},
|
||||
codec::{EncoderApi, EncoderCfg},
|
||||
hw, HW_STRIDE_ALIGN,
|
||||
};
|
||||
use hbb_common::{
|
||||
|
@ -27,7 +27,7 @@ cfg_if! {
|
||||
}
|
||||
}
|
||||
|
||||
pub mod coder;
|
||||
pub mod codec;
|
||||
mod convert;
|
||||
#[cfg(feature = "hwcodec")]
|
||||
pub mod hwcodec;
|
||||
@ -47,4 +47,4 @@ pub fn would_block_if_equal(old: &mut Vec<u128>, b: &[u8]) -> std::io::Result<()
|
||||
old.resize(b.len(), 0);
|
||||
old.copy_from_slice(b);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use hbb_common::anyhow::{anyhow, Context};
|
||||
use hbb_common::message_proto::{Message, VP9s, VideoFrame, VP9};
|
||||
use hbb_common::ResultType;
|
||||
|
||||
use crate::coder::EncoderApi;
|
||||
use crate::codec::EncoderApi;
|
||||
use crate::STRIDE_ALIGN;
|
||||
|
||||
use super::vpx::{vp8e_enc_control_id::*, vpx_codec_err_t::*, *};
|
||||
@ -90,12 +90,12 @@ macro_rules! call_vpx_ptr {
|
||||
}
|
||||
|
||||
impl EncoderApi for VpxEncoder {
|
||||
fn new(cfg: crate::coder::EncoderCfg) -> ResultType<Self>
|
||||
fn new(cfg: crate::codec::EncoderCfg) -> ResultType<Self>
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
match cfg {
|
||||
crate::coder::EncoderCfg::VPX(config) => {
|
||||
crate::codec::EncoderCfg::VPX(config) => {
|
||||
let i;
|
||||
if cfg!(feature = "VP8") {
|
||||
i = match config.codec {
|
||||
|
@ -13,7 +13,7 @@ use cpal::{
|
||||
};
|
||||
use magnum_opus::{Channels::*, Decoder as AudioDecoder};
|
||||
use scrap::{
|
||||
coder::{Decoder, DecoderCfg},
|
||||
codec::{Decoder, DecoderCfg},
|
||||
VpxDecoderConfig, VpxVideoCodecId,
|
||||
};
|
||||
|
||||
|
@ -365,7 +365,7 @@ impl Connection {
|
||||
video_service::notify_video_frame_feched(id, None);
|
||||
super::video_service::update_test_latency(id, 0);
|
||||
super::video_service::update_image_quality(id, None);
|
||||
scrap::coder::Encoder::update_video_encoder(id, None);
|
||||
scrap::codec::Encoder::update_video_encoder(id, None);
|
||||
if let Err(err) = conn.try_port_forward_loop(&mut rx_from_cm).await {
|
||||
conn.on_close(&err.to_string(), false);
|
||||
}
|
||||
@ -1190,9 +1190,9 @@ impl Connection {
|
||||
|
||||
// TODO: add option
|
||||
if let Some(q) = o.video_codec_state.clone().take() {
|
||||
scrap::coder::Encoder::update_video_encoder(self.inner.id(), Some(q));
|
||||
scrap::codec::Encoder::update_video_encoder(self.inner.id(), Some(q));
|
||||
} else {
|
||||
scrap::coder::Encoder::update_video_encoder(
|
||||
scrap::codec::Encoder::update_video_encoder(
|
||||
self.inner.id(),
|
||||
Some(VideoCodecState {
|
||||
H264: false,
|
||||
|
@ -27,7 +27,7 @@ use hbb_common::tokio::{
|
||||
},
|
||||
};
|
||||
use scrap::{
|
||||
coder::{Encoder, EncoderCfg, HwEncoderConfig},
|
||||
codec::{Encoder, EncoderCfg, HwEncoderConfig},
|
||||
vpxcodec::{VpxEncoderConfig, VpxVideoCodecId},
|
||||
Capturer, Display,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user