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::VideoStreamServer Class Reference

Server-side class for streaming low-latency lossy video with GPU MPEG encoding. More...

Inherits G3D::ReferenceCountedObject.

Public Member Functions

void addClient (const shared_ptr< NetConnection > &client)
 
const Array< shared_ptr< NetConnection > > & clientConnectionArray () const
 
void removeClient (const shared_ptr< NetConnection > &client)
 Clients that have disconnected are automatically removed during send(). More...
 
void send (const shared_ptr< Texture > &frame)
 Video is initialized on the first frame and must have the same resolution after that. More...
 

Static Public Member Functions

static shared_ptr< VideoStreamServercreate (const Array< shared_ptr< NetConnection >> &clientArray=Array< shared_ptr< NetConnection >>())
 

Static Public Attributes

static const NetChannel VIDEO_NET_CHANNEL
 Messages are sent on this channel, allowing them to be scheduled asynchronously from other messages in the system when sending. More...
 

Protected Member Functions

 VideoStreamServer (const Array< shared_ptr< NetConnection >> &clientArray)
 

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

Array< shared_ptr< NetConnection > > m_clientArray
 
bool m_firstFrame = true
 Is this the first frame after a reset? More...
 

Detailed Description

Server-side class for streaming low-latency lossy video with GPU MPEG encoding.

This manages the clients rather than simply performing the encoding so that it can communicate with the network asynchronously rather than blocking in send(). All communication for the video streaming is on the VIDEO_NET_CHANNEL, which the application should not use for other communication.

See also
G3D::VideoStreamClient

Constructor & Destructor Documentation

◆ VideoStreamServer()

G3D::VideoStreamServer::VideoStreamServer ( const Array< shared_ptr< NetConnection >> &  clientArray)
protected

Member Function Documentation

◆ addClient()

void G3D::VideoStreamServer::addClient ( const shared_ptr< NetConnection > &  client)

◆ clientConnectionArray()

const Array<shared_ptr<NetConnection> >& G3D::VideoStreamServer::clientConnectionArray ( ) const
inline

◆ create()

static shared_ptr<VideoStreamServer> G3D::VideoStreamServer::create ( const Array< shared_ptr< NetConnection >> &  clientArray = Array< shared_ptr< NetConnection >>())
static

◆ 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>.

◆ removeClient()

void G3D::VideoStreamServer::removeClient ( const shared_ptr< NetConnection > &  client)

Clients that have disconnected are automatically removed during send().

Invoke removeClient() to explicitly remove a live connection.

◆ send()

void G3D::VideoStreamServer::send ( const shared_ptr< Texture > &  frame)

Video is initialized on the first frame and must have the same resolution after that.

Threadsafe. Must be called on the OpenGL thread.

Member Data Documentation

◆ m_clientArray

Array<shared_ptr<NetConnection> > G3D::VideoStreamServer::m_clientArray
protected

Referenced by clientConnectionArray().

◆ m_firstFrame

bool G3D::VideoStreamServer::m_firstFrame = true
protected

Is this the first frame after a reset?

◆ VIDEO_NET_CHANNEL

const NetChannel G3D::VideoStreamServer::VIDEO_NET_CHANNEL
static

Messages are sent on this channel, allowing them to be scheduled asynchronously from other messages in the system when sending.

The receiver will accumulate all messages into a single receipt queue.


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