# 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  *
    00026  *  $Log: iax2jitter.h,v $
    00027  *  Revision 1.2  2007/04/19 06:17:21  csoutheren
    00028  *  Fixes for precompiled headers with gcc
    00029  *
    00030  *  Revision 1.1  2007/01/11 03:07:49  dereksmithies
    00031  *  Remove the jitter.h file, which was erroneously added. Replace it with the
    00032  *  correct iax2jitter.h file.
    00033  *
    00034  *  Revision 1.2  2006/09/11 03:12:51  dereksmithies
    00035  *  Add logging and MPL license statements.
    00036  *
    00037  *
    00038  */
    00039
    00041
    00042 #ifndef IAX2_JITTER_H
    00043 #define IAX2_JITTER_H
    00044
    00045 #ifndef _PTLIB_H
    00046 #include <ptlib.h>
    00047 #endif
    00048
    00049 #include <opal/buildopts.h>
    00050
    00051 #include <rtp/rtp.h>
    00052 #include <rtp/jitter.h>
    00053
    00054 //class RTP_DataFrame;
    00055
    00056 PDECLARE_LIST(RTP_DataFrameQueue, RTP_DataFrame *)
    00057 #ifdef DOC_PLUS_PLUS     //This makes emacs bracket matching code happy.
    00058
    00064 class RTP_DataFrameQueue : public RTP_DataFrame *
    00065 {
    00066 #endif
    00067  public:
    00068 };
    00069
    00071
    00072 class PendingRtpDataFrames : public RTP_DataFrameQueue
    00073 {
    00074     PCLASSINFO(PendingRtpDataFrames, RTP_DataFrameQueue);
    00075  public:
    00077     PendingRtpDataFrames();
    00078
    00080     ~PendingRtpDataFrames();
    00081
    00084     void CloseDown();
    00085
    00088     RTP_DataFrame *GetLastFrame();
    00089
    00091     void AddNewFrame(RTP_DataFrame *newFrame);
    00092
    00093  protected:
    00096     RTP_DataFrame *InternalGetLastFrame();
    00097
    00098
    00100   PSyncPoint activate;
    00101
    00103   PMutex mutex;
    00104
    00106   PBoolean keepGoing;
    00107 };
    00108
    00110
    00113 class IAX2JitterBuffer : public OpalJitterBuffer
    00114 {
    00115     PCLASSINFO(IAX2JitterBuffer, OpalJitterBuffer);
    00116
    00117  public:
    00119     IAX2JitterBuffer();
    00120
    00123     ~IAX2JitterBuffer();
    00124
    00129     virtual PBoolean OnReadPacket    (
    00130         RTP_DataFrame & frame,
    00131         PBoolean loop
    00132         ) ;
    00133
    00135     void NewFrameFromNetwork(RTP_DataFrame *newFrame)
    00136         { receivedFrames.AddNewFrame(newFrame); }
    00137
    00144     void CloseDown() { receivedFrames.CloseDown(); }
    00145
    00146  protected:
    00147
    00149     PendingRtpDataFrames receivedFrames;
    00150 };
    00151
    00152
    00153
    00154
    00155 #endif /*IAX2_JITTER_H*/