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_H224HANDLER_H
00027 #define __OPAL_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/connection.h>
00038 #include <opal/transports.h>
00039 #include <rtp/rtp.h>
00040 #include <h224/h281handler.h>
00041
00042 #define H281_CLIENT_ID 0x01
00043
00044 class H224_Frame;
00045
00046 #if 0
00047
00048 class OpalH224ReceiverThread : public PThread
00049 {
00050 PCLASSINFO(OpalH224ReceiverThread, PThread);
00051
00052 public:
00053
00054 OpalH224ReceiverThread(OpalH224Handler *h224Handler, RTP_Session & rtpSession);
00055 ~OpalH224ReceiverThread();
00056
00057 virtual void Main();
00058
00059 void Close();
00060
00061 private:
00062
00063 OpalH224Handler *h224Handler;
00064 mutable PMutex inUse;
00065 unsigned timestamp;
00066 RTP_Session & rtpSession;
00067 PBoolean terminate;
00068 };
00069
00070 class OpalH281Handler;
00071 class OpalConnection;
00072
00073 class OpalH224Handler : public PObject
00074 {
00075 PCLASSINFO(OpalH224Handler, PObject);
00076
00077 public:
00078
00079 OpalH224Handler(OpalRTPConnection & connection, unsigned sessionID);
00080 ~OpalH224Handler();
00081
00082 virtual void StartTransmit();
00083 virtual void StopTransmit();
00084 virtual void StartReceive();
00085 virtual void StopReceive();
00086
00087 PBoolean SendClientList();
00088 PBoolean SendExtraCapabilities();
00089 PBoolean SendClientListCommand();
00090 PBoolean SendExtraCapabilitiesCommand(BYTE clientID);
00091
00092 PBoolean SendExtraCapabilitiesMessage(BYTE clientID, BYTE *data, PINDEX length);
00093
00094 PBoolean TransmitClientFrame(BYTE clientID, H224_Frame & frame);
00095
00096 virtual PBoolean OnReceivedFrame(H224_Frame & frame);
00097 virtual PBoolean OnReceivedCMEMessage(H224_Frame & frame);
00098 virtual PBoolean OnReceivedClientList(H224_Frame & frame);
00099 virtual PBoolean OnReceivedClientListCommand();
00100 virtual PBoolean OnReceivedExtraCapabilities(H224_Frame & frame);
00101 virtual PBoolean OnReceivedExtraCapabilitiesCommand();
00102
00103 PMutex & GetTransmitMutex() { return transmitMutex; }
00104
00105 RTP_Session * GetSession() const { return session; }
00106
00107 virtual OpalH224ReceiverThread * CreateH224ReceiverThread();
00108
00109 OpalH281Handler *GetH281Handler() { return h281Handler; }
00110
00111 protected:
00112
00113 RTP_Session * session;
00114
00115 PBoolean canTransmit;
00116 PMutex transmitMutex;
00117 RTP_DataFrame *transmitFrame;
00118 BYTE transmitBitIndex;
00119 PTime *transmitStartTime;
00120
00121 OpalH224ReceiverThread *receiverThread;
00122
00123 OpalH281Handler *h281Handler;
00124
00125 private:
00126
00127 void TransmitFrame(H224_Frame & frame);
00128
00129 };
00130
00131 #endif //
00132
00133
00134 #endif // __OPAL_H224HANDLER_H
00135