Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::video::VideoMixer Class Reference

#include <video_mixer.h>

Inheritance diagram for jami::video::VideoMixer:
Inheritance graph
Collaboration diagram for jami::video::VideoMixer:
Collaboration graph

Classes

struct  VideoMixerSource
 

Public Member Functions

void addAudioOnlySource (const std::string &callId, const std::string &streamId)
 
void attached (Observable< std::shared_ptr< MediaFrame > > *ob) override
 
void attachVideo (Observable< std::shared_ptr< MediaFrame > > *frame, const std::string &callId, const std::string &streamId)
 
void detached (Observable< std::shared_ptr< MediaFrame > > *ob) override
 
void detachVideo (Observable< std::shared_ptr< MediaFrame > > *frame)
 
int getHeight () const override
 
AVPixelFormat getPixelFormat () const override
 
std::shared_ptr< SinkClient > & getSink ()
 
MediaStream getStream (const std::string &name) const
 
Layout getVideoLayout () const
 
std::shared_ptr< VideoFrameActiveWritergetVideoLocal () const
 
int getWidth () const override
 
void removeAudioOnlySource (const std::string &callId, const std::string &streamId)
 
void resetActiveStream ()
 
void setActiveStream (const std::string &id)
 
void setOnSourcesUpdated (OnSourcesUpdatedCb &&cb)
 
void setParameters (int width, int height, AVPixelFormat format=AV_PIX_FMT_YUV422P)
 
void setVideoLayout (Layout newLayout)
 
void stopInputs ()
 Stop all inputs.
 
StreamInfo streamInfo (Observable< std::shared_ptr< MediaFrame > > *frame) const
 
void switchInputs (const std::vector< std::string > &inputs)
 Set all inputs at once.
 
void update (Observable< std::shared_ptr< MediaFrame > > *ob, const std::shared_ptr< MediaFrame > &v) override
 
void updateLayout ()
 
bool verifyActive (const std::string &id)
 
 VideoMixer (const std::string &id, const std::string &localInput={}, bool attachHost=false)
 
 ~VideoMixer ()
 
- Public Member Functions inherited from jami::video::VideoGenerator
void flushFrames ()
 
VideoFramegetNewFrame ()
 
std::shared_ptr< VideoFrameobtainLastFrame ()
 
void publishFrame ()
 
void publishFrame (std::shared_ptr< VideoFrame >)
 
 VideoGenerator ()
 
- Public Member Functions inherited from jami::Observable< std::shared_ptr< MediaFrame > >
bool attach (Observer< std::shared_ptr< MediaFrame > > *o)
 
void attachPriorityObserver (std::shared_ptr< Observer< std::shared_ptr< MediaFrame > > > o)
 
bool detach (Observer< std::shared_ptr< MediaFrame > > *o)
 
void detachPriorityObserver (Observer< std::shared_ptr< MediaFrame > > *o)
 
size_t getObserversCount ()
 
 Observable ()
 
virtual ~Observable ()
 ~Observable Detach all observers to avoid making them call this observable when destroyed
 
- Public Member Functions inherited from jami::Observer< std::shared_ptr< MediaFrame > >
virtual ~Observer ()
 

Additional Inherited Members

- Protected Member Functions inherited from jami::Observable< std::shared_ptr< MediaFrame > >
void notify (std::shared_ptr< MediaFrame > data)
 
- Protected Attributes inherited from jami::Observable< std::shared_ptr< MediaFrame > >
std::mutex mutex_
 
std::set< Observer< std::shared_ptr< MediaFrame > > * > observers_
 
std::list< std::weak_ptr< Observer< std::shared_ptr< MediaFrame > > > > priority_observers_
 

Detailed Description

Definition at line 56 of file video_mixer.h.

Constructor & Destructor Documentation

◆ VideoMixer()

jami::video::VideoMixer::VideoMixer ( const std::string &  id,
const std::string &  localInput = {},
bool  attachHost = false 
)

Definition at line 80 of file video_mixer.cpp.

◆ ~VideoMixer()

jami::video::VideoMixer::~VideoMixer ( )

Definition at line 100 of file video_mixer.cpp.

References JAMI_DBG, jami::ThreadLoop::join(), and stopInputs().

Here is the call graph for this function:

Member Function Documentation

◆ addAudioOnlySource()

void jami::video::VideoMixer::addAudioOnlySource ( const std::string &  callId,
const std::string &  streamId 
)
inline

Definition at line 119 of file video_mixer.h.

References jami::emitSignal(), and updateLayout().

Here is the call graph for this function:

◆ attached()

void jami::video::VideoMixer::attached ( Observable< std::shared_ptr< MediaFrame > > *  ob)
overridevirtual

Reimplemented from jami::Observer< std::shared_ptr< MediaFrame > >.

Definition at line 210 of file video_mixer.cpp.

References jami::emitSignal(), JAMI_DBG, JAMI_DEBUG, and updateLayout().

Here is the call graph for this function:

◆ attachVideo()

void jami::video::VideoMixer::attachVideo ( Observable< std::shared_ptr< MediaFrame > > *  frame,
const std::string &  callId,
const std::string &  streamId 
)

Definition at line 173 of file video_mixer.cpp.

