8#ifndef FACEBOOK_NETWORK_STREAMING_CLIENT_H
9#define FACEBOOK_NETWORK_STREAMING_CLIENT_H
119 inline std::string channel()
const;
125 inline std::string dataType()
const;
131 inline Buffer extraData()
const;
137 inline Address4 serverAddress()
const;
143 inline Port serverPort()
const;
150 bool start(
const std::string& channel = std::string());
169 inline bool isReceiving();
175 inline bool isPaused();
262 bool isReceiving_ =
false;
265 bool isPaused_ =
false;
This class implements a recursive lock object.
Definition Lock.h:31
This class wraps an address number with 32 bits.
Definition Address4.h:26
uint32_t MessageId
Definition of a message id.
Definition PackagedSocket.h:192
This class implements a packaged UDP server.
Definition PackagedUDPServer.h:25
This class wraps a port number with 16 bits.
Definition Port.h:26
This class implements a streaming client.
Definition StreamingClient.h:35
bool isReceiving_
Determines whether the client is currently receiving.
Definition StreamingClient.h:262
void onStart(const std::string &value, const SessionId sessionId)
Function handling start commands.
DataTypeChangedCallback dataTypeChangedCallback_
Data type and extra data changed callback function.
Definition StreamingClient.h:283
bool isReceiving()
Returns whether this client is currently receiving streaming data.
Definition StreamingClient.h:310
bool stop()
Stops the streaming.
void onPause(const std::string &value, const SessionId sessionId)
Function handling pause commands.
Buffer channelExtraData(const std::string &channel)
Returns extra data of a specified channel provides by the streaming server.
Address4 serverAddress() const
Returns the address of the connected streaming server.
Definition StreamingClient.h:322
bool connect(const Address4 &address, const Port &port)
Connects the streaming client with a remote streaming server.
~StreamingClient()
Destructs a streaming client.
bool pause()
Pauses the streaming.
void setReceiveCallback(const ReceiveCallback &callback)
Sets the callback function for streaming data received from the streaming server.
Definition StreamingClient.h:346
bool isConnected() const
Returns whether this client is currently connected with a streaming server.
StreamingClient()
Creates a new streaming client.
std::string channelDataType(const std::string &channel)
Returns a data type of a specified channel provides by the streaming server.
Buffer extraData_
Stream extra data (e.g., codec configuration).
Definition StreamingClient.h:259
RequestCallback requestCallback_
Streaming server request callback function.
Definition StreamingClient.h:280
Address4 serverAddress_
Address4 of the streaming server.
Definition StreamingClient.h:274
void onChangedDataType(const std::string &value, const SessionId sessionId)
Function handling changed data type commands.
void onUDPReceiveData(const Address4 &address, const Port &port, const void *data, const size_t size, const PackagedSocket::MessageId messageId)
Callback function for UDP receive message.
std::string channel() const
Returns the selected channel of the streaming server.
Definition StreamingClient.h:292
bool start(const std::string &channel=std::string())
(Re-)Starts the streaming.
PackagedUDPServer udpClient_
UDP client.
Definition StreamingClient.h:268
void onTCPReceiveData(const void *data, const size_t size)
Callback function for TCP receive message.
ReceiveCallback receiveCallback_
Streaming data receive callback function.
Definition StreamingClient.h:286
Buffer extraData() const
Returns the extra data of the streaming channel.
Definition StreamingClient.h:304
void onStop(const std::string &value, const SessionId sessionId)
Function handling stop commands.
Channels selectableChannels()
Returns a list of selectable channels provides by the streaming server.
std::string dataType() const
Returns the type of the streaming data.
Definition StreamingClient.h:298
bool disconnect()
Disconnects the streaming client.
void setDataTypeChangedCallback(const DataTypeChangedCallback &callback)
Sets the callback function for data type and extra data changes from the streaming server.
Definition StreamingClient.h:340
TCPClient tcpClient_
TCP client.
Definition StreamingClient.h:271
Lock lock_
Client lock.
Definition StreamingClient.h:289
Port serverPort() const
Returns the port of the connected streaming server.
Definition StreamingClient.h:328
Strings Channels
Definition of a vector holding channels.
Definition StreamingClient.h:61
std::string channel_
Stream channel.
Definition StreamingClient.h:253
void onCommand(const std::string &command, const std::string &value, const SessionId sessionId)
New command function.
void setRequestCallback(const RequestCallback &callback)
Sets the callback function for streaming server requests (like e.g.
Definition StreamingClient.h:334
Port serverPort_
Port of the streaming server.
Definition StreamingClient.h:277
bool isPaused()
Returns whether this client is currently paused.
Definition StreamingClient.h:316
bool isPaused_
Determines whether the client is pause.
Definition StreamingClient.h:265
std::string dataType_
Stream data type.
Definition StreamingClient.h:256
This class is the base class for all streaming objects.
Definition Streaming.h:25
MessageQueue::Id SessionId
Definition of a session id.
Definition Streaming.h:51
std::vector< uint8_t > Buffer
Definition of a vector holding bytes.
Definition Streaming.h:31
This class implements a TCP client.
Definition TCPClient.h:27
This class implements a scoped lock object for recursive lock objects.
Definition Lock.h:147
std::vector< std::string > Strings
Definition of a vector holding strings.
Definition Base.h:162
The namespace covering the entire Ocean framework.
Definition Accessor.h:15