plugin::injector

🚀

SDK Beta

This class is a part of the Beta program.

Module: Default Media Injector Plugin

The base abstract class for the Default Media Injector's.

#include <injector.h>

Inherits from dolbyio::comms::media_source_interface, dolbyio::comms::video_source, dolbyio::comms::audio_source

Inherited by dolbyio::comms::plugin::injector_paced, dolbyio::comms::plugin::injector_passthrough

Public Types

Name
using std::function< void(const media_injection_status &)>media_injection_status_cb

Public Functions

Name
~injector()
The destructor of the injector.
injector(media_injection_status_cb && status_cb)
Constructor for the injector base abstract class.
virtual boolinject_video_frame(std::unique_ptr< video_frame > && frame) =0
Inject a raw video frame into the conference. The video frame must contain YUV pixels.
virtual boolinject_audio_frame(std::unique_ptr< audio_frame > && frame) =0
Inject an audio frame into the conference. The audio frame must contain 10ms of PCM data.

Additional inherited members

Public Functions inherited from dolbyio::comms::media_source_interface

Name
virtual video_source *video() =0
Gets the video source interface. Override this method to provide access to the Video Source implementation.
virtual audio_source *audio() =0
Gets the audio source interface. Override this method to provide access to the Audio Source implementation.

Public Functions inherited from dolbyio::comms::video_source

Name
virtual voidregister_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.
virtual voidderegister_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.

Public Functions inherited from dolbyio::comms::audio_source

Name
virtual voidregister_audio_frame_rtc_source(rtc_audio_source * source) =0
Connects the RTC Audio Source to the audio source, in essence creating the audio injection pipeline. This method will be called by the media_engine when an Audio Track is attached to the active Peer Connection.
virtual voidderegister_audio_frame_rtc_source() =0
Disconnects the RTC Audio Source from the Audio Source, in essence destructing the audio pipeline. This method is called by the media_engine whenever an Audio Track is to be detached from the active Peer Connection.
class dolbyio::comms::plugin::injector;

Public Types Documentation

using media_injection_status_cb

using dolbyio::comms::plugin::injector::media_injection_status_cb =  std::function<void(const media_injection_status&)>;

Public Functions Documentation

function ~injector

~injector()

The destructor of the injector.

function injector

injector(
    media_injection_status_cb && status_cb
)

Constructor for the injector base abstract class.

Parameters:

  • status_cb Status callback function object, which the application should provide. The injector invokes the function object for any status changes it encounters and provide the media_injection_status object as a parameter. This callback is invoked on either of the injector's media injection thread, or possibly on the injection sources thread. Either way the application should ensure this callback is thread-safe.

function inject_video_frame

virtual bool inject_video_frame(
    std::unique_ptr< video_frame > && frame
) =0

Inject a raw video frame into the conference. The video frame must contain YUV pixels.

Parameters:

  • frame The video frame.

Returns:

  • true On successful push of frame.
  • false On failure to push frame.

Reimplemented by: dolbyio::comms::plugin::injector_passthrough::inject_video_frame, dolbyio::comms::plugin::injector_paced::inject_video_frame

This function returns once the raw video frame has been placed onto the encoderqueue by VideoStreamEncoderOnFrame. The video frame is only actually free once the encoder is done with it.

function inject_audio_frame

virtual bool inject_audio_frame(
    std::unique_ptr< audio_frame > && frame
) =0

Inject an audio frame into the conference. The audio frame must contain 10ms of PCM data.

Parameters:

  • frame Audio frame containing raw PCM data.

Returns:

  • true On successful push of frame.
  • false On failure to push frame.

Reimplemented by: dolbyio::comms::plugin::injector_passthrough::inject_audio_frame, dolbyio::comms::plugin::injector_paced::inject_audio_frame

When this function returns, the audio_frame is be deleted and the audio data is memcpy'd in the WebRtcAudioSendStream::OnData function (which implements AudioSource::Sink::OnData).



Did this page help you?