]> git.sesse.net Git - vlc/blob - modules/stream_out/rtp.h
f136838f0020dc76d98362527d1b076e623d5644
[vlc] / modules / stream_out / rtp.h
1 /*****************************************************************************
2  * rtp.h: rtp stream output module header
3  *****************************************************************************
4  * Copyright (C) 2003-2007 the VideoLAN team
5  * $Id: rtp.c 21407 2007-08-22 20:10:41Z courmisch $
6  *
7  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
8  *          RĂ©mi Denis-Courmont
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 typedef struct rtsp_client_t rtsp_client_t;
26
27 int RtspSetup( sout_stream_t *p_stream, vlc_url_t * );
28
29 int RtspCallbackId( httpd_callback_sys_t *, httpd_client_t *,
30                     httpd_message_t *, httpd_message_t * );
31
32 void RtspClientDel( sout_stream_t *, rtsp_client_t * );
33
34 char *SDPGenerate( const sout_stream_t *p_stream,
35                    const char *psz_destination, vlc_bool_t b_rtsp );
36
37 int rtp_add_sink( sout_stream_id_t *id, sout_access_out_t *access );
38 void rtp_del_sink( sout_stream_id_t *id, sout_access_out_t *access );
39
40 typedef int (*pf_rtp_packetizer_t)( sout_stream_t *, sout_stream_id_t *,
41                                     block_t * );
42
43 struct sout_stream_id_t
44 {
45     sout_stream_t *p_stream;
46     /* rtp field */
47     uint8_t     i_payload_type;
48     uint16_t    i_sequence;
49     uint32_t    i_timestamp_start;
50     uint8_t     ssrc[4];
51
52     /* for sdp */
53     int         i_clock_rate;
54     char        *psz_rtpmap;
55     char        *psz_fmtp;
56     char        *psz_destination;
57     int         i_port;
58     int         i_cat;
59     int         i_bitrate;
60
61     /* Packetizer specific fields */
62     pf_rtp_packetizer_t pf_packetize;
63     int           i_mtu;
64
65     /* for sending the packets */
66     sout_access_out_t *p_access;
67
68     vlc_mutex_t       lock_rtsp;
69     int               i_rtsp_access;
70     sout_access_out_t **rtsp_access;
71
72     /* */
73     sout_input_t      *p_input;
74
75     /* RTSP url control */
76     httpd_url_t  *p_rtsp_url;
77 };
78
79 struct sout_stream_sys_t
80 {
81     /* sdp */
82     int64_t i_sdp_id;
83     int     i_sdp_version;
84     char    *psz_sdp;
85     vlc_mutex_t  lock_sdp;
86
87     char        *psz_session_name;
88     char        *psz_session_description;
89     char        *psz_session_url;
90     char        *psz_session_email;
91
92     /* */
93     vlc_bool_t b_export_sdp_file;
94     char *psz_sdp_file;
95     /* sap */
96     vlc_bool_t b_export_sap;
97     session_descriptor_t *p_session;
98
99     httpd_host_t *p_httpd_host;
100     httpd_file_t *p_httpd_file;
101
102     httpd_host_t *p_rtsp_host;
103     httpd_url_t  *p_rtsp_url;
104     char         *psz_rtsp_control;
105     char         *psz_rtsp_path;
106
107     /* */
108     char *psz_destination;
109     int  i_port;
110     int  i_port_audio;
111     int  i_port_video;
112     int  i_ttl;
113     vlc_bool_t b_latm;
114
115     /* when need to use a private one or when using muxer */
116     int i_payload_type;
117
118     /* in case we do TS/PS over rtp */
119     sout_mux_t        *p_mux;
120     sout_access_out_t *p_access;
121     int               i_mtu;
122     sout_access_out_t *p_grab;
123     uint16_t          i_sequence;
124     uint32_t          i_timestamp_start;
125     uint8_t           ssrc[4];
126     block_t           *packet;
127
128     /* */
129     vlc_mutex_t      lock_es;
130     int              i_es;
131     sout_stream_id_t **es;
132
133     /* */
134     int              i_rtsp;
135     rtsp_client_t    **rtsp;
136 };