Raw Video Sink Interface

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

The interface for handling decoded video frames. Application must set listener which overrides the virtual function. The handle_frame function is called after the Webrtc Decoder has decoded the frame and will provide the decoded data wrapped in the frame object. The frame class wraps the decoded video frame and essentailly just provides interface to extract the underlying YUV data.

class dolbyio::comms::video_sink_yuv

The interface for receiving the raw video frames.

Public Functions

virtual void handle_frame(const std::string &stream_id, const std::string &track_id, std::unique_ptr<video_frame> frame) = 0

The callback that is invoked when a video frame is decoded and ready to be processed.

Parameters:
  • stream_id – The ID of the media stream to which the video track belongs.

  • track_id – The ID of the video track to which the frame belongs.

  • frame – The pointer to the video frame.

class dolbyio::comms::video_frame

The interface that wraps decoded video frames received from and to be injected into WebRTC.

Public Types

enum picture_format

The available raw video formats.

Values:

enumerator native

The native format.

enumerator i420

The I420 format.

enumerator i420a

The I420A format.

enumerator i444

The I444 format.

enumerator i010

The I010 format.

Public Functions

virtual ~video_frame() = default
virtual int width() const = 0

Gets the width of the frame.

Returns:

The width of the frame.

virtual int height() const = 0

Gets the height of the video frame.

Returns:

The height of the frame.

virtual picture_format format() const = 0

Gets the frame format.

Returns:

The frame format.

virtual const uint8_t *get_y() const = 0

Gets the Y component.

Returns:

The pointer to the Y data buffer.

virtual const uint8_t *get_u() const = 0

Gets the U component.

Returns:

The pointer to the U data buffer.

virtual const uint8_t *get_v() const = 0

Gets the V component for YUV.

Returns:

The pointer to the V data buffer.

virtual int stride_y() const = 0

Returns the Y component stride.

Returns:

An integer representing the Y component stride.

virtual int stride_u() const = 0

Returns the U component stride.

Returns:

An integer representing the U component stride.

virtual int stride_v() const = 0

Returns the V component stride.

Returns:

An integer representing the V component stride.

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