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 std::{io, thread};
|
||||||
|
|
||||||
use docopt::Docopt;
|
use docopt::Docopt;
|
||||||
use scrap::coder::{EncoderApi, EncoderCfg};
|
use scrap::codec::{EncoderApi, EncoderCfg};
|
||||||
use webm::mux;
|
use webm::mux;
|
||||||
use webm::mux::Track;
|
use webm::mux::Track;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
coder::{EncoderApi, EncoderCfg},
|
codec::{EncoderApi, EncoderCfg},
|
||||||
hw, HW_STRIDE_ALIGN,
|
hw, HW_STRIDE_ALIGN,
|
||||||
};
|
};
|
||||||
use hbb_common::{
|
use hbb_common::{
|
||||||
|
@ -27,7 +27,7 @@ cfg_if! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod coder;
|
pub mod codec;
|
||||||
mod convert;
|
mod convert;
|
||||||
#[cfg(feature = "hwcodec")]
|
#[cfg(feature = "hwcodec")]
|
||||||
pub mod hwcodec;
|
pub mod hwcodec;
|
||||||
|
@ -6,7 +6,7 @@ use hbb_common::anyhow::{anyhow, Context};
|
|||||||
use hbb_common::message_proto::{Message, VP9s, VideoFrame, VP9};
|
use hbb_common::message_proto::{Message, VP9s, VideoFrame, VP9};
|
||||||
use hbb_common::ResultType;
|
use hbb_common::ResultType;
|
||||||
|
|
||||||
use crate::coder::EncoderApi;
|
use crate::codec::EncoderApi;
|
||||||
use crate::STRIDE_ALIGN;
|
use crate::STRIDE_ALIGN;
|
||||||
|
|
||||||
use super::vpx::{vp8e_enc_control_id::*, vpx_codec_err_t::*, *};
|
use super::vpx::{vp8e_enc_control_id::*, vpx_codec_err_t::*, *};
|
||||||
@ -90,12 +90,12 @@ macro_rules! call_vpx_ptr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl EncoderApi for VpxEncoder {
|
impl EncoderApi for VpxEncoder {
|
||||||
fn new(cfg: crate::coder::EncoderCfg) -> ResultType<Self>
|
fn new(cfg: crate::codec::EncoderCfg) -> ResultType<Self>
|
||||||
where
|
where
|
||||||
Self: Sized,
|
Self: Sized,
|
||||||
{
|
{
|
||||||
match cfg {
|
match cfg {
|
||||||
crate::coder::EncoderCfg::VPX(config) => {
|
crate::codec::EncoderCfg::VPX(config) => {
|
||||||
let i;
|
let i;
|
||||||
if cfg!(feature = "VP8") {
|
if cfg!(feature = "VP8") {
|
||||||
i = match config.codec {
|
i = match config.codec {
|
||||||
|
@ -13,7 +13,7 @@ use cpal::{
|
|||||||
};
|
};
|
||||||
use magnum_opus::{Channels::*, Decoder as AudioDecoder};
|
use magnum_opus::{Channels::*, Decoder as AudioDecoder};
|
||||||
use scrap::{
|
use scrap::{
|
||||||
coder::{Decoder, DecoderCfg},
|
codec::{Decoder, DecoderCfg},
|
||||||
VpxDecoderConfig, VpxVideoCodecId,
|
VpxDecoderConfig, VpxVideoCodecId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ impl Connection {
|
|||||||
video_service::notify_video_frame_feched(id, None);
|
video_service::notify_video_frame_feched(id, None);
|
||||||
super::video_service::update_test_latency(id, 0);
|
super::video_service::update_test_latency(id, 0);
|
||||||
super::video_service::update_image_quality(id, None);
|
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 {
|
if let Err(err) = conn.try_port_forward_loop(&mut rx_from_cm).await {
|
||||||
conn.on_close(&err.to_string(), false);
|
conn.on_close(&err.to_string(), false);
|
||||||
}
|
}
|
||||||
@ -1190,9 +1190,9 @@ impl Connection {
|
|||||||
|
|
||||||
// TODO: add option
|
// TODO: add option
|
||||||
if let Some(q) = o.video_codec_state.clone().take() {
|
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 {
|
} else {
|
||||||
scrap::coder::Encoder::update_video_encoder(
|
scrap::codec::Encoder::update_video_encoder(
|
||||||
self.inner.id(),
|
self.inner.id(),
|
||||||
Some(VideoCodecState {
|
Some(VideoCodecState {
|
||||||
H264: false,
|
H264: false,
|
||||||
|
@ -27,7 +27,7 @@ use hbb_common::tokio::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
use scrap::{
|
use scrap::{
|
||||||
coder::{Encoder, EncoderCfg, HwEncoderConfig},
|
codec::{Encoder, EncoderCfg, HwEncoderConfig},
|
||||||
vpxcodec::{VpxEncoderConfig, VpxVideoCodecId},
|
vpxcodec::{VpxEncoderConfig, VpxVideoCodecId},
|
||||||
Capturer, Display,
|
Capturer, Display,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user