qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
VideoSurface Class Reference

#include <videosurface.h>

Inheritance diagram for VideoSurface:
Inheritance graph
Collaboration diagram for VideoSurface:
Collaboration graph

Signals

void ratioChanged ()
 
void boundaryChanged ()
 

Public Member Functions

 VideoSurface (const QPixmap &avatar, QWidget *parent=nullptr, bool expanding=false)
 
 VideoSurface (const QPixmap &avatar, VideoSource *source, QWidget *parent=nullptr)
 
 ~VideoSurface ()
 
bool isExpanding () const
 
void setSource (VideoSource *src)
 Update source. More...
 
QRect getBoundingRect () const
 
float getRatio () const
 
void setAvatar (const QPixmap &pixmap)
 
QPixmap getAvatar () const
 

Protected Member Functions

void subscribe ()
 
void unsubscribe ()
 
void paintEvent (QPaintEvent *event) final
 
void resizeEvent (QResizeEvent *event) final
 
void showEvent (QShowEvent *event) final
 

Private Slots

void onNewFrameAvailable (const std::shared_ptr< VideoFrame > &newFrame)
 
void onSourceStopped ()
 

Private Member Functions

void recalulateBounds ()
 
void lock ()
 
void unlock ()
 

Private Attributes

QRect boundingRect
 
VideoSourcesource
 
std::shared_ptr< VideoFramelastFrame
 
std::atomic_bool frameLock
 Fast lock for lastFrame. More...
 
uint8_t hasSubscribed
 
QPixmap avatar
 
float ratio
 
bool expanding
 

Detailed Description

Definition at line 27 of file videosurface.h.

Constructor & Destructor Documentation

◆ VideoSurface() [1/2]

VideoSurface::VideoSurface ( const QPixmap &  avatar,
QWidget *  parent = nullptr,
bool  expanding = false 
)

Definition at line 43 of file videosurface.cpp.

◆ VideoSurface() [2/2]

VideoSurface::VideoSurface ( const QPixmap &  avatar,
VideoSource source,
QWidget *  parent = nullptr 
)

Definition at line 55 of file videosurface.cpp.

Here is the call graph for this function:

◆ ~VideoSurface()

VideoSurface::~VideoSurface ( )

Definition at line 61 of file videosurface.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ boundaryChanged

void VideoSurface::boundaryChanged ( )
signal
Here is the caller graph for this function:

◆ getAvatar()

QPixmap VideoSurface::getAvatar ( ) const

Definition at line 106 of file videosurface.cpp.

◆ getBoundingRect()

QRect VideoSurface::getBoundingRect ( ) const

Definition at line 88 of file videosurface.cpp.

Here is the caller graph for this function:

◆ getRatio()

float VideoSurface::getRatio ( ) const

Definition at line 95 of file videosurface.cpp.

Here is the caller graph for this function:

◆ isExpanding()

bool VideoSurface::isExpanding ( ) const

Definition at line 66 of file videosurface.cpp.

◆ lock()

void VideoSurface::lock ( )
private

Definition at line 231 of file videosurface.cpp.

Here is the caller graph for this function:

◆ onNewFrameAvailable

void VideoSurface::onNewFrameAvailable ( const std::shared_ptr< VideoFrame > &  newFrame)
privateslot

Definition at line 142 of file videosurface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onSourceStopped

void VideoSurface::onSourceStopped ( )
privateslot

Definition at line 163 of file videosurface.cpp.

Here is the caller graph for this function:

◆ paintEvent()

void VideoSurface::paintEvent ( QPaintEvent *  event)
finalprotected

Definition at line 170 of file videosurface.cpp.

Here is the call graph for this function:

◆ ratioChanged

void VideoSurface::ratioChanged ( )
signal
Here is the caller graph for this function:

◆ recalulateBounds()

void VideoSurface::recalulateBounds ( )
private

Definition at line 208 of file videosurface.cpp.

Here is the caller graph for this function:

◆ resizeEvent()

void VideoSurface::resizeEvent ( QResizeEvent *  event)
finalprotected

Definition at line 195 of file videosurface.cpp.

Here is the call graph for this function:

◆ setAvatar()

void VideoSurface::setAvatar ( const QPixmap &  pixmap)

Definition at line 100 of file videosurface.cpp.

◆ setSource()

void VideoSurface::setSource ( VideoSource src)

Update source.

Note
nullptr is a valid option.
Parameters
srcsource to set.

Unsubscribe from old source and subscribe to new.

Definition at line 78 of file videosurface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ showEvent()

void VideoSurface::showEvent ( QShowEvent *  event)
finalprotected

Definition at line 202 of file videosurface.cpp.

◆ subscribe()

void VideoSurface::subscribe ( )
protected

Definition at line 111 of file videosurface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unlock()

void VideoSurface::unlock ( )
private

Definition at line 239 of file videosurface.cpp.

Here is the caller graph for this function:

◆ unsubscribe()

void VideoSurface::unsubscribe ( )
protected

Definition at line 120 of file videosurface.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ avatar

QPixmap VideoSurface::avatar
private

Definition at line 69 of file videosurface.h.

◆ boundingRect

QRect VideoSurface::boundingRect
private

Definition at line 64 of file videosurface.h.

◆ expanding

bool VideoSurface::expanding
private

Definition at line 71 of file videosurface.h.

◆ frameLock

std::atomic_bool VideoSurface::frameLock
private

Fast lock for lastFrame.

Definition at line 67 of file videosurface.h.

◆ hasSubscribed

uint8_t VideoSurface::hasSubscribed
private

Definition at line 68 of file videosurface.h.

◆ lastFrame

std::shared_ptr<VideoFrame> VideoSurface::lastFrame
private

Definition at line 66 of file videosurface.h.

◆ ratio

float VideoSurface::ratio
private

Definition at line 70 of file videosurface.h.

◆ source

VideoSource* VideoSurface::source
private

Definition at line 65 of file videosurface.h.


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