Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
G3D::VideoStreamClient Class Reference

Inherits G3D::ReferenceCountedObject.

Public Member Functions

shared_ptr< Texturereceive ()
 Returns null if there is no next frame available in the queue yet. More...
 
const shared_ptr< NetConnection > & serverConnection ()
 

Static Public Member Functions

static shared_ptr< VideoStreamClientcreate (const shared_ptr< NetConnection > &server)
 
static shared_ptr< VideoStreamClientcreate (const NetAddress &serverAddress)
 

Static Public Attributes

static const NetChannel VIDEO_NET_CHANNEL
 

Protected Member Functions

 VideoStreamClient (const shared_ptr< NetConnection > &server)
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Protected Attributes

const shared_ptr< NetConnectionm_server
 
shared_ptr< Texturem_texture
 

Detailed Description

See also
G3D::VideoStreamServer

Constructor & Destructor Documentation

◆ VideoStreamClient()

G3D::VideoStreamClient::VideoStreamClient ( const shared_ptr< NetConnection > &  server)
protected

Member Function Documentation

◆ create() [1/2]

static shared_ptr<VideoStreamClient> G3D::VideoStreamClient::create ( const shared_ptr< NetConnection > &  server)
static

Referenced by create().

◆ create() [2/2]

static shared_ptr<VideoStreamClient> G3D::VideoStreamClient::create ( const NetAddress serverAddress)
inlinestatic

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ receive()

shared_ptr<Texture> G3D::VideoStreamClient::receive ( )

Returns null if there is no next frame available in the queue yet.

Threadsafe. Must be called on the OpenGL thread. May block for a short period of time. Output format is always SRGB8().
Calling this may re-use the texture from the previous call for efficiency, so do not invoke it until the previous texture is no longer in use by the application.

Invoke in a while loop until receive() returns nullptr to avoid frames backlogging.

Will return nullptr if the next message is not on the VIDEO_NET_CHANNEL, at which point the application must clear the non-video messages from the message iterator.

◆ serverConnection()

const shared_ptr<NetConnection>& G3D::VideoStreamClient::serverConnection ( )
inline

Member Data Documentation

◆ m_server

const shared_ptr<NetConnection> G3D::VideoStreamClient::m_server
protected

Referenced by serverConnection().

◆ m_texture

shared_ptr<Texture> G3D::VideoStreamClient::m_texture
protected

◆ VIDEO_NET_CHANNEL

const NetChannel G3D::VideoStreamClient::VIDEO_NET_CHANNEL
static

documentation generated on Wed Nov 24 2021 08:02:02 using doxygen 1.8.15