References jami::emitSignal(), and JAMI_DBG.

Referenced by switchInputs().

Here is the call graph for this function:

◆ detached()

void jami::video::VideoMixer::detached ( Observable< std::shared_ptr< MediaFrame > > *  ob)
overridevirtual

Reimplemented from jami::Observer< std::shared_ptr< MediaFrame > >.

Definition at line 224 of file video_mixer.cpp.

References jami::emitSignal(), JAMI_DBG, JAMI_DEBUG, and updateLayout().

Here is the call graph for this function:

◆ detachVideo()

void jami::video::VideoMixer::detachVideo ( Observable< std::shared_ptr< MediaFrame > > *  frame)

Definition at line 188 of file video_mixer.cpp.

References jami::Observable< std::shared_ptr< MediaFrame > >::detach(), jami::emitSignal(), JAMI_DBG, and verifyActive().

Here is the call graph for this function:

◆ getHeight()

int jami::video::VideoMixer::getHeight ( ) const
overridevirtual

Implements jami::video::VideoGenerator.

Definition at line 585 of file video_mixer.cpp.

◆ getPixelFormat()

AVPixelFormat jami::video::VideoMixer::getPixelFormat ( ) const
overridevirtual

Implements jami::video::VideoGenerator.

Definition at line 591 of file video_mixer.cpp.

◆ getSink()

std::shared_ptr< SinkClient > & jami::video::VideoMixer::getSink ( )
inline

Definition at line 117 of file video_mixer.h.

◆ getStream()

◆ getVideoLayout()

Layout jami::video::VideoMixer::getVideoLayout ( ) const
inline

Definition at line 102 of file video_mixer.h.

◆ getVideoLocal()

std::shared_ptr< VideoFrameActiveWriter > jami::video::VideoMixer::getVideoLocal ( ) const
inline

Definition at line 108 of file video_mixer.h.

◆ getWidth()

int jami::video::VideoMixer::getWidth ( ) const
overridevirtual

Implements jami::video::VideoGenerator.

Definition at line 579 of file video_mixer.cpp.

◆ removeAudioOnlySource()

void jami::video::VideoMixer::removeAudioOnlySource ( const std::string &  callId,
const std::string &  streamId 
)
inline

Definition at line 127 of file video_mixer.h.

References jami::emitSignal(), and updateLayout().

Here is the call graph for this function:

◆ resetActiveStream()

void jami::video::VideoMixer::resetActiveStream ( )
inline

Definition at line 86 of file video_mixer.h.

References updateLayout().

Referenced by setVideoLayout().

Here is the call graph for this function:

◆ setActiveStream()

void jami::video::VideoMixer::setActiveStream ( const std::string &  id)

Definition at line 158 of file video_mixer.cpp.

References updateLayout().

Here is the call graph for this function:

◆ setOnSourcesUpdated()

void jami::video::VideoMixer::setOnSourcesUpdated ( OnSourcesUpdatedCb &&  cb)
inline

Definition at line 104 of file video_mixer.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ setParameters()

void jami::video::VideoMixer::setParameters ( int  width,
int  height,
AVPixelFormat  format = AV_PIX_FMT_YUV422P 
)

Definition at line 534 of file video_mixer.cpp.

References jami::emitSignal(), jami::libav_utils::fillWithBlack(), jami::video::VideoGenerator::obtainLastFrame(), and updateLayout().

Here is the call graph for this function:

◆ setVideoLayout()

void jami::video::VideoMixer::setVideoLayout ( Layout  newLayout)
inline

Definition at line 94 of file video_mixer.h.

References jami::emitSignal(), jami::video::GRID, and resetActiveStream().

Here is the call graph for this function:

◆ stopInputs()

void jami::video::VideoMixer::stopInputs ( )

Stop all inputs.

Definition at line 150 of file video_mixer.cpp.

Referenced by switchInputs(), and ~VideoMixer().

◆ streamInfo()

StreamInfo jami::video::VideoMixer::streamInfo ( Observable< std::shared_ptr< MediaFrame > > *  frame) const
inline

Definition at line 141 of file video_mixer.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ switchInputs()

void jami::video::VideoMixer::switchInputs ( const std::vector< std::string > &  inputs)

Set all inputs at once.

Parameters
inputsNew inputs
Note
previous inputs will be stopped

Definition at line 111 of file video_mixer.cpp.

References attachVideo(), jami::emitSignal(), stopInputs(), and jami::sip_utils::streamId().

Here is the call graph for this function:

◆ update()

void jami::video::VideoMixer::update ( Observable< std::shared_ptr< MediaFrame > > *  ob,
const std::shared_ptr< MediaFrame > &  v 
)
overridevirtual

Implements jami::Observer< std::shared_ptr< MediaFrame > >.

Definition at line 240 of file video_mixer.cpp.

References jami::emitSignal(), JAMI_ERR, and jami::video::HardwareAccel::transferToMainMemory().

Here is the call graph for this function:

◆ updateLayout()

void jami::video::VideoMixer::updateLayout ( )

◆ verifyActive()

bool jami::video::VideoMixer::verifyActive ( const std::string &  id)
inline

Definition at line 92 of file video_mixer.h.

Referenced by detachVideo().


The documentation for this class was generated from the following files: