don't new hwcodec decoders if option disabled

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-12-13 09:47:23 +08:00
parent cd511010a8
commit e58f2186ec
3 changed files with 18 additions and 8 deletions

View File

@@ -94,7 +94,7 @@ impl EncoderApi for HwEncoder {
frames.push(EncodedVideoFrame {
data: Bytes::from(frame.data),
pts: frame.pts as _,
key:frame.key == 1,
key: frame.key == 1,
..Default::default()
});
}
@@ -175,6 +175,7 @@ pub struct HwDecoder {
pub info: CodecInfo,
}
#[derive(Default)]
pub struct HwDecoders {
pub h264: Option<HwDecoder>,
pub h265: Option<HwDecoder>,