X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-core%2Fsrc%2Fcodecs%2Fmod.rs;h=8225dd0dcbf08ff18cdf7eddd689458c14596da1;hp=4f81d9eb8a2ffe61c6a8f2b09e65d6cf3b2a359f;hb=01613464323864a655c994820d3c43df1954e3b2;hpb=3fc28ece6664a34af9b7f6a52dbf8a8809fa9204 diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index 4f81d9e..8225dd0 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -229,10 +229,26 @@ impl fmt::Display for MV { } } +pub struct NADecoderSupport { + pub pool_u8: NAVideoBufferPool, + pub pool_u16: NAVideoBufferPool, + pub pool_u32: NAVideoBufferPool, +} + +impl NADecoderSupport { + pub fn new() -> Self { + Self { + pool_u8: NAVideoBufferPool::new(0), + pool_u16: NAVideoBufferPool::new(0), + pool_u32: NAVideoBufferPool::new(0), + } + } +} + pub trait NADecoder { - fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()>; - fn decode(&mut self, pkt: &NAPacket) -> DecoderResult; + fn init(&mut self, supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()>; + fn decode(&mut self, supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult; } #[derive(Clone,Copy)]