| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | use std::cell::RefCell; |
| 9 | use std::rc::Rc; |
| 10 | |
| 11 | use crate::backend::dummy::decoder::Backend; |
| 12 | use crate::backend::dummy::decoder::Handle; |
| 13 | use crate::decoder::stateless::h265::H265; |
| 14 | use crate::decoder::stateless::NewStatelessDecoderError; |
| 15 | use crate::decoder::stateless::StatelessDecoder; |
| 16 | use crate::decoder::BlockingMode; |
| 17 | |
| 18 | use crate::decoder::stateless::h265::StatelessH265DecoderBackend; |
| 19 | use crate::Resolution; |
| 20 | |
| 21 | impl StatelessH265DecoderBackend for Backend { |
| 22 | fn new_sequence( |
| 23 | &mut self, |
| 24 | _: &crate::codec::h265::parser::Sps, |
| 25 | ) -> crate::decoder::stateless::StatelessBackendResult<()> { |
| 26 | Ok(()) |
| 27 | } |
| 28 | |
| 29 | fn new_picture( |
| 30 | &mut self, |
| 31 | _: Resolution, |
| 32 | _: u64, |
| 33 | ) -> crate::decoder::stateless::NewPictureResult<Self::Picture> { |
| 34 | Ok(()) |
| 35 | } |
| 36 | |
| 37 | fn begin_picture( |
| 38 | &mut self, |
| 39 | _: &mut Self::Picture, |
| 40 | _: &crate::codec::h265::picture::PictureData, |
| 41 | _: &crate::codec::h265::parser::Sps, |
| 42 | _: &crate::codec::h265::parser::Pps, |
| 43 | _: &crate::codec::h265::dpb::Dpb<Self::Handle>, |
| 44 | _: &crate::decoder::stateless::h265::RefPicSet<Self::Handle>, |
| 45 | _: &crate::codec::h265::parser::Slice, |
| 46 | ) -> crate::decoder::stateless::StatelessBackendResult<()> { |
| 47 | Ok(()) |
| 48 | } |
| 49 | |
| 50 | fn decode_slice( |
| 51 | &mut self, |
| 52 | _: &mut Self::Picture, |
| 53 | _: &crate::codec::h265::parser::Slice, |
| 54 | _: &crate::codec::h265::parser::Sps, |
| 55 | _: &crate::codec::h265::parser::Pps, |
| 56 | _: &[Option<super::RefPicListEntry<Self::Handle>>; 16], |
| 57 | _: &[Option<super::RefPicListEntry<Self::Handle>>; 16], |
| 58 | ) -> crate::decoder::stateless::StatelessBackendResult<()> { |
| 59 | Ok(()) |
| 60 | } |
| 61 | |
| 62 | fn submit_picture( |
| 63 | &mut self, |
| 64 | _: Self::Picture, |
| 65 | ) -> crate::decoder::stateless::StatelessBackendResult<Self::Handle> { |
| 66 | Ok(Handle { handle: Rc::new(RefCell::new(Default::default())) }) |
| 67 | } |
| 68 | } |
| 69 | impl StatelessDecoder<H265, Backend> { |
| 70 | |
| 71 | pub fn new_dummy(blocking_mode: BlockingMode) -> Result<Self, NewStatelessDecoderError> { |
| 72 | Self::new(Backend::new(), blocking_mode) |
| 73 | } |
| 74 | } |