Video Source Interface

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

The interface through which raw video frames are provided to the CoreSDK. Application writers who want to implement this source must override the two virtual functions of registering and cpp:func:deregistering <dolbyio::comms::video_source::deregister_video_frame_rtc_source> the RTC Video Source on the Injector. When a VideoTrack is successfully added to an active PeerConnection, these virtual functions are invoked to provide/remove the reference to the RTC Video Source. Attaching the RTC Video source to the injector establishes the video pipeline so that frames can be passed to Webrtc.

class dolbyio::comms::video_source

The interface for providing video frames.

This interface must be implemented by the injector, it shall serve as the source of video frames passed to the rtc_video_source.

Subclassed by dolbyio::comms::plugin::injector

Public Functions

virtual void register_video_frame_rtc_source(rtc_video_source *source) = 0

Connects the rtc_video_source to the video source, in essence creating the video injection pipeline. This method will be called by the media_engine when a Video Track is attached to the active Peer Connection.


source – The RTC Video Source which will receive the injected video frames.

virtual void deregister_video_frame_rtc_source() = 0

Disconnects the RTC Video Source from the Video Source, in essence destructing the video pipeline. This method is called by the media_engine whenever a Video Track is to be detached from the active Peer Connection.

The RTC Video Source is NOT to be implemented by the application. This is the interface through which the injector can view its own Video Sink. After receiving video frames from some media source, the injector provides the raw video frames to this RTC Video Source. The RTC Video Source then pushes the frame buffers along the video pipeline until they are injected into the conference. The raw video frame is deleted once it has been encoded. The RTC Video Source expects video frames.

class dolbyio::comms::rtc_video_source

The adapter which is used for providing video frames into WebRTC. This interface is a video sink from the perspective of the Injector. It is a video source from the perspective of WebRTC Video Tracks, thus it provides this connection in establishing the video injection pipeline.

This interface is NOT implemented by the injector, it is used to be the injector to provide video frames.

Public Functions

virtual void handle_frame(std::unique_ptr<video_frame> frame) = 0

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


frame – The pointer to the video frame.

See Example Injector Implementation for an example of child injection class for all possible media.