CVB++ 15.0
Decoder Class Referencefinal

A decoder for video frames. More...

#include <cvb/codec_bridge/decoders.hpp>

Public Member Functions

CodecStatus Decode (const Packet &packet)
 Decode a packet. More...
 
void Flush ()
 Flush the decoder and finish decoding. More...
 
std::unique_ptr< FrameReceiveFrame ()
 Receive an an decoded frame. More...
 
int StreamIndex () const
 Get the stream index this decoder can work on. More...
 

Detailed Description

A decoder for video frames.

A decoder can decode packets into video frames.

Member Function Documentation

◆ Decode()

CodecStatus Decode ( const Packet packet)
inline

Decode a packet.

Parameters
[in]packetThe packet to decode.
Returns
A the status of the encoder.
Exceptions
Anyexception derived from std::exception including CvbException.

Decoders will usually deliver frames only after a few packets have been decoded. If no frames are received the decoder will refuse to take new packets and return ReadoutRequired.

◆ Flush()

void Flush ( )
inline

Flush the decoder and finish decoding.

Exceptions
Anyexception derived from std::exception including CvbException.

Notify the decoder that no more packets will be send, so the remaining frames can be delivered. The decoder will not accept any more packets after flushing.

◆ ReceiveFrame()

std::unique_ptr< Frame > ReceiveFrame ( )
inline

Receive an an decoded frame.

Returns
A pointer to the frame object (may be empty).
Exceptions
Anyexception derived from std::exception including CvbException.

Decoders will usually deliver frames only after a few packets have been decoded. If no new frames can be received this method will return empty pointers.

◆ StreamIndex()

int StreamIndex ( ) const
inline

Get the stream index this decoder can work on.

Returns
The stream index.
Exceptions
Anyexception derived from std::exception including CvbException.

When the decoder is created from a container file, stream index will be the index of the first video stream in the file.