Support Forum G3D Web Page |
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< VideoStreamServer > | create (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... | |
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.
|
protected |
void G3D::VideoStreamServer::addClient | ( | const shared_ptr< NetConnection > & | client | ) |
|
inline |
|
static |
|
inlinestaticprotectedinherited |
Like std::make_shared, but works for protected constructors.
Call as createShared<myclass>.
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.
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.
|
protected |
Referenced by clientConnectionArray().
|
protected |
Is this the first frame after a reset?
|
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.