diff --git a/libs/scrap/examples/record-screen.rs b/libs/scrap/examples/record-screen.rs index 8be7dc132..ac9dc3ff9 100644 --- a/libs/scrap/examples/record-screen.rs +++ b/libs/scrap/examples/record-screen.rs @@ -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; diff --git a/libs/scrap/src/common/coder.rs b/libs/scrap/src/common/codec.rs similarity index 100% rename from libs/scrap/src/common/coder.rs rename to libs/scrap/src/common/codec.rs diff --git a/libs/scrap/src/common/hwcodec.rs b/libs/scrap/src/common/hwcodec.rs index f2867c592..1ca89a852 100644 --- a/libs/scrap/src/common/hwcodec.rs +++ b/libs/scrap/src/common/hwcodec.rs @@ -1,5 +1,5 @@ use crate::{ - coder::{EncoderApi, EncoderCfg}, + codec::{EncoderApi, EncoderCfg}, hw, HW_STRIDE_ALIGN, }; use hbb_common::{ diff --git a/libs/scrap/src/common/mod.rs b/libs/scrap/src/common/mod.rs index 993f20628..a95069686 100644 --- a/libs/scrap/src/common/mod.rs +++ b/libs/scrap/src/common/mod.rs @@ -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, b: &[u8]) -> std::io::Result<() old.resize(b.len(), 0); old.copy_from_slice(b); Ok(()) -} \ No newline at end of file +} diff --git a/libs/scrap/src/common/vpxcodec.rs b/libs/scrap/src/common/vpxcodec.rs index 7301dc705..4067996d0 100644 --- a/libs/scrap/src/common/vpxcodec.rs +++ b/libs/scrap/src/common/vpxcodec.rs @@ -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 + fn new(cfg: crate::codec::EncoderCfg) -> ResultType 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 { diff --git a/src/client.rs b/src/client.rs index 915878774..2cbf007d5 100644 --- a/src/client.rs +++ b/src/client.rs @@ -13,7 +13,7 @@ use cpal::{ }; use magnum_opus::{Channels::*, Decoder as AudioDecoder}; use scrap::{ - coder::{Decoder, DecoderCfg}, + codec::{Decoder, DecoderCfg}, VpxDecoderConfig, VpxVideoCodecId, }; diff --git a/src/server/connection.rs b/src/server/connection.rs index fea7c6605..87e90d5d9 100644 --- a/src/server/connection.rs +++ b/src/server/connection.rs @@ -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, diff --git a/src/server/video_service.rs b/src/server/video_service.rs index 40ae41bdb..005553dc4 100644 --- a/src/server/video_service.rs +++ b/src/server/video_service.rs @@ -27,7 +27,7 @@ use hbb_common::tokio::{ }, }; use scrap::{ - coder::{Encoder, EncoderCfg, HwEncoderConfig}, + codec::{Encoder, EncoderCfg, HwEncoderConfig}, vpxcodec::{VpxEncoderConfig, VpxVideoCodecId}, Capturer, Display, };