00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef OPAL_H224_H224HANDLER_H
00027 #define OPAL_H224_H224HANDLER_H
00028
00029 #ifdef P_USE_PRAGMA
00030 #pragma interface
00031 #endif
00032
00033 #ifndef _PTLIB_H
00034 #include <ptlib.h>
00035 #endif
00036
00037 #include <opal/buildopts.h>
00038
00039 #include <opal/connection.h>
00040 #include <opal/transports.h>
00041 #include <rtp/rtp.h>
00042 #include <h224/h281handler.h>
00043
00044 #define H281_CLIENT_ID 0x01
00045
00046 class H224_Frame;
00047
00048 #if 0
00049
00050 class OpalH224ReceiverThread : public PThread
00051 {
00052 PCLASSINFO(OpalH224ReceiverThread, PThread);
00053
00054 public:
00055
00056 OpalH224ReceiverThread(OpalH224Handler *h224Handler, RTP_Session & rtpSession);
00057 ~OpalH224ReceiverThread();
00058
00059 virtual void Main();
00060
00061 void Close();
00062
00063 private:
00064
00065 OpalH224Handler *h224Handler;
00066 mutable PMutex inUse;
00067 unsigned timestamp;
00068 RTP_Session & rtpSession;
00069 PBoolean terminate;
00070 };
00071
00072 class OpalH281Handler;
00073 class OpalConnection;
00074
00075 class OpalH224Handler : public PObject
00076 {
00077 PCLASSINFO(OpalH224Handler, PObject);
00078
00079 public:
00080
00081 OpalH224Handler(OpalRTPConnection & connection, unsigned sessionID);
00082 ~OpalH224Handler();
00083
00084 virtual void StartTransmit();
00085 virtual void StopTransmit();
00086 virtual void StartReceive();
00087 virtual void StopReceive();
00088
00089 PBoolean SendClientList();
00090 PBoolean SendExtraCapabilities();
00091 PBoolean SendClientListCommand();
00092 PBoolean SendExtraCapabilitiesCommand(BYTE clientID);
00093
00094 PBoolean SendExtraCapabilitiesMessage(BYTE clientID, BYTE *data, PINDEX length);
00095
00096 PBoolean TransmitClientFrame(BYTE clientID, H224_Frame & frame);
00097
00098 virtual PBoolean OnReceivedFrame(H224_Frame & frame);
00099 virtual PBoolean OnReceivedCMEMessage(H224_Frame & frame);
00100 virtual PBoolean OnReceivedClientList(H224_Frame & frame);
00101 virtual PBoolean OnReceivedClientListCommand();
00102 virtual PBoolean OnReceivedExtraCapabilities(H224_Frame & frame);
00103 virtual PBoolean OnReceivedExtraCapabilitiesCommand();
00104
00105 PMutex & GetTransmitMutex() { return transmitMutex; }
00106
00107 RTP_Session * GetSession() const { return session; }
00108
00109 virtual OpalH224ReceiverThread * CreateH224ReceiverThread();
00110
00111 OpalH281Handler *GetH281Handler() { return h281Handler; }
00112
00113 protected:
00114
00115 RTP_Session * session;
00116
00117 PBoolean canTransmit;
00118 PMutex transmitMutex;
00119 RTP_DataFrame *transmitFrame;
00120 BYTE transmitBitIndex;
00121 PTime *transmitStartTime;
00122
00123 OpalH224ReceiverThread *receiverThread;
00124
00125 OpalH281Handler *h281Handler;
00126
00127 private:
00128
00129 void TransmitFrame(H224_Frame & frame);
00130
00131 };
00132
00133 #endif //
00134
00135
00136 #endif // OPAL_H224_H224HANDLER_H
00137