sync codec format

This commit is contained in:
csf
2022-06-29 23:36:45 +08:00
parent 75fc49b301
commit eaaeefd90b
8 changed files with 61 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ use hbb_common::{
anyhow::{anyhow, Context},
config::HwCodecConfig,
lazy_static, log,
message_proto::{H264s, H265s, Message, VideoFrame, H264, H265},
message_proto::{test_delay, H264s, H265s, Message, VideoFrame, H264, H265},
ResultType,
};
use hwcodec::{
@@ -143,6 +143,13 @@ impl EncoderApi for HwEncoder {
self.encoder.set_bitrate((bitrate * 1000) as _).ok();
Ok(())
}
fn get_codec_format(&self) -> test_delay::CodecFormat {
match self.format {
DataFormat::H264 => test_delay::CodecFormat::H264,
DataFormat::H265 => test_delay::CodecFormat::H265,
}
}
}
impl HwEncoder {