h224handler.h

Go to the documentation of this file.
00001 /*
00002  * h224handler.h
00003  *
00004  * H.224 protocol handler implementation for the OpenH323 Project.
00005  *
00006  * Copyright (c) 2006 Network for Educational Technology, ETH Zurich.
00007  * Written by Hannes Friederich.
00008  *
00009  * The contents of this file are subject to the Mozilla Public License
00010  * Version 1.0 (the "License"); you may not use this file except in
00011  * compliance with the License. You may obtain a copy of the License at
00012  * http://www.mozilla.org/MPL/
00013  *
00014  * Software distributed under the License is distributed on an "AS IS"
00015  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00016  * the License for the specific language governing rights and limitations
00017  * under the License.
00018  *
00019  * Contributor(s): ______________________________________.
00020  *
00021  * $Revision: 20177 $
00022  * $Author: csoutheren $
00023  * $Date: 2008-05-06 05:55:40 +0000 (Tue, 06 May 2008) $
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 

Generated on Mon Sep 15 11:48:45 2008 for OPAL by  doxygen 1.5.1