rtp.h

Go to the documentation of this file.
00001 /**
00002  * @file rtp.h
00003  * @brief RTP demux module shared declarations
00004  */
00005 /*****************************************************************************
00006  * Copyright © 2008 Rémi Denis-Courmont
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00021  ****************************************************************************/
00022 
00023 typedef struct rtp_pt_t rtp_pt_t;
00024 typedef struct rtp_session_t rtp_session_t;
00025 
00026 /** @section RTP payload format */
00027 struct rtp_pt_t
00028 {
00029     void   *(*init) (demux_t *);
00030     void    (*destroy) (demux_t *, void *);
00031     void    (*decode) (demux_t *, void *, block_t *);
00032     uint32_t  frequency; /* RTP clock rate (Hz) */
00033     uint8_t   number;
00034 };
00035 int rtp_autodetect (demux_t *, rtp_session_t *, const block_t *);
00036 
00037 static inline uint8_t rtp_ptype (const block_t *block)
00038 {
00039     return block->p_buffer[1] & 0x7F;
00040 }
00041 
00042 /** @section RTP session */
00043 rtp_session_t *rtp_session_create (demux_t *);
00044 void rtp_session_destroy (demux_t *, rtp_session_t *);
00045 void rtp_queue (demux_t *, rtp_session_t *, block_t *);
00046 bool rtp_dequeue (demux_t *, const rtp_session_t *, mtime_t *);
00047 int rtp_add_type (demux_t *demux, rtp_session_t *ses, const rtp_pt_t *pt);
00048 
00049 void *rtp_thread (void *data);
00050 
00051 /* Global data */
00052 struct demux_sys_t
00053 {
00054     rtp_session_t *session;
00055 #ifdef HAVE_SRTP
00056     struct srtp_session_t *srtp;
00057 #endif
00058     int           fd;
00059     int           rtcp_fd;
00060     vlc_thread_t  thread;
00061     vlc_timer_t   timer;
00062     vlc_mutex_t   lock;
00063 
00064     mtime_t       timeout;
00065     unsigned      caching;
00066     uint16_t      max_dropout; /**< Max packet forward misordering */
00067     uint16_t      max_misorder; /**< Max packet backward misordering */
00068     uint8_t       max_src; /**< Max simultaneous RTP sources */
00069     bool          framed_rtp; /**< Framed RTP packets over TCP */
00070     bool          thread_ready;
00071 #if 0
00072     bool          dead; /**< End of stream */
00073 #endif
00074 };
00075 

Generated on Tue May 25 08:04:53 2010 for VLC by  doxygen 1.5.6