]> git.sesse.net Git - vlc/blob - modules/stream_out/rtp.h
47e825a5c1e8fd4722d7f527423209f6f1577841
[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, const vlc_url_t *url );
28 int RtspSetupId( sout_stream_t *p_stream, sout_stream_id_t *id );
29 void RtspUnsetup( sout_stream_t *p_stream );
30
31 char *SDPGenerate( const sout_stream_t *p_stream,
32                    const char *psz_destination, vlc_bool_t b_rtsp );
33
34 int rtp_add_sink( sout_stream_id_t *id, sout_access_out_t *access );
35 void rtp_del_sink( sout_stream_id_t *id, sout_access_out_t *access );
36
37 typedef int (*pf_rtp_packetizer_t)( sout_stream_t *, sout_stream_id_t *,
38                                     block_t * );
39
40 struct sout_stream_id_t
41 {
42     sout_stream_t *p_stream;
43     /* rtp field */
44     uint8_t     i_payload_type;
45     uint16_t    i_sequence;
46     uint32_t    i_timestamp_start;
47     uint8_t     ssrc[4];
48
49     /* for sdp */
50     int         i_clock_rate;
51     char        *psz_rtpmap;
52     char        *psz_fmtp;
53     char        *psz_destination;
54     int         i_port;
55     int         i_cat;
56     int         i_bitrate;
57
58     /* Packetizer specific fields */
59     pf_rtp_packetizer_t pf_packetize;
60     int           i_mtu;
61
62     /* for sending the packets */
63     sout_access_out_t *p_access;
64
65     vlc_mutex_t       lock_rtsp;
66     int               i_rtsp_access;
67     sout_access_out_t **rtsp_access;
68
69     /* */
70     sout_input_t      *p_input;
71
72     /* RTSP url control */
73     httpd_url_t  *p_rtsp_url;
74 };
75
76 struct sout_stream_sys_t
77 {
78     /* sdp */
79     int64_t i_sdp_id;
80     int     i_sdp_version;
81     char    *psz_sdp;
82     vlc_mutex_t  lock_sdp;
83
84     char        *psz_session_name;
85     char        *psz_session_description;
86     char        *psz_session_url;
87     char        *psz_session_email;
88
89     /* */
90     vlc_bool_t b_export_sdp_file;
91     char *psz_sdp_file;
92     /* sap */
93     vlc_bool_t b_export_sap;
94     session_descriptor_t *p_session;
95
96     httpd_host_t *p_httpd_host;
97     httpd_file_t *p_httpd_file;
98
99     httpd_host_t *p_rtsp_host;
100     httpd_url_t  *p_rtsp_url;
101     char         *psz_rtsp_control;
102     char         *psz_rtsp_path;
103
104     /* */
105     char *psz_destination;
106     int  i_port;
107     int  i_port_audio;
108     int  i_port_video;
109     int  i_ttl;
110     vlc_bool_t b_latm;
111
112     /* when need to use a private one or when using muxer */
113     int i_payload_type;
114
115     /* in case we do TS/PS over rtp */
116     sout_mux_t        *p_mux;
117     sout_access_out_t *p_access;
118     int               i_mtu;
119     sout_access_out_t *p_grab;
120     uint16_t          i_sequence;
121     uint32_t          i_timestamp_start;
122     uint8_t           ssrc[4];
123     block_t           *packet;
124
125     /* */
126     vlc_mutex_t      lock_es;
127     int              i_es;
128     sout_stream_id_t **es;
129
130     /* */
131     int              i_rtsp;
132     rtsp_client_t    **rtsp;
133 };