qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
An abstract source of video frames. More...
#include <videosource.h>
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} |
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.
using VideoSource::AtomicIDType = std::atomic_uint_fast64_t |
Definition at line 36 of file videosource.h.
using VideoSource::IDType = std::uint_fast64_t |
Definition at line 35 of file videosource.h.
|
inline |
Definition at line 39 of file videosource.h.
|
virtualdefault |
|
signal |
Emitted when new frame available to use.
frame | New frame. |
|
signal |
Emitted when the source is stopped for an indefinite amount of time, but might restart sending frames again later.
|
pure virtual |
If subscribe sucessfully opens the source, it will start emitting frameAvailable signals.
Implemented in CameraSource, and CoreVideoSource.
|
pure virtual |
Stop emitting frameAvailable signals, and free associated resources if necessary.
Implemented in CameraSource, and CoreVideoSource.
const IDType VideoSource::id |
ID of this VideoSource.
Definition at line 56 of file videosource.h.
|
staticprivate |
Definition at line 71 of file videosource.h.