annotate rtspenc.c @ 5959:ed7556aaaea5 libavformat

Parse strf mov atoms This fixes roundup issue 1270.
author mstorsjo
date Fri, 16 Apr 2010 20:36:24 +0000
parents 4ddbc14bc768
children fd7fc7d79630
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
1 /*
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
2 * RTSP muxer
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
3 * Copyright (c) 2010 Martin Storsjo
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
4 *
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
5 * This file is part of FFmpeg.
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
6 *
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
11 *
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
15 * Lesser General Public License for more details.
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
16 *
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
20 */
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
21
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
22 #include "avformat.h"
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
23
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
24 #include <sys/time.h>
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
25 #if HAVE_SYS_SELECT_H
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
26 #include <sys/select.h>
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
27 #endif
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
28 #include "network.h"
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
29 #include "rtsp.h"
5864
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
30 #include <libavutil/intreadwrite.h>
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
31
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
32 static int rtsp_write_record(AVFormatContext *s)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
33 {
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
34 RTSPState *rt = s->priv_data;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
35 RTSPMessageHeader reply1, *reply = &reply1;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
36 char cmd[1024];
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
37
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
38 snprintf(cmd, sizeof(cmd),
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
39 "Range: npt=%0.3f-\r\n",
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
40 (double) 0);
5888
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5864
diff changeset
41 ff_rtsp_send_cmd(s, "RECORD", rt->control_uri, cmd, reply, NULL);
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
42 if (reply->status_code != RTSP_STATUS_OK)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
43 return -1;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
44 rt->state = RTSP_STATE_STREAMING;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
45 return 0;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
46 }
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
47
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
48 static int rtsp_write_header(AVFormatContext *s)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
49 {
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
50 RTSPState *rt = s->priv_data;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
51 int ret;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
52
5697
484fceabfad2 Prefix non-static RTSP functions with ff_.
rbultje
parents: 5695
diff changeset
53 ret = ff_rtsp_connect(s);
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
54 if (ret)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
55 return ret;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
56
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
57 if (rtsp_write_record(s) < 0) {
5697
484fceabfad2 Prefix non-static RTSP functions with ff_.
rbultje
parents: 5695
diff changeset
58 ff_rtsp_close_streams(s);
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
59 url_close(rt->rtsp_hd);
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
60 return AVERROR_INVALIDDATA;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
61 }
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
62 return 0;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
63 }
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
64
5864
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
65 static int tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
66 {
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
67 RTSPState *rt = s->priv_data;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
68 AVFormatContext *rtpctx = rtsp_st->transport_priv;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
69 uint8_t *buf, *ptr;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
70 int size;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
71 uint8_t interleave_header[4];
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
72
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
73 size = url_close_dyn_buf(rtpctx->pb, &buf);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
74 ptr = buf;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
75 while (size > 4) {
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
76 uint32_t packet_len = AV_RB32(ptr);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
77 int id;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
78 ptr += 4;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
79 size -= 4;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
80 if (packet_len > size || packet_len < 2)
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
81 break;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
82 if (ptr[1] >= 200 && ptr[1] <= 204)
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
83 id = rtsp_st->interleaved_max; /* RTCP */
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
84 else
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
85 id = rtsp_st->interleaved_min; /* RTP */
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
86 interleave_header[0] = '$';
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
87 interleave_header[1] = id;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
88 AV_WB16(interleave_header + 2, packet_len);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
89 url_write(rt->rtsp_hd, interleave_header, 4);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
90 url_write(rt->rtsp_hd, ptr, packet_len);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
91 ptr += packet_len;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
92 size -= packet_len;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
93 }
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
94 av_free(buf);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
95 url_open_dyn_packet_buf(&rtpctx->pb, RTSP_TCP_MAX_PACKET_SIZE);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
96 return 0;
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
97 }
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
98
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
99 static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
100 {
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
101 RTSPState *rt = s->priv_data;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
102 RTSPStream *rtsp_st;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
103 fd_set rfds;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
104 int n, tcp_fd;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
105 struct timeval tv;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
106 AVFormatContext *rtpctx;
5721
82b0dc4f052a RTSP muxer: Use a local copy of the AVPacket for sending to the chained muxer
mstorsjo
parents: 5697
diff changeset
107 AVPacket local_pkt;
5846
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
108 int ret;
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
109
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
110 tcp_fd = url_get_file_handle(rt->rtsp_hd);
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
111
5846
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
112 while (1) {
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
113 FD_ZERO(&rfds);
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
114 FD_SET(tcp_fd, &rfds);
5847
d04ce2be0081 Reindent
mstorsjo
parents: 5846
diff changeset
115 tv.tv_sec = 0;
d04ce2be0081 Reindent
mstorsjo
parents: 5846
diff changeset
116 tv.tv_usec = 0;
d04ce2be0081 Reindent
mstorsjo
parents: 5846
diff changeset
117 n = select(tcp_fd + 1, &rfds, NULL, NULL, &tv);
5846
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
118 if (n <= 0)
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
119 break;
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
120 if (FD_ISSET(tcp_fd, &rfds)) {
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
121 RTSPMessageHeader reply;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
122
5846
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
123 /* Don't let ff_rtsp_read_reply handle interleaved packets,
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
124 * since it would block and wait for an RTSP reply on the socket
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
125 * (which may not be coming any time soon) if it handles
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
126 * interleaved packets internally. */
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
127 ret = ff_rtsp_read_reply(s, &reply, NULL, 1);
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
128 if (ret < 0)
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
129 return AVERROR(EPIPE);
5846
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
130 if (ret == 1)
6821f3887d0e Don't let ff_rtsp_read_reply skip interleaved RTP/TCP packets in rtsp_write_packet.
mstorsjo
parents: 5800
diff changeset
131 ff_rtsp_skip_packet(s);
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
132 /* XXX: parse message */
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
133 if (rt->state != RTSP_STATE_STREAMING)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
134 return AVERROR(EPIPE);
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
135 }
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
136 }
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
137
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
138 if (pkt->stream_index < 0 || pkt->stream_index >= rt->nb_rtsp_streams)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
139 return AVERROR_INVALIDDATA;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
140 rtsp_st = rt->rtsp_streams[pkt->stream_index];
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
141 rtpctx = rtsp_st->transport_priv;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
142
5721
82b0dc4f052a RTSP muxer: Use a local copy of the AVPacket for sending to the chained muxer
mstorsjo
parents: 5697
diff changeset
143 /* Use a local packet for writing to the chained muxer, otherwise
82b0dc4f052a RTSP muxer: Use a local copy of the AVPacket for sending to the chained muxer
mstorsjo
parents: 5697
diff changeset
144 * the internal stream_index = 0 becomes visible to the muxer user. */
82b0dc4f052a RTSP muxer: Use a local copy of the AVPacket for sending to the chained muxer
mstorsjo
parents: 5697
diff changeset
145 local_pkt = *pkt;
82b0dc4f052a RTSP muxer: Use a local copy of the AVPacket for sending to the chained muxer
mstorsjo
parents: 5697
diff changeset
146 local_pkt.stream_index = 0;
5864
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
147 ret = av_write_frame(rtpctx, &local_pkt);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
148 /* av_write_frame does all the RTP packetization. If using TCP as
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
149 * transport, rtpctx->pb is only a dyn_packet_buf that queues up the
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
150 * packets, so we need to send them out on the TCP connection separately.
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
151 */
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
152 if (!ret && rt->lower_transport == RTSP_LOWER_TRANSPORT_TCP)
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
153 ret = tcp_write_packet(s, rtsp_st);
0ff0826b6c3d Add support for TCP as lower transport in the RTSP muxer
mstorsjo
parents: 5847
diff changeset
154 return ret;
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
155 }
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
156
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
157 static int rtsp_write_close(AVFormatContext *s)
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
158 {
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
159 RTSPState *rt = s->priv_data;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
160
5888
4ddbc14bc768 Add separate method/url parameters to the rtsp_send_cmd functions
mstorsjo
parents: 5864
diff changeset
161 ff_rtsp_send_cmd_async(s, "TEARDOWN", rt->control_uri, NULL);
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
162
5697
484fceabfad2 Prefix non-static RTSP functions with ff_.
rbultje
parents: 5695
diff changeset
163 ff_rtsp_close_streams(s);
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
164 url_close(rt->rtsp_hd);
5756
7c7fe75728dd Use ff_url_join for assembling URLs, instead of snprintf
mstorsjo
parents: 5721
diff changeset
165 ff_network_close();
5695
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
166 return 0;
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
167 }
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
168
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
169 AVOutputFormat rtsp_muxer = {
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
170 "rtsp",
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
171 NULL_IF_CONFIG_SMALL("RTSP output format"),
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
172 NULL,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
173 NULL,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
174 sizeof(RTSPState),
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
175 CODEC_ID_PCM_MULAW,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
176 CODEC_ID_NONE,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
177 rtsp_write_header,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
178 rtsp_write_packet,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
179 rtsp_write_close,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
180 .flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
181 };
25062326d2f9 Add an RTSP muxer
mstorsjo
parents:
diff changeset
182