struct Backend {
backend: VaapiBackend<Sps>,
current_picture: Option<VaPicture<PictureNew>>,
}
Expand description
H.264 stateless decoder backend for VA-API.
Fields
backend: VaapiBackend<Sps>
current_picture: Option<VaPicture<PictureNew>>
The current picture being worked on.
Implementations
sourceimpl Backend
impl Backend
sourcefn surface_id(handle: &Option<VADecodedHandle>) -> VASurfaceID
fn surface_id(handle: &Option<VADecodedHandle>) -> VASurfaceID
Gets the VASurfaceID for the given picture
.
sourcefn fill_va_h264_pic(
h264_pic: &PictureData,
surface_id: VASurfaceID,
merge_other_field: bool
) -> PictureH264
fn fill_va_h264_pic(
h264_pic: &PictureData,
surface_id: VASurfaceID,
merge_other_field: bool
) -> PictureH264
Fills the internal va_pic
picture parameter with data from h264_pic
sourcefn build_invalid_va_h264_pic() -> PictureH264
fn build_invalid_va_h264_pic() -> PictureH264
Builds an invalid VaPictureH264. These pictures are used to fill empty array slots there is no data to fill them with.
fn build_iq_matrix(pps: &Pps) -> BufferType
fn build_pic_param(
slice: &Slice<impl AsRef<[u8]>>,
current_picture: &PictureData,
current_surface_id: VASurfaceID,
dpb: &Dpb<VADecodedHandle>,
sps: &Sps,
pps: &Pps
) -> Result<BufferType>
fn fill_ref_pic_list(
ref_list_x: &[DpbEntry<VADecodedHandle>]
) -> [PictureH264; 32]
fn build_slice_param(
slice: &Slice<impl AsRef<[u8]>>,
ref_list_0: &[DpbEntry<VADecodedHandle>],
ref_list_1: &[DpbEntry<VADecodedHandle>],
sps: &Sps,
pps: &Pps
) -> Result<BufferType>
Trait Implementations
sourceimpl StatelessDecoderBackend for Backend
impl StatelessDecoderBackend for Backend
sourcefn new_sequence(&mut self, sps: &Sps) -> StatelessBackendResult<()>
fn new_sequence(&mut self, sps: &Sps) -> StatelessBackendResult<()>
Called when a new SPS is parsed.
sourcefn handle_picture(
&mut self,
picture: &PictureData,
timestamp: u64,
sps: &Sps,
pps: &Pps,
dpb: &Dpb<Self::Handle>,
slice: &Slice<&[u8]>
) -> StatelessBackendResult<()>
fn handle_picture(
&mut self,
picture: &PictureData,
timestamp: u64,
sps: &Sps,
pps: &Pps,
dpb: &Dpb<Self::Handle>,
slice: &Slice<&[u8]>
) -> StatelessBackendResult<()>
Called by the decoder for every frame or field found.
sourcefn decode_slice(
&mut self,
slice: &Slice<&[u8]>,
sps: &Sps,
pps: &Pps,
_: &Dpb<Self::Handle>,
ref_pic_list0: &[DpbEntry<Self::Handle>],
ref_pic_list1: &[DpbEntry<Self::Handle>]
) -> StatelessBackendResult<()>
fn decode_slice(
&mut self,
slice: &Slice<&[u8]>,
sps: &Sps,
pps: &Pps,
_: &Dpb<Self::Handle>,
ref_pic_list0: &[DpbEntry<Self::Handle>],
ref_pic_list1: &[DpbEntry<Self::Handle>]
) -> StatelessBackendResult<()>
Called to dispatch a decode operation to the backend.
sourcefn submit_picture(
&mut self,
_: &PictureData,
block: BlockingMode
) -> StatelessBackendResult<Self::Handle>
fn submit_picture(
&mut self,
_: &PictureData,
block: BlockingMode
) -> StatelessBackendResult<Self::Handle>
Called when the decoder wants the backend to finish the decoding
operations for
picture
. At this point, decode_slice
has been called
for all slices. The argument block
dictates whether this call should
wait until the current decode finishes, or whether it should return
immediately. Read moresourcefn new_picture(
&mut self,
_: &PictureData,
timestamp: u64
) -> StatelessBackendResult<()>
fn new_picture(
&mut self,
_: &PictureData,
timestamp: u64
) -> StatelessBackendResult<()>
Called when the decoder determines that a frame or field was found.
sourcefn new_field_picture(
&mut self,
_: &PictureData,
timestamp: u64,
first_field: &Self::Handle
) -> StatelessBackendResult<()>
fn new_field_picture(
&mut self,
_: &PictureData,
timestamp: u64,
first_field: &Self::Handle
) -> StatelessBackendResult<()>
Called when the decoder determines that a second field was found.
Indicates that the underlying BackendHandle is to be shared between the
two pictures. This is so both fields decode to the same underlying
resource and can thus be presented together as a single frame. Read more
sourceimpl VideoDecoderBackend for Backend
impl VideoDecoderBackend for Backend
type Handle = DecodedHandle
type Handle = DecodedHandle
The type that the backend returns as a result of a decode operation.
This will usually be some backend-specific type with a resource and a
resource pool so that said buffer can be reused for another decode
operation when it goes out of scope. Read more
sourcefn num_resources_total(&self) -> usize
fn num_resources_total(&self) -> usize
Gets the number of output resources allocated by the backend.
sourcefn num_resources_left(&self) -> usize
fn num_resources_left(&self) -> usize
Gets the number of output resources left in the backend.
sourcefn format(&self) -> Option<DecodedFormat>
fn format(&self) -> Option<DecodedFormat>
Gets the chosen format. This is set to a default after the decoder reads
enough stream metadata from the bitstream. Some buffers need to be
processed first before the default format can be set. Read more
sourcefn try_format(&mut self, format: DecodedFormat) -> DecoderResult<()>
fn try_format(&mut self, format: DecodedFormat) -> DecoderResult<()>
Try altering the decoded format.
sourcefn coded_resolution(&self) -> Option<Resolution>
fn coded_resolution(&self) -> Option<Resolution>
Returns the current coded resolution of the bitstream being processed.
This may be None if we have not read the stream parameters yet. Read more
sourcefn display_resolution(&self) -> Option<Resolution>
fn display_resolution(&self) -> Option<Resolution>
Returns the current display resolution of the bitstream being processed.
This may be None if we have not read the stream parameters yet. Read more
sourcefn poll(
&mut self,
blocking_mode: BlockingMode
) -> DecoderResult<VecDeque<Self::Handle>>
fn poll(
&mut self,
blocking_mode: BlockingMode
) -> DecoderResult<VecDeque<Self::Handle>>
Poll for any ready pictures.
block
dictates whether this call should
block on the operation or return immediately. Read moresourcefn handle_is_ready(&self, handle: &Self::Handle) -> bool
fn handle_is_ready(&self, handle: &Self::Handle) -> bool
Whether the handle is ready for presentation. The decoder will check
this before returning the handle to clients. Read more
sourcefn block_on_handle(
&mut self,
handle: &Self::Handle
) -> StatelessBackendResult<()>
fn block_on_handle(
&mut self,
handle: &Self::Handle
) -> StatelessBackendResult<()>
Block on handle
handle
.Auto Trait Implementations
impl !RefUnwindSafe for Backend
impl !Send for Backend
impl !Sync for Backend
impl Unpin for Backend
impl !UnwindSafe for Backend
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more