#include <ArHybridForwarderVideo.h>
Inheritance diagram for ArHybridForwarderVideo:
Public Member Functions | |
virtual void | addToCameraCollection (ArCameraCollection &collection) |
Adds this item to the given camera collection. | |
ArHybridForwarderVideo (ArServerBase *server, const char *hostname="localhost", int port=7070) | |
Constructor that just takes a host and port and makes its own client. | |
ArHybridForwarderVideo (ArServerBase *server, ArClientBase *client) | |
Constructor that takes a client. | |
void | clientCycleCallback (void) |
Our callback that requests more video. | |
virtual const char * | getCameraName () |
Returns the name of the camera handled by this item. | |
bool | isForwardingVideo (void) const |
Returns if we're forwarding video or not. | |
void | receiveVideo (ArNetPacket *packet) |
Receives the video (and sets a timer to wait a bit and get it again). | |
void | receiveVideoSize (ArNetPacket *packet) |
Receives the video size (just gets this once). | |
void | sendVideo (ArServerClient *client, ArNetPacket *packet) |
Sends the last received video. | |
void | sendVideoSize (ArServerClient *client, ArNetPacket *packet) |
Sends the last received video size (just gets this once). | |
virtual void | setCameraName (const char *cameraName) |
This method must be called before addToCameraCollection(). | |
int | setVideoRequestTime (void) const |
Gets how often after getting video we ask for it again. | |
void | setVideoRequestTime (int ms) |
Sets how often after getting video we ask for it again. | |
virtual | ~ArHybridForwarderVideo () |
Destructor. | |
Protected Member Functions | |
void | finishConstructor (void) |
Protected Attributes | |
std::string | myCameraName |
ArClientBase * | myClient |
ArFunctorC< ArHybridForwarderVideo > * | myClientCycleCB |
bool | myForwardingVideo |
bool | myIsSendVideoAvailable |
ArTime | myLastReceivedVideo |
ArTime | myLastReqSent |
ArMutex | myMutex |
ArNetPacket | myReceivedVideo |
ArNetPacket | myReceivedVideoSize |
ArFunctor1C< ArHybridForwarderVideo, ArNetPacket * > * | myReceiveVideoCB |
ArFunctor1C< ArHybridForwarderVideo, ArNetPacket * > * | myReceiveVideoSizeCB |
bool | myReqSent |
ArNetPacket | mySendVideoArgument |
ArFunctor2C< ArHybridForwarderVideo, ArServerClient *, ArNetPacket * > * | mySendVideoCB |
ArFunctor2C< ArHybridForwarderVideo, ArServerClient *, ArNetPacket * > * | mySendVideoSizeCB |
ArServerBase * | myServer |
int | myVideoRequestTime |
Definition at line 34 of file ArHybridForwarderVideo.h.
|
Constructor that takes a client.
Definition at line 36 of file ArHybridForwarderVideo.cpp. References client, finishConstructor(), myClient, and myServer. |
|
Constructor that just takes a host and port and makes its own client.
Definition at line 53 of file ArHybridForwarderVideo.cpp. References ArClientBase::blockingConnect(), finishConstructor(), myClient, myServer, ArClientBase::runAsync(), and ArClientBase::setConnectTimeoutTime(). |
|
Destructor.
Definition at line 65 of file ArHybridForwarderVideo.cpp. |
|
Adds this item to the given camera collection.
Implements ArCameraCollectionItem. Definition at line 144 of file ArHybridForwarderVideo.cpp. References ArLog::log(). |
|
Our callback that requests more video.
Definition at line 247 of file ArHybridForwarderVideo.cpp. References ArMutex::lock(), ArTime::mSecSince(), myClient, myLastReceivedVideo, myLastReqSent, myMutex, myReqSent, mySendVideoArgument, myVideoRequestTime, ArClientBase::requestOnce(), ArTime::setToNow(), and ArMutex::unlock(). Referenced by finishConstructor(). |
|
|
Returns the name of the camera handled by this item.
Implements ArCameraCollectionItem. Definition at line 126 of file ArHybridForwarderVideo.cpp. References myCameraName. |
|
Returns if we're forwarding video or not.
Definition at line 261 of file ArHybridForwarderVideo.cpp. References myForwardingVideo. Referenced by main(). |
|
Receives the video (and sets a timer to wait a bit and get it again).
Definition at line 236 of file ArHybridForwarderVideo.cpp. References ArNetPacket::duplicatePacket(), ArMutex::lock(), myLastReceivedVideo, myMutex, myReceivedVideo, myReqSent, ArNetPacket::resetRead(), ArTime::setToNow(), and ArMutex::unlock(). Referenced by finishConstructor(). |
|
Receives the video size (just gets this once).
Definition at line 227 of file ArHybridForwarderVideo.cpp. References ArNetPacket::duplicatePacket(), ArMutex::lock(), myMutex, myReceivedVideoSize, mySendVideoArgument, ArNetPacket::resetRead(), and ArMutex::unlock(). Referenced by finishConstructor(). |
|
Sends the last received video.
Definition at line 210 of file ArHybridForwarderVideo.cpp. References client, ArNetPacket::duplicatePacket(), ArMutex::lock(), myMutex, myReceivedVideo, mySendVideoArgument, ArNetPacket::resetRead(), ArClientBase::sendPacketUdp(), ArNetPacket::setCommand(), and ArMutex::unlock(). Referenced by finishConstructor(). |
|
Sends the last received video size (just gets this once).
Definition at line 201 of file ArHybridForwarderVideo.cpp. References client, ArMutex::lock(), myMutex, myReceivedVideoSize, ArClientBase::sendPacketTcp(), ArNetPacket::setCommand(), and ArMutex::unlock(). Referenced by finishConstructor(). |
|
This method must be called before addToCameraCollection().
Definition at line 131 of file ArHybridForwarderVideo.cpp. References myCameraName. |
|
Gets how often after getting video we ask for it again.
Definition at line 84 of file ArHybridForwarderVideo.h. References myVideoRequestTime. |
|
Sets how often after getting video we ask for it again.
Definition at line 82 of file ArHybridForwarderVideo.h. References myVideoRequestTime. |
|
Definition at line 88 of file ArHybridForwarderVideo.h. Referenced by getCameraName(), and setCameraName(). |
|
Definition at line 100 of file ArHybridForwarderVideo.h. Referenced by ArHybridForwarderVideo(), clientCycleCallback(), and finishConstructor(). |
|
Definition at line 107 of file ArHybridForwarderVideo.h. Referenced by finishConstructor(). |
|
Definition at line 91 of file ArHybridForwarderVideo.h. Referenced by finishConstructor(), and isForwardingVideo(). |
|
Definition at line 109 of file ArHybridForwarderVideo.h. Referenced by finishConstructor(). |
|
Definition at line 95 of file ArHybridForwarderVideo.h. Referenced by clientCycleCallback(), finishConstructor(), and receiveVideo(). |
|
Definition at line 96 of file ArHybridForwarderVideo.h. Referenced by clientCycleCallback(), and finishConstructor(). |
|
Definition at line 90 of file ArHybridForwarderVideo.h. Referenced by clientCycleCallback(), receiveVideo(), receiveVideoSize(), sendVideo(), and sendVideoSize(). |
|
Definition at line 93 of file ArHybridForwarderVideo.h. Referenced by receiveVideo(), and sendVideo(). |
|
Definition at line 92 of file ArHybridForwarderVideo.h. Referenced by receiveVideoSize(), and sendVideoSize(). |
|
Definition at line 106 of file ArHybridForwarderVideo.h. Referenced by finishConstructor(). |
|
Definition at line 105 of file ArHybridForwarderVideo.h. Referenced by finishConstructor(). |
|
Definition at line 97 of file ArHybridForwarderVideo.h. Referenced by clientCycleCallback(), finishConstructor(), and receiveVideo(). |
|
Definition at line 94 of file ArHybridForwarderVideo.h. Referenced by clientCycleCallback(), receiveVideoSize(), and sendVideo(). |
|
Definition at line 104 of file ArHybridForwarderVideo.h. Referenced by finishConstructor(). |
|
Definition at line 102 of file ArHybridForwarderVideo.h. Referenced by finishConstructor(). |
|
Definition at line 99 of file ArHybridForwarderVideo.h. Referenced by ArHybridForwarderVideo(), and finishConstructor(). |
|
Definition at line 98 of file ArHybridForwarderVideo.h. Referenced by clientCycleCallback(), finishConstructor(), and setVideoRequestTime(). |