Encoded Video Sink Interface

#include <dolbyio/comms/media/media_engine.h>

The interface for handling encoded video frames. Application must set listeners which override both of the virtual functions. The handle_frame_encoded function is called after the RTP data is depacktized and an encoded frame is constructed. This function will be executed on the Webrtc DecodingQueue thread created for the track to which the encoded frames belong.

class dolbyio::comms::video_sink_encoded

The interface for receiving the encoded video frames.

Public Types

enum decoder_config

The desired configuration of the decoder passing frames to this encoded sink.

Values:

enumerator full_decoding

The decoder will decode every single frame.

enumerator optimized_decoding

The decoder will only decode the first frame.

Public Functions

virtual decoder_config configure_encoded_sink(const std::string &codec, const std::string &track_id) = 0

The callback that is invoked when a new video track is available. The callback allows setting the corresponding codec for the video track.

Parameters:
  • codec – The codec of the video track.

  • track_id – The ID of the video track.

Return values:
  • true – The sink would like to use optimized decoding, meaning that all incoming video frames are discarded and not decoded after being passed to the handle_frame_encoded function.

  • false – The sink would like to use full decoding, meaning that all the incoming frames are decoded.

virtual void handle_frame_encoded(const std::string &track_id, std::unique_ptr<encoded_video_frame> frame) = 0

The callback that is invoked when a new encoded video frame is ready to be processed.

Parameters:
  • track_id – The ID of the video track.

  • frame – The encoded video frame.

See Example Recorder Implementation for a template for child recording class for all possible media.