]> git.sesse.net Git - vlc/blob - modules/demux/rtp.h
Minimalistic RTP demux
[vlc] / modules / demux / rtp.h
1 /**
2  * @file rtp.h
3  * @brief RTP demux module shared declarations
4  */
5 /*****************************************************************************
6  * Copyright © 2008 Rémi Denis-Courmont
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2.0
11  * of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  ****************************************************************************/
22
23 /* RTP payload format */
24 typedef struct rtp_pt_t rtp_pt_t;
25 struct rtp_pt_t
26 {
27     void   *(*init) (demux_t *);
28     void    (*destroy) (demux_t *, void *);
29     void    (*decode) (demux_t *, void *, block_t *);
30     uint32_t  frequency; /* RTP clock rate (Hz) */
31     uint8_t   number;
32 };
33
34 /* RTP session */
35 typedef struct rtp_session_t rtp_session_t;
36 rtp_session_t *rtp_session_create (demux_t *);
37 void rtp_session_destroy (demux_t *, rtp_session_t *);
38 void rtp_receive (demux_t *, rtp_session_t *, block_t *);
39 int rtp_add_type (demux_t *demux, rtp_session_t *ses, const rtp_pt_t *pt);
40
41
42 /* Global data */
43 struct demux_sys_t
44 {
45     rtp_session_t *session;
46     int           fd;
47
48     unsigned      timeout;
49     uint8_t       max_src;
50     uint16_t      max_dropout;
51     uint16_t      max_misorder;
52     bool          autodetect;
53 };
54