annotate rtsp.h @ 6491:b7f807b4cd88 libavformat tip

In mov demuxer, check that nb_streams is valid before using it in read_dac3
author bcoudurier
date Tue, 28 Sep 2010 00:33:21 +0000
parents 2e3e76e8ada4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
1 /*
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
2 * RTSP definitions
4251
77e0c7511d41 cosmetics: Remove pointless period after copyright statement non-sentences.
diego
parents: 4171
diff changeset
3 * Copyright (c) 2002 Fabrice Bellard
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
4 *
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1167
diff changeset
5 * This file is part of FFmpeg.
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1167
diff changeset
6 *
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1167
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1167
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
11 *
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1167
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
15 * Lesser General Public License for more details.
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
16 *
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
1358
0899bfe4105c Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 1167
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
896
edbe5c3717f9 Update licensing information: The FSF changed postal address.
diego
parents: 885
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
20 */
5104
4c39baa3dfbf Use globally consistent include guard names.
stefano
parents: 5013
diff changeset
21 #ifndef AVFORMAT_RTSP_H
4c39baa3dfbf Use globally consistent include guard names.
stefano
parents: 5013
diff changeset
22 #define AVFORMAT_RTSP_H
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
23
2171
a6d6b2b19341 include all prerequisites in header files
mru
parents: 2048
diff changeset
24 #include <stdint.h>
a6d6b2b19341 include all prerequisites in header files
mru
parents: 2048
diff changeset
25 #include "avformat.h"
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
26 #include "rtspcodes.h"
4388
80f21f72d7d6 Split rtp.h in rtp.h, rtpdec.h, and rtpenc.h
lucabe
parents: 4386
diff changeset
27 #include "rtpdec.h"
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
28 #include "network.h"
5889
4b42835727aa Make RTSP use the generic http authentication code
mstorsjo
parents: 5888
diff changeset
29 #include "httpauth.h"
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
30
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
31 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
32 * Network layer over which RTP/etc packet data will be transported.
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
33 */
3957
9f943bb755f9 Rename RTSPProtocol to RTSPLowerTransport, so that its name properly tells us
rbultje
parents: 3855
diff changeset
34 enum RTSPLowerTransport {
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
35 RTSP_LOWER_TRANSPORT_UDP = 0, /**< UDP/unicast */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
36 RTSP_LOWER_TRANSPORT_TCP = 1, /**< TCP; interleaved in RTSP */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
37 RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, /**< UDP/multicast */
4514
2a84d46427d1 Rename RTSP_*_LAST to RTSP_*_NB in line with PIX_FMT_* in lavc. See "[PATCH]
rbultje
parents: 4512
diff changeset
38 RTSP_LOWER_TRANSPORT_NB
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
39 };
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
40
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
41 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
42 * Packet profile of the data that we will be receiving. Real servers
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
43 * commonly send RDT (although they can sometimes send RTP as well),
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
44 * whereas most others will send RTP.
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
45 */
4377
8d6f64b2e949 Move enum RTSPTransport up a bit, so that all fields that are assigned a value
rbultje
parents: 4251
diff changeset
46 enum RTSPTransport {
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
47 RTSP_TRANSPORT_RTP, /**< Standards-compliant RTP */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
48 RTSP_TRANSPORT_RDT, /**< Realmedia Data Transport */
4514
2a84d46427d1 Rename RTSP_*_LAST to RTSP_*_NB in line with PIX_FMT_* in lavc. See "[PATCH]
rbultje
parents: 4512
diff changeset
49 RTSP_TRANSPORT_NB
4377
8d6f64b2e949 Move enum RTSPTransport up a bit, so that all fields that are assigned a value
rbultje
parents: 4251
diff changeset
50 };
8d6f64b2e949 Move enum RTSPTransport up a bit, so that all fields that are assigned a value
rbultje
parents: 4251
diff changeset
51
6112
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
52 /**
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
53 * Transport mode for the RTSP data. This may be plain, or
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
54 * tunneled, which is done over HTTP.
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
55 */
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
56 enum RTSPControlTransport {
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
57 RTSP_MODE_PLAIN, /**< Normal RTSP */
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
58 RTSP_MODE_TUNNEL /**< RTSP over HTTP (tunneling) */
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
59 };
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
60
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
61 #define RTSP_DEFAULT_PORT 554
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
62 #define RTSP_MAX_TRANSPORTS 8
179
43ac45200138 suppressed RTSP abort hack - added PLAY/PAUSE
bellard
parents: 65
diff changeset
63 #define RTSP_TCP_MAX_PACKET_SIZE 1472
6070
ac73cfb210dc Change default number of channels (used if unspecified in the format desc)
rbultje
parents: 5909
diff changeset
64 #define RTSP_DEFAULT_NB_AUDIO_CHANNELS 1
774
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 304
diff changeset
65 #define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 304
diff changeset
66 #define RTSP_RTP_PORT_MIN 5000
820863425158 RTP/RTSP and MPEG4-AAC audio
michael
parents: 304
diff changeset
67 #define RTSP_RTP_PORT_MAX 10000
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
68
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
69 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
70 * This describes a single item in the "Transport:" line of one stream as
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
71 * negotiated by the SETUP RTSP command. Multiple transports are comma-
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
72 * separated ("Transport: x-read-rdt/tcp;interleaved=0-1,rtp/avp/udp;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
73 * client_port=1000-1001;server_port=1800-1801") and described in separate
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
74 * RTSPTransportFields.
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
75 */
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
76 typedef struct RTSPTransportField {
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
77 /** interleave ids, if TCP transport; each TCP/RTSP data packet starts
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
78 * with a '$', stream length and stream ID. If the stream ID is within
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
79 * the range of this interleaved_min-max, then the packet belongs to
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
80 * this stream. */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
81 int interleaved_min, interleaved_max;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
82
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
83 /** UDP multicast port range; the ports to which we should connect to
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
84 * receive multicast UDP data. */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
85 int port_min, port_max;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
86
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
87 /** UDP client ports; these should be the local ports of the UDP RTP
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
88 * (and RTCP) sockets over which we receive RTP/RTCP data. */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
89 int client_port_min, client_port_max;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
90
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
91 /** UDP unicast server port range; the ports to which we should connect
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
92 * to receive unicast UDP RTP/RTCP data. */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
93 int server_port_min, server_port_max;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
94
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
95 /** time-to-live value (required for multicast); the amount of HOPs that
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
96 * packets will be allowed to make before being discarded. */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
97 int ttl;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
98
6412
6d6b63b7e5e3 Handle IPv6 in the RTSP code
mstorsjo
parents: 6411
diff changeset
99 struct sockaddr_storage destination; /**< destination IP address */
6457
2e3e76e8ada4 Send NAT punching messages to the address specified in the Transport:
rbultje
parents: 6423
diff changeset
100 char source[INET6_ADDRSTRLEN + 1]; /**< source IP address */
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
101
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
102 /** data/packet transport protocol; e.g. RTP or RDT */
4377
8d6f64b2e949 Move enum RTSPTransport up a bit, so that all fields that are assigned a value
rbultje
parents: 4251
diff changeset
103 enum RTSPTransport transport;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
104
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
105 /** network layer transport protocol; e.g. TCP or UDP uni-/multicast */
3957
9f943bb755f9 Rename RTSPProtocol to RTSPLowerTransport, so that its name properly tells us
rbultje
parents: 3855
diff changeset
106 enum RTSPLowerTransport lower_transport;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
107 } RTSPTransportField;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
108
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
109 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
110 * This describes the server response to each RTSP command.
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
111 */
4557
bfe6fb676d46 Rename RTSPHeader to RTSPMessageHeader to reflect more clearly what the
rbultje
parents: 4514
diff changeset
112 typedef struct RTSPMessageHeader {
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
113 /** length of the data following this header */
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
114 int content_length;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
115
1871
50ad5902d797 Doxygenize comments in rtsp.h
takis
parents: 1870
diff changeset
116 enum RTSPStatusCode status_code; /**< response code from server */
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
117
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
118 /** number of items in the 'transports' variable below */
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
119 int nb_transports;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
120
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
121 /** Time range of the streams that the server will stream. In
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
122 * AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
885
da1d5db0ce5c COSMETICS: Remove all trailing whitespace.
diego
parents: 774
diff changeset
123 int64_t range_start, range_end;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
124
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
125 /** describes the complete "Transport:" line of the server in response
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
126 * to a SETUP RTSP command by the client */
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
127 RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
128
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
129 int seq; /**< sequence number */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
130
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
131 /** the "Session:" field. This value is initially set by the server and
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
132 * should be re-transmitted by the client in every RTSP command. */
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
133 char session_id[512];
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
134
5333
715913c5514f Support 3xx redirection in rtsp
lu_zero
parents: 5220
diff changeset
135 /** the "Location:" field. This value is used to handle redirection.
715913c5514f Support 3xx redirection in rtsp
lu_zero
parents: 5220
diff changeset
136 */
715913c5514f Support 3xx redirection in rtsp
lu_zero
parents: 5220
diff changeset
137 char location[4096];
715913c5514f Support 3xx redirection in rtsp
lu_zero
parents: 5220
diff changeset
138
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
139 /** the "RealChallenge1:" field from the server */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
140 char real_challenge[64];
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
141
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
142 /** the "Server: field, which can be used to identify some special-case
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
143 * servers that are not 100% standards-compliant. We use this to identify
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
144 * Windows Media Server, which has a value "WMServer/v.e.r.sion", where
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
145 * version is a sequence of digits (e.g. 9.0.0.3372). Helix/Real servers
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
146 * use something like "Helix [..] Server Version v.e.r.sion (platform)
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
147 * (RealServer compatible)" or "RealServer Version v.e.r.sion (platform)",
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
148 * where platform is the output of $uname -msr | sed 's/ /-/g'. */
4169
619845a9bab3 Use the "server" RTSP field to detect whether the server that we're talking
rbultje
parents: 4168
diff changeset
149 char server[64];
4877
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
150
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
151 /** The "timeout" comes as part of the server response to the "SETUP"
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
152 * command, in the "Session: <xyz>[;timeout=<value>]" line. It is the
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
153 * time, in seconds, that the server will go without traffic over the
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
154 * RTSP/TCP connection before it closes the connection. To prevent
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
155 * this, sent dummy requests (e.g. OPTIONS) with intervals smaller
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
156 * than this value. */
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
157 int timeout;
5112
85e0a9761818 Implement support for EOS as used by WMS and other RTSP servers that do not
rbultje
parents: 5111
diff changeset
158
85e0a9761818 Implement support for EOS as used by WMS and other RTSP servers that do not
rbultje
parents: 5111
diff changeset
159 /** The "Notice" or "X-Notice" field value. See
85e0a9761818 Implement support for EOS as used by WMS and other RTSP servers that do not
rbultje
parents: 5111
diff changeset
160 * http://tools.ietf.org/html/draft-stiemerling-rtsp-announce-00
85e0a9761818 Implement support for EOS as used by WMS and other RTSP servers that do not
rbultje
parents: 5111
diff changeset
161 * for a complete list of supported values. */
85e0a9761818 Implement support for EOS as used by WMS and other RTSP servers that do not
rbultje
parents: 5111
diff changeset
162 int notice;
6348
c709176da1ad Preserve status reason
lu_zero
parents: 6179
diff changeset
163
c709176da1ad Preserve status reason
lu_zero
parents: 6179
diff changeset
164 /** The "reason" is meant to specify better the meaning of the error code
c709176da1ad Preserve status reason
lu_zero
parents: 6179
diff changeset
165 * returned
c709176da1ad Preserve status reason
lu_zero
parents: 6179
diff changeset
166 */
c709176da1ad Preserve status reason
lu_zero
parents: 6179
diff changeset
167 char reason[256];
4557
bfe6fb676d46 Rename RTSPHeader to RTSPMessageHeader to reflect more clearly what the
rbultje
parents: 4514
diff changeset
168 } RTSPMessageHeader;
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
169
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
170 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
171 * Client state, i.e. whether we are currently receiving data (PLAYING) or
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
172 * setup-but-not-receiving (PAUSED). State can be changed in applications
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
173 * by calling av_read_play/pause().
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
174 */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
175 enum RTSPClientState {
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
176 RTSP_STATE_IDLE, /**< not initialized */
5670
7fa188f69c22 Rename RTSP_STATE_PLAYING to _STREAMING, since that better covers the
rbultje
parents: 5574
diff changeset
177 RTSP_STATE_STREAMING, /**< initialized and sending/receiving data */
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
178 RTSP_STATE_PAUSED, /**< initialized, but not receiving data */
5013
43d99d0e12e0 Support seeking as defined by the rfc
lu_zero
parents: 5006
diff changeset
179 RTSP_STATE_SEEKING, /**< initialized, requesting a seek */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
180 };
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
181
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
182 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
183 * Identifies particular servers that require special handling, such as
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
184 * standards-incompliant "Transport:" lines in the SETUP request.
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
185 */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
186 enum RTSPServerType {
4171
6af3e7ab7cbb Fix typo ("Standard-compliant" -> "Standards-compliant"), as noticed by
rbultje
parents: 4170
diff changeset
187 RTSP_SERVER_RTP, /**< Standards-compliant RTP-server */
4170
89d38f054035 Fix doxy comments missing one '*'.
rbultje
parents: 4169
diff changeset
188 RTSP_SERVER_REAL, /**< Realmedia-style server */
89d38f054035 Fix doxy comments missing one '*'.
rbultje
parents: 4169
diff changeset
189 RTSP_SERVER_WMS, /**< Windows Media server */
4514
2a84d46427d1 Rename RTSP_*_LAST to RTSP_*_NB in line with PIX_FMT_* in lavc. See "[PATCH]
rbultje
parents: 4512
diff changeset
190 RTSP_SERVER_NB
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
191 };
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
192
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
193 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
194 * Private data for the RTSP demuxer.
4771
2e0ea6f96564 Add a @todo item to use ByteIOContext instead of URLContext at some point in
rbultje
parents: 4744
diff changeset
195 *
2e0ea6f96564 Add a @todo item to use ByteIOContext instead of URLContext at some point in
rbultje
parents: 4744
diff changeset
196 * @todo Use ByteIOContext instead of URLContext
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
197 */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
198 typedef struct RTSPState {
6131
68fba42e1dea Cosmetics: Change connexion to connection in code comments
mstorsjo
parents: 6112
diff changeset
199 URLContext *rtsp_hd; /* RTSP TCP connection handle */
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
200
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
201 /** number of items in the 'rtsp_streams' variable */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
202 int nb_rtsp_streams;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
203
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
204 struct RTSPStream **rtsp_streams; /**< streams in this session */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
205
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
206 /** indicator of whether we are currently receiving data from the
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
207 * server. Basically this isn't more than a simple cache of the
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
208 * last PLAY/PAUSE command sent to the server, to make sure we don't
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
209 * send 2x the same unexpectedly or commands in the wrong state. */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
210 enum RTSPClientState state;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
211
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
212 /** the seek value requested when calling av_seek_frame(). This value
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
213 * is subsequently used as part of the "Range" parameter when emitting
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
214 * the RTSP PLAY command. If we are currently playing, this command is
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
215 * called instantly. If we are currently paused, this command is called
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
216 * whenever we resume playback. Either way, the value is only used once,
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
217 * see rtsp_read_play() and rtsp_read_seek(). */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
218 int64_t seek_timestamp;
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
219
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
220 /* XXX: currently we use unbuffered input */
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
221 // ByteIOContext rtsp_gb;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
222
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
223 int seq; /**< RTSP command sequence number */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
224
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
225 /** copy of RTSPMessageHeader->session_id, i.e. the server-provided session
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
226 * identifier that the client should re-transmit in each RTSP command */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
227 char session_id[512];
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
228
4877
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
229 /** copy of RTSPMessageHeader->timeout, i.e. the time (in seconds) that
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
230 * the server will go without traffic on the RTSP/TCP line before it
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
231 * closes the connection. */
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
232 int timeout;
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
233
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
234 /** timestamp of the last RTSP command that we sent to the RTSP server.
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
235 * This is used to calculate when to send dummy commands to keep the
5006
686de8748c36 Remove '\p', '\c' and '\e' doxygen markup from doxy, as it should
stefano
parents: 4877
diff changeset
236 * connection alive, in conjunction with timeout. */
4877
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
237 int64_t last_cmd_time;
940946a4569b Send dummy requests over the TCP connection (WMS wants GET_PARAMETER,
rbultje
parents: 4771
diff changeset
238
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
239 /** the negotiated data/packet transport protocol; e.g. RTP or RDT */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
240 enum RTSPTransport transport;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
241
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
242 /** the negotiated network layer transport protocol; e.g. TCP or UDP
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
243 * uni-/multicast */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
244 enum RTSPLowerTransport lower_transport;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
245
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
246 /** brand of server that we're talking to; e.g. WMS, REAL or other.
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
247 * Detected based on the value of RTSPMessageHeader->server or the presence
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
248 * of RTSPMessageHeader->real_challenge */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
249 enum RTSPServerType server_type;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
250
5889
4b42835727aa Make RTSP use the generic http authentication code
mstorsjo
parents: 5888
diff changeset
251 /** plaintext authorization line (username:password) */
4b42835727aa Make RTSP use the generic http authentication code
mstorsjo
parents: 5888
diff changeset
252 char auth[128];
4b42835727aa Make RTSP use the generic http authentication code
mstorsjo
parents: 5888
diff changeset
253
4b42835727aa Make RTSP use the generic http authentication code
mstorsjo
parents: 5888
diff changeset
254 /** authentication state */
4b42835727aa Make RTSP use the generic http authentication code
mstorsjo
parents: 5888
diff changeset
255 HTTPAuthState auth_state;
5220
cad276e8f96e RTSP basic authentication, patch originally by Philip Coombes
rbultje
parents: 5112
diff changeset
256
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
257 /** The last reply of the server to a RTSP command */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
258 char last_reply[2048]; /* XXX: allocate ? */
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
259
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
260 /** RTSPStream->transport_priv of the last stream that we read a
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
261 * packet from */
4386
3dbd7fa2c2af Rename "tx_ctx" and "cur_tx" variables to "transport_priv" and
rbultje
parents: 4381
diff changeset
262 void *cur_transport_priv;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
263
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
264 /** The following are used for Real stream selection */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
265 //@{
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
266 /** whether we need to send a "SET_PARAMETER Subscribe:" command */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
267 int need_subscription;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
268
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
269 /** stream setup during the last frame read. This is used to detect if
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
270 * we need to subscribe or unsubscribe to any new streams. */
6357
b7ee8424b7e6 get ride of MAX_STREAMS limit in RTSP
aurel
parents: 6348
diff changeset
271 enum AVDiscard *real_setup_cache;
b7ee8424b7e6 get ride of MAX_STREAMS limit in RTSP
aurel
parents: 6348
diff changeset
272
b7ee8424b7e6 get ride of MAX_STREAMS limit in RTSP
aurel
parents: 6348
diff changeset
273 /** current stream setup. This is a temporary buffer used to compare
b7ee8424b7e6 get ride of MAX_STREAMS limit in RTSP
aurel
parents: 6348
diff changeset
274 * current setup to previous frame setup. */
b7ee8424b7e6 get ride of MAX_STREAMS limit in RTSP
aurel
parents: 6348
diff changeset
275 enum AVDiscard *real_setup;
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
276
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
277 /** the last value of the "SET_PARAMETER Subscribe:" RTSP command.
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
278 * this is used to send the same "Unsubscribe:" if stream setup changed,
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
279 * before sending a new "Subscribe:" command. */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
280 char last_subscription[1024];
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
281 //@}
4744
51899c07a4f1 Add RTP/ASF header parsing, which is part of the SDP of these streams. See
rbultje
parents: 4588
diff changeset
282
51899c07a4f1 Add RTP/ASF header parsing, which is part of the SDP of these streams. See
rbultje
parents: 4588
diff changeset
283 /** The following are used for RTP/ASF streams */
51899c07a4f1 Add RTP/ASF header parsing, which is part of the SDP of these streams. See
rbultje
parents: 4588
diff changeset
284 //@{
51899c07a4f1 Add RTP/ASF header parsing, which is part of the SDP of these streams. See
rbultje
parents: 4588
diff changeset
285 /** ASF demuxer context for the embedded ASF stream from WMS servers */
51899c07a4f1 Add RTP/ASF header parsing, which is part of the SDP of these streams. See
rbultje
parents: 4588
diff changeset
286 AVFormatContext *asf_ctx;
5111
aa0edc246bca Implement RTSP-MS/ASF packet parsing - this completes RTSP-MS support. See
rbultje
parents: 5104
diff changeset
287
aa0edc246bca Implement RTSP-MS/ASF packet parsing - this completes RTSP-MS support. See
rbultje
parents: 5104
diff changeset
288 /** cache for position of the asf demuxer, since we load a new
aa0edc246bca Implement RTSP-MS/ASF packet parsing - this completes RTSP-MS support. See
rbultje
parents: 5104
diff changeset
289 * data packet in the bytecontext for each incoming RTSP packet. */
aa0edc246bca Implement RTSP-MS/ASF packet parsing - this completes RTSP-MS support. See
rbultje
parents: 5104
diff changeset
290 uint64_t asf_pb_pos;
4744
51899c07a4f1 Add RTP/ASF header parsing, which is part of the SDP of these streams. See
rbultje
parents: 4588
diff changeset
291 //@}
5574
016f3d4fe56d Use the control URI from the SDP (if present) rather than the input filename,
rbultje
parents: 5333
diff changeset
292
016f3d4fe56d Use the control URI from the SDP (if present) rather than the input filename,
rbultje
parents: 5333
diff changeset
293 /** some MS RTSP streams contain a URL in the SDP that we need to use
016f3d4fe56d Use the control URI from the SDP (if present) rather than the input filename,
rbultje
parents: 5333
diff changeset
294 * for all subsequent RTSP requests, rather than the input URI; in
016f3d4fe56d Use the control URI from the SDP (if present) rather than the input filename,
rbultje
parents: 5333
diff changeset
295 * other cases, this is a copy of AVFormatContext->filename. */
016f3d4fe56d Use the control URI from the SDP (if present) rather than the input filename,
rbultje
parents: 5333
diff changeset
296 char control_uri[1024];
5843
777a89fdb1c0 RTSP: Synchronize the start time of the chained RTP muxers
mstorsjo
parents: 5700
diff changeset
297
777a89fdb1c0 RTSP: Synchronize the start time of the chained RTP muxers
mstorsjo
parents: 5700
diff changeset
298 /** The synchronized start time of the output streams. */
777a89fdb1c0 RTSP: Synchronize the start time of the chained RTP muxers
mstorsjo
parents: 5700
diff changeset
299 int64_t start_time;
6093
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
300
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
301 /** Additional output handle, used when input and output are done
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
302 * separately, eg for HTTP tunneling. */
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
303 URLContext *rtsp_hd_out;
6112
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
304
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
305 /** RTSP transport mode, such as plain or tunneled. */
3e5c6c575f69 Add RTSP tunneling over HTTP
mstorsjo
parents: 6096
diff changeset
306 enum RTSPControlTransport control_transport;
6423
2685bf2b0b78 rtsp: Return AVERROR_EOF when all streams have received an RTCP BYE packet
mstorsjo
parents: 6412
diff changeset
307
2685bf2b0b78 rtsp: Return AVERROR_EOF when all streams have received an RTCP BYE packet
mstorsjo
parents: 6412
diff changeset
308 /* Number of RTCP BYE packets the RTSP session has received.
2685bf2b0b78 rtsp: Return AVERROR_EOF when all streams have received an RTCP BYE packet
mstorsjo
parents: 6412
diff changeset
309 * An EOF is propagated back if nb_byes == nb_streams.
2685bf2b0b78 rtsp: Return AVERROR_EOF when all streams have received an RTCP BYE packet
mstorsjo
parents: 6412
diff changeset
310 * This is reset after a seek. */
2685bf2b0b78 rtsp: Return AVERROR_EOF when all streams have received an RTCP BYE packet
mstorsjo
parents: 6412
diff changeset
311 int nb_byes;
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
312 } RTSPState;
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
313
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
314 /**
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
315 * Describes a single stream, as identified by a single m= line block in the
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
316 * SDP content. In the case of RDT, one RTSPStream can represent multiple
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
317 * AVStreams. In this case, each AVStream in this set has similar content
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
318 * (but different codec/bitrate).
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
319 */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
320 typedef struct RTSPStream {
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
321 URLContext *rtp_handle; /**< RTP stream handle (if UDP) */
5688
7024b420e1a8 Create AVFormatContext objects as private transport for output RTSP sessions
mstorsjo
parents: 5671
diff changeset
322 void *transport_priv; /**< RTP/RDT parse context if input, RTP AVFormatContext if output */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
323
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
324 /** corresponding stream index, if any. -1 if none (MPEG2TS case) */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
325 int stream_index;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
326
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
327 /** interleave IDs; copies of RTSPTransportField->interleaved_min/max
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
328 * for the selected transport. Only used for TCP. */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
329 int interleaved_min, interleaved_max;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
330
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
331 char control_url[1024]; /**< url for this stream (from SDP) */
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
332
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
333 /** The following are used only in SDP, not RTSP */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
334 //@{
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
335 int sdp_port; /**< port (from SDP content) */
6411
f0669792a6bd Handle IPv6 in the SDP demuxer
mstorsjo
parents: 6357
diff changeset
336 struct sockaddr_storage sdp_ip; /**< IP address (from SDP content) */
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
337 int sdp_ttl; /**< IP Time-To-Live (from SDP content) */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
338 int sdp_payload_type; /**< payload type */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
339 //@}
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
340
4588
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
341 /** The following are used for dynamic protocols (rtp_*.c/rdt.c) */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
342 //@{
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
343 /** handler structure */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
344 RTPDynamicProtocolHandler *dynamic_handler;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
345
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
346 /** private data associated with the dynamic protocol */
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
347 PayloadContext *dynamic_protocol_context;
e1a5b4f5b9be Document rtsp.h, see "[PATCH] document rtsp.h" thread.
rbultje
parents: 4557
diff changeset
348 //@}
4168
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
349 } RTSPStream;
0ebf63d12ea4 Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future
rbultje
parents: 3960
diff changeset
350
5890
f075d373e9be Actually parse the auth headers in RTSP
mstorsjo
parents: 5889
diff changeset
351 void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
f075d373e9be Actually parse the auth headers in RTSP
mstorsjo
parents: 5889
diff changeset
352 HTTPAuthState *auth_state);
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
353
2884
e6e7ba123447 Drop RTSP default protocol.
diego
parents: 2620
diff changeset
354 #if LIBAVFORMAT_VERSION_INT < (53 << 16)
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
355 extern int rtsp_default_protocols;
2884
e6e7ba123447 Drop RTSP default protocol.
diego
parents: 2620
diff changeset
356 #endif
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
357 extern int rtsp_rtp_port_min;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
358 extern int rtsp_rtp_port_max;
179
43ac45200138 suppressed RTSP abort hack - added PLAY/PAUSE
bellard
parents: 65
diff changeset
359
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
360 /**
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
361 * Send a command to the RTSP server without waiting for the reply.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
362 *
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
363 * @param s RTSP (de)muxer context
5888
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5845
diff changeset
364 * @param method the method for the request
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5845
diff changeset
365 * @param url the target url for the request
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5845
diff changeset
366 * @param headers extra header lines to include in the request
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
367 * @param send_content if non-null, the data to send as request body content
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
368 * @param send_content_length the length of the send_content data, or 0 if
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
369 * send_content is null
6095
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
370 *
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
371 * @return zero if success, nonzero otherwise
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
372 */
6095
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
373 int ff_rtsp_send_cmd_with_content_async(AVFormatContext *s,
6096
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
374 const char *method, const char *url,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
375 const char *headers,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
376 const unsigned char *send_content,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
377 int send_content_length);
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
378 /**
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
379 * Send a command to the RTSP server without waiting for the reply.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
380 *
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
381 * @see rtsp_send_cmd_with_content_async
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
382 */
6095
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
383 int ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method,
6096
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
384 const char *url, const char *headers);
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
385
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
386 /**
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
387 * Send a command to the RTSP server and wait for the reply.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
388 *
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
389 * @param s RTSP (de)muxer context
5888
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5845
diff changeset
390 * @param method the method for the request
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5845
diff changeset
391 * @param url the target url for the request
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5845
diff changeset
392 * @param headers extra header lines to include in the request
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
393 * @param reply pointer where the RTSP message header will be stored
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
394 * @param content_ptr pointer where the RTSP message body, if any, will
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
395 * be stored (length is in reply)
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
396 * @param send_content if non-null, the data to send as request body content
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
397 * @param send_content_length the length of the send_content data, or 0 if
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
398 * send_content is null
6095
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
399 *
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
400 * @return zero if success, nonzero otherwise
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
401 */
6095
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
402 int ff_rtsp_send_cmd_with_content(AVFormatContext *s,
6096
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
403 const char *method, const char *url,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
404 const char *headers,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
405 RTSPMessageHeader *reply,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
406 unsigned char **content_ptr,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
407 const unsigned char *send_content,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
408 int send_content_length);
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
409
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
410 /**
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
411 * Send a command to the RTSP server and wait for the reply.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
412 *
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
413 * @see rtsp_send_cmd_with_content
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
414 */
6095
c5337969b43b RTSP: Propagate errors up from ff_rtsp_send_cmd*
mstorsjo
parents: 6093
diff changeset
415 int ff_rtsp_send_cmd(AVFormatContext *s, const char *method,
6096
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
416 const char *url, const char *headers,
7c2221a89902 Cosmetics: Reindent/align/wrap
mstorsjo
parents: 6095
diff changeset
417 RTSPMessageHeader *reply, unsigned char **content_ptr);
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
418
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
419 /**
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
420 * Read a RTSP message from the server, or prepare to read data
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
421 * packets if we're reading data interleaved over the TCP/RTSP
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
422 * connection as well.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
423 *
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
424 * @param s RTSP (de)muxer context
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
425 * @param reply pointer where the RTSP message header will be stored
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
426 * @param content_ptr pointer where the RTSP message body, if any, will
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
427 * be stored (length is in reply)
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
428 * @param return_on_interleaved_data whether the function may return if we
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
429 * encounter a data marker ('$'), which precedes data
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
430 * packets over interleaved TCP/RTSP connections. If this
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
431 * is set, this function will return 1 after encountering
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
432 * a '$'. If it is not set, the function will skip any
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
433 * data packets (if they are encountered), until a reply
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
434 * has been fully parsed. If no more data is available
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
435 * without parsing a reply, it will return an error.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
436 *
5909
b8041f85c327 Replace @returns by @return.
benoit
parents: 5890
diff changeset
437 * @return 1 if a data packets is ready to be received, -1 on error,
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
438 * and 0 on success.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
439 */
5697
484fceabfad2 Prefix non-static RTSP functions with ff_.
rbultje
parents: 5692
diff changeset
440 int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply,
5700
982edb9135ca Cosmetics: reindent
mstorsjo
parents: 5697
diff changeset
441 unsigned char **content_ptr,
982edb9135ca Cosmetics: reindent
mstorsjo
parents: 5697
diff changeset
442 int return_on_interleaved_data);
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
443
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
444 /**
5845
7512694b0515 Make rtsp_skip_packet non-static, add ff prefix
mstorsjo
parents: 5843
diff changeset
445 * Skip a RTP/TCP interleaved packet.
7512694b0515 Make rtsp_skip_packet non-static, add ff prefix
mstorsjo
parents: 5843
diff changeset
446 */
7512694b0515 Make rtsp_skip_packet non-static, add ff prefix
mstorsjo
parents: 5843
diff changeset
447 void ff_rtsp_skip_packet(AVFormatContext *s);
7512694b0515 Make rtsp_skip_packet non-static, add ff prefix
mstorsjo
parents: 5843
diff changeset
448
7512694b0515 Make rtsp_skip_packet non-static, add ff prefix
mstorsjo
parents: 5843
diff changeset
449 /**
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
450 * Connect to the RTSP server and set up the individual media streams.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
451 * This can be used for both muxers and demuxers.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
452 *
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
453 * @param s RTSP (de)muxer context
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
454 *
5909
b8041f85c327 Replace @returns by @return.
benoit
parents: 5890
diff changeset
455 * @return 0 on success, < 0 on error. Cleans up all allocations done
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
456 * within the function on error.
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
457 */
5697
484fceabfad2 Prefix non-static RTSP functions with ff_.
rbultje
parents: 5692
diff changeset
458 int ff_rtsp_connect(AVFormatContext *s);
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
459
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
460 /**
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
461 * Close and free all streams within the RTSP (de)muxer
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
462 *
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
463 * @param s RTSP (de)muxer context
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
464 */
5697
484fceabfad2 Prefix non-static RTSP functions with ff_.
rbultje
parents: 5692
diff changeset
465 void ff_rtsp_close_streams(AVFormatContext *s);
5692
87b26ad577c5 Add declarations and doxygen documentation of generic rtsp support functions
mstorsjo
parents: 5688
diff changeset
466
6093
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
467 /**
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
468 * Close all connection handles within the RTSP (de)muxer
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
469 *
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
470 * @param rt RTSP (de)muxer context
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
471 */
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
472 void ff_rtsp_close_connections(AVFormatContext *rt);
e688babd14df RTSP: Add a second URLContext for outgoing messages
mstorsjo
parents: 6070
diff changeset
473
5104
4c39baa3dfbf Use globally consistent include guard names.
stefano
parents: 5013
diff changeset
474 #endif /* AVFORMAT_RTSP_H */