pub struct Decoder<T>where
    T: DecodedHandle + DynDecodedHandle,
{
Show 24 fields parser: Parser, blocking_mode: BlockingMode, backend: Box<dyn StatelessDecoderBackend<Handle = T>>, negotiation_status: NegotiationStatus, coded_resolution: Resolution, ready_queue: BinaryHeap<ReadyPicture<T>>, current_display_order: u64, dpb: Dpb<T>, max_num_reorder_frames: u32, cur_sps_id: u8, cur_pps_id: u8, prev_ref_pic_info: PrevReferencePicInfo, prev_pic_info: PrevPicInfo, curr_info: CurrentPicInfo, cur_pic: Option<PictureData>, last_field: Option<(Rc<RefCell<PictureData>>, T)>, ref_pic_list_p0: Vec<DpbEntry<T>>, ref_pic_list_b0: Vec<DpbEntry<T>>, ref_pic_list_b1: Vec<DpbEntry<T>>, ref_frame_list_0_short_term: Vec<DpbEntry<T>>, ref_frame_list_1_short_term: Vec<DpbEntry<T>>, ref_frame_list_long_term: Vec<DpbEntry<T>>, ref_pic_list0: Vec<DpbEntry<T>>, ref_pic_list1: Vec<DpbEntry<T>>,
}

Fields

parser: Parser

A parser to extract bitstream metadata

blocking_mode: BlockingMode

Whether the decoder should block on decode operations.

backend: Box<dyn StatelessDecoderBackend<Handle = T>>

The backend used for hardware acceleration.

negotiation_status: NegotiationStatus

Keeps track of whether the decoded format has been negotiated with the backend.

coded_resolution: Resolution

The current coded resolution

ready_queue: BinaryHeap<ReadyPicture<T>>

A queue with the handles of pictures that are ready to be sent to the DecoderSession, with the lowest order at the top.

current_display_order: u64

A monotonically increasing counter used to tag pictures in display order

dpb: Dpb<T>

The decoded picture buffer

max_num_reorder_frames: u32

Indicates an upper bound for the number of frames buffers, in the decoded picture buffer (DPB), that are required for storing frames, complementary field pairs, and non-paired fields before output. It is a requirement of bitstream conformance that the maximum number of frames, complementary field pairs, or non-paired fields that precede any frame, complementary field pair, or non-paired field in the coded video sequence in decoding order and follow it in output order shall be less than or equal to max_num_reorder_frames.

cur_sps_id: u8

The current active SPS id.

cur_pps_id: u8

The current active PPS id.

prev_ref_pic_info: PrevReferencePicInfo

Cached variables from the previous reference picture.

prev_pic_info: PrevPicInfo

Cached variables from the previous picture.

curr_info: CurrentPicInfo

Cached variables from the current picture.

cur_pic: Option<PictureData>

The current picture being worked on.

last_field: Option<(Rc<RefCell<PictureData>>, T)>

A cached, non-reference first field that did not make it into the DPB because it was full even after bumping the smaller POC. This field will be cached until the second field is processed so they can be output together.

We are not using DbpEntry<T> as the type because contrary to a DPB entry, the handle of this member is always valid.

ref_pic_list_p0: Vec<DpbEntry<T>>

Reference picture list for P slices. Retains the same meaning as in the specification. Points into the pictures stored in the DPB. Derived once per picture.

ref_pic_list_b0: Vec<DpbEntry<T>>

Reference picture list 0 for B slices. Retains the same meaning as in the specification. Points into the pictures stored in the DPB. Derived once per picture.

ref_pic_list_b1: Vec<DpbEntry<T>>

Reference picture list 1 for B slices. Retains the same meaning as in the specification. Points into the pictures stored in the DPB. Derived once per picture.

ref_frame_list_0_short_term: Vec<DpbEntry<T>>

Equivalent to refFrameList0ShortTerm in the spec. Used for building the references for P, SP and B slices in fields (8.2.4.2.2, 8.2.4.2.4). Derived once per field.

ref_frame_list_1_short_term: Vec<DpbEntry<T>>

Equivalent to refFrameList1ShortTerm in the spec. Used for building the references for B slices in fields (8.2.4.2.4). Derived once per field.

ref_frame_list_long_term: Vec<DpbEntry<T>>

Equivalent to refFrameList0LongTerm in the spec. Used for building the references for P, SP and B slices in fields (8.2.4.2.2, 8.2.4.2.4). Derived once per field.

ref_pic_list0: Vec<DpbEntry<T>>

Equivalent to RefPicList0 in the specification. Computed for every slice, points to the pictures in the DPB.

ref_pic_list1: Vec<DpbEntry<T>>

Equivalent to RefPicList1 in the specification. Computed for every slice, points to the pictures in the DPB.

Implementations

8.2.4.2.1 Initialization process for the reference picture list for P and SP slices in frames

8.2.4.2.2 Initialization process for the reference picture list for P and SP slices in fields

8.2.4.2.4 Initialization process for reference picture lists for B slices in fields

Copies from refFrameListXShortTerm and refFrameListLongTerm into RefPicListX as per 8.2.4.2.5. Used when building the reference list for fields in interlaced decoding.

Store some variables related to the previous reference picture. These will be used in the decoding of future pictures.

Store some variables related to the previous picture. These will be used in the decoding of future pictures.

Adds picture to the ready queue if it could not be added to the DPB.

Init the current picture being decoded.

Bumps the DPB if needed. DPB bumping is described on C.4.5.3.

Get the DecodedFrameHandles for the pictures in the ready queue, in display order.

Drain the decoder, processing all pending frames.

Find the first field for the picture started by slice, if any.

Handle a picture. Called only once. Uses an heuristic to determine when a new picture starts in the slice NALUs.

Handle a slice. Called once per slice NALU.

Submits the picture to the accelerator.

Trait Implementations

Decode the bitstream represented by timestamp. Returns zero or more decoded handles representing the decoded data. Read more
Flush the decoder i.e. finish processing all queued decode requests and emit frames for them. Read more
Whether negotiation of the decoded format is possible. In particular, a decoder will indicate that negotiation is possible after enough metadata is collected from parsing the bitstream through calls to the decode() method. Read more
Gets the number of output resources left in the backend after accounting for any buffers that might be queued in the decoder. Read more
Gets the number of output resources allocated by the backend.
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
Polls the decoder, emitting frames for all queued decode requests. This is similar to flush, but it does not change the state of the decoded picture buffer nor does it reset any internal state. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.