qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Types | Signals | Public Member Functions | Public Attributes | Static Private Attributes | List of all members
VideoSource Class Referenceabstract

An abstract source of video frames. More...

#include <videosource.h>

Inheritance diagram for VideoSource:
Inheritance graph
Collaboration diagram for VideoSource:
Collaboration graph

Public Types

using IDType = std::uint_fast64_t
 
using AtomicIDType = std::atomic_uint_fast64_t
 

Signals

void frameAvailable (std::shared_ptr< VideoFrame > frame)
 Emitted when new frame available to use. More...
 
void sourceStopped ()
 Emitted when the source is stopped for an indefinite amount of time, but might restart sending frames again later. More...
 

Public Member Functions

 VideoSource ()
 
virtual ~VideoSource ()=default
 
virtual void subscribe ()=0
 If subscribe sucessfully opens the source, it will start emitting frameAvailable signals. More...
 
virtual void unsubscribe ()=0
 Stop emitting frameAvailable signals, and free associated resources if necessary. More...
 

Public Attributes

const IDType id
 ID of this VideoSource. More...
 

Static Private Attributes

static AtomicIDType sourceIDs {0}
 

Detailed Description

An abstract source of video frames.

When it has at least one subscriber the source will emit new video frames. Subscribing is recursive, multiple users can subscribe to the same VideoSource.

Definition at line 29 of file videosource.h.

Member Typedef Documentation

◆ AtomicIDType

using VideoSource::AtomicIDType = std::atomic_uint_fast64_t

Definition at line 36 of file videosource.h.

◆ IDType

using VideoSource::IDType = std::uint_fast64_t

Definition at line 35 of file videosource.h.

Constructor & Destructor Documentation

◆ VideoSource()

VideoSource::VideoSource ( )
inline

Definition at line 39 of file videosource.h.

◆ ~VideoSource()

virtual VideoSource::~VideoSource ( )
virtualdefault

Member Function Documentation

◆ frameAvailable

void VideoSource::frameAvailable ( std::shared_ptr< VideoFrame frame)
signal

Emitted when new frame available to use.

Parameters
frameNew frame.
Here is the caller graph for this function:

◆ sourceStopped

void VideoSource::sourceStopped ( )
signal

Emitted when the source is stopped for an indefinite amount of time, but might restart sending frames again later.

Here is the caller graph for this function:

◆ subscribe()

virtual void VideoSource::subscribe ( )
pure virtual

If subscribe sucessfully opens the source, it will start emitting frameAvailable signals.

Implemented in CameraSource, and CoreVideoSource.

Here is the caller graph for this function:

◆ unsubscribe()

virtual void VideoSource::unsubscribe ( )
pure virtual

Stop emitting frameAvailable signals, and free associated resources if necessary.

Implemented in CameraSource, and CoreVideoSource.

Here is the caller graph for this function:

Member Data Documentation

◆ id

const IDType VideoSource::id

ID of this VideoSource.

Definition at line 56 of file videosource.h.

◆ sourceIDs

VideoSource::AtomicIDType VideoSource::sourceIDs {0}
staticprivate

Definition at line 71 of file videosource.h.


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