iax2jitter.h

Go to the documentation of this file.
00001 /*
00002  * Inter Asterisk Exchange 2
00003  * 
00004  * The entity which receives all manages weirdo iax2 packets that are 
00005  * sent outside of a regular call.
00006  * 
00007  * Open Phone Abstraction Library (OPAL)
00008  *
00009  * Copyright (c) 2006 Stephen Cook 
00010  *
00011  * The contents of this file are subject to the Mozilla Public License
00012  * Version 1.0 (the "License"); you may not use this file except in
00013  * compliance with the License. You may obtain a copy of the License at
00014  * http://www.mozilla.org/MPL/
00015  *
00016  * Software distributed under the License is distributed on an "AS IS"
00017  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00018  * the License for the specific language governing rights and limitations
00019  * under the License.
00020  *
00021  * The Original Code is Open Phone Abstraction Library.
00022  *
00023  * The Initial Developer of the Original Code is Indranet Technologies Ltd
00024  *
00025  * $Revision: 21421 $
00026  * $Author: dereksmithies $
00027  * $Date: 2008-10-30 00:36:33 +0000 (Thu, 30 Oct 2008) $
00028  */
00029 
00031 
00032 #ifndef OPAL_IAX2_JITTER_H
00033 #define OPAL_IAX2_JITTER_H
00034 
00035 #ifndef _PTLIB_H
00036 #include <ptlib.h>
00037 #endif
00038 
00039 #include <opal/buildopts.h>
00040 
00041 #if OPAL_IAX2
00042 
00043 #include <rtp/rtp.h>
00044 #include <rtp/jitter.h>
00045 
00046 //class RTP_DataFrame;
00047 
00048 PDECLARE_LIST(RTP_DataFrameQueue, RTP_DataFrame *)
00049 #ifdef DOC_PLUS_PLUS     //This makes emacs bracket matching code happy.
00050 
00056 class RTP_DataFrameQueue : public RTP_DataFrame *
00057 {
00058 #endif
00059  public:
00060 };
00061 
00063 
00064 class PendingRtpDataFrames : public RTP_DataFrameQueue
00065 {
00066     PCLASSINFO(PendingRtpDataFrames, RTP_DataFrameQueue);
00067  public:
00069     PendingRtpDataFrames();
00070 
00072     ~PendingRtpDataFrames();
00073 
00076     void CloseDown();
00077 
00080     RTP_DataFrame *GetLastFrame();
00081 
00083     void AddNewFrame(RTP_DataFrame *newFrame);
00084 
00085  protected:
00088     RTP_DataFrame *InternalGetLastFrame();
00089 
00090 
00092   PSyncPoint activate;
00093  
00095   PMutex mutex;
00096 
00098   PBoolean keepGoing;
00099 };
00100 
00102 
00105 class IAX2JitterBuffer : public OpalJitterBuffer
00106 {
00107     PCLASSINFO(IAX2JitterBuffer, OpalJitterBuffer);
00108 
00109  public:
00111     IAX2JitterBuffer();
00112 
00115     ~IAX2JitterBuffer();
00116 
00121     virtual PBoolean OnReadPacket    (
00122         RTP_DataFrame & frame,  
00123         PBoolean loop               
00124         ) ;
00125 
00128     void NewFrameFromNetwork(RTP_DataFrame *newFrame)
00129         { receivedFrames.AddNewFrame(newFrame); }
00130 
00137     void CloseDown();
00138 
00139  protected:
00140 
00147     PendingRtpDataFrames receivedFrames;
00148 };
00149 
00150 
00151 #endif // OPAL_IAX2
00152 
00153 #endif // OPAL_IAX2_JITTER_H

Generated on Mon Feb 1 00:25:49 2010 for OPAL by  doxygen 1.5.1