Mercurial > mplayer.hg
annotate stream/stream_ffmpeg.c @ 35690:f6470f5787b9
Make variables local.
A global scope isn't necessary.
author | ib |
---|---|
date | Fri, 18 Jan 2013 20:29:02 +0000 |
parents | ceb148e1fe31 |
children | b5abdfe9bc61 |
rev | line source |
---|---|
30426
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
1 /* |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
2 * This file is part of MPlayer. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
3 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
4 * MPlayer is free software; you can redistribute it and/or modify |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
5 * it under the terms of the GNU General Public License as published by |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
6 * the Free Software Foundation; either version 2 of the License, or |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
7 * (at your option) any later version. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
8 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
9 * MPlayer is distributed in the hope that it will be useful, |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
12 * GNU General Public License for more details. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
13 * |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
17 */ |
ce0122361a39
Add license header to all files missing it in the stream subdirectory.
diego
parents:
30190
diff
changeset
|
18 |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
19 #include "config.h" |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
20 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
21 #include "libavformat/avformat.h" |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
22 #include "libavformat/avio.h" |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
23 #include "mp_msg.h" |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
24 #include "stream.h" |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
25 #include "m_option.h" |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
26 #include "m_struct.h" |
33871
30f5e5cd3676
Move code for setting up libav* logging callbacks from vd_ffmpeg to a
reimar
parents:
32794
diff
changeset
|
27 #include "av_helpers.h" |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
28 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
29 static int fill_buffer(stream_t *s, char *buffer, int max_len) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
30 { |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
31 int r = avio_read(s->priv, buffer, max_len); |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
32 return (r <= 0) ? -1 : r; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
33 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
34 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
35 static int write_buffer(stream_t *s, char *buffer, int len) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
36 { |
34751 | 37 AVIOContext *ctx = s->priv; |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
38 avio_write(s->priv, buffer, len); |
34751 | 39 avio_flush(s->priv); |
40 if (ctx->error) | |
41 return -1; | |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
42 return len; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
43 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
44 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
45 static int seek(stream_t *s, off_t newpos) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
46 { |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
47 s->pos = newpos; |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
48 if (avio_seek(s->priv, s->pos, SEEK_SET) < 0) { |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
49 s->eof = 1; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
50 return 0; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
51 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
52 return 1; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
53 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
54 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
55 static int control(stream_t *s, int cmd, void *arg) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
56 { |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
57 AVIOContext *ctx = s->priv; |
31161
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
58 int64_t size, ts; |
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
59 double pts; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
60 switch(cmd) { |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
61 case STREAM_CTRL_GET_SIZE: |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
62 size = avio_size(s->priv); |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
63 if(size >= 0) { |
35266
ceb148e1fe31
Change STREAM_CTRL_GET_SIZE argument type from off_t to
reimar
parents:
34751
diff
changeset
|
64 *(uint64_t *)arg = size; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
65 return 1; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
66 } |
31161
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
67 break; |
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
68 case STREAM_CTRL_SEEK_TO_TIME: |
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
69 pts = *(double *)arg; |
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
70 ts = pts * AV_TIME_BASE; |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
71 if (!ctx->read_seek) |
34544
36ef1a75aa48
Some hacks to allow stream_ffmpeg to compile against newer FFmpeg.
reimar
parents:
33871
diff
changeset
|
72 break; |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
73 ts = ctx->read_seek(s->priv, -1, ts, 0); |
31161
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
74 if (ts >= 0) |
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
75 return 1; |
0255b5679645
Add support for STREAM_CTRL_SEEK_TO_TIME in ffmpeg streams
hyc
parents:
30457
diff
changeset
|
76 break; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
77 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
78 return STREAM_UNSUPPORTED; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
79 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
80 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
81 static void close_f(stream_t *stream) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
82 { |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
83 avio_close(stream->priv); |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
84 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
85 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
86 static const char prefix[] = "ffmpeg://"; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
87 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
88 static int open_f(stream_t *stream, int mode, void *opts, int *file_format) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
89 { |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
90 int flags = 0; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
91 const char *filename; |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
92 AVIOContext *ctx = NULL; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
93 int res = STREAM_ERROR; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
94 int64_t size; |
30456
0eee9d2e7a1d
Add support for FFmpeg's rtsp dummy URL-with-pseudo-demuxer scheme.
reimar
parents:
30426
diff
changeset
|
95 int dummy; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
96 |
33871
30f5e5cd3676
Move code for setting up libav* logging callbacks from vd_ffmpeg to a
reimar
parents:
32794
diff
changeset
|
97 init_avformat(); |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
98 if (mode == STREAM_READ) |
34544
36ef1a75aa48
Some hacks to allow stream_ffmpeg to compile against newer FFmpeg.
reimar
parents:
33871
diff
changeset
|
99 flags = AVIO_FLAG_READ; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
100 else if (mode == STREAM_WRITE) |
34544
36ef1a75aa48
Some hacks to allow stream_ffmpeg to compile against newer FFmpeg.
reimar
parents:
33871
diff
changeset
|
101 flags = AVIO_FLAG_WRITE; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
102 else { |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
103 mp_msg(MSGT_OPEN, MSGL_ERR, "[ffmpeg] Unknown open mode %d\n", mode); |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
104 res = STREAM_UNSUPPORTED; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
105 goto out; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
106 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
107 |
34750
76ab607371dc
Use AVIO_FLAG_DIRECT to avoid issues with one more pointless buffering layer.
reimar
parents:
34736
diff
changeset
|
108 #ifdef AVIO_FLAG_DIRECT |
76ab607371dc
Use AVIO_FLAG_DIRECT to avoid issues with one more pointless buffering layer.
reimar
parents:
34736
diff
changeset
|
109 flags |= AVIO_FLAG_DIRECT; |
76ab607371dc
Use AVIO_FLAG_DIRECT to avoid issues with one more pointless buffering layer.
reimar
parents:
34736
diff
changeset
|
110 #else |
76ab607371dc
Use AVIO_FLAG_DIRECT to avoid issues with one more pointless buffering layer.
reimar
parents:
34736
diff
changeset
|
111 mp_msg(MSGT_OPEN, MSGL_WARN, "[ffmpeg] No support for AVIO_FLAG_DIRECT, might cause performance and other issues.\n" |
76ab607371dc
Use AVIO_FLAG_DIRECT to avoid issues with one more pointless buffering layer.
reimar
parents:
34736
diff
changeset
|
112 "Please update to and rebuild against an FFmpeg version supporting it.\n"); |
76ab607371dc
Use AVIO_FLAG_DIRECT to avoid issues with one more pointless buffering layer.
reimar
parents:
34736
diff
changeset
|
113 #endif |
76ab607371dc
Use AVIO_FLAG_DIRECT to avoid issues with one more pointless buffering layer.
reimar
parents:
34736
diff
changeset
|
114 |
30189
787bcd39e929
Simplify ffmpeg stream support, we (so far) do not need any special option parsing.
reimar
parents:
29886
diff
changeset
|
115 if (stream->url) |
787bcd39e929
Simplify ffmpeg stream support, we (so far) do not need any special option parsing.
reimar
parents:
29886
diff
changeset
|
116 filename = stream->url; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
117 else { |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
118 mp_msg(MSGT_OPEN, MSGL_ERR, "[ffmpeg] No URL\n"); |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
119 goto out; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
120 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
121 if (!strncmp(filename, prefix, strlen(prefix))) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
122 filename += strlen(prefix); |
30456
0eee9d2e7a1d
Add support for FFmpeg's rtsp dummy URL-with-pseudo-demuxer scheme.
reimar
parents:
30426
diff
changeset
|
123 dummy = !strncmp(filename, "rtsp:", 5); |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
124 mp_msg(MSGT_OPEN, MSGL_V, "[ffmpeg] Opening %s\n", filename); |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
125 |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
126 if (!dummy && avio_open(&ctx, filename, flags) < 0) |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
127 goto out; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
128 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
129 stream->priv = ctx; |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
130 size = dummy ? 0 : avio_size(ctx); |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
131 if (size >= 0) |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
132 stream->end_pos = size; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
133 stream->type = STREAMTYPE_FILE; |
29886
988c42cb595a
Fall back to read-based seeking for ffmpeg:// URLs when is_streamed is set
reimar
parents:
29881
diff
changeset
|
134 stream->seek = seek; |
34736
bbbe7b6abc62
stream_ffmpeg: convert to avio API, fix build against shared libavformat
diego
parents:
34544
diff
changeset
|
135 if (dummy || !ctx->seekable) { |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
136 stream->type = STREAMTYPE_STREAM; |
29886
988c42cb595a
Fall back to read-based seeking for ffmpeg:// URLs when is_streamed is set
reimar
parents:
29881
diff
changeset
|
137 stream->seek = NULL; |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
138 } |
30456
0eee9d2e7a1d
Add support for FFmpeg's rtsp dummy URL-with-pseudo-demuxer scheme.
reimar
parents:
30426
diff
changeset
|
139 if (!dummy) { |
30457 | 140 stream->fill_buffer = fill_buffer; |
141 stream->write_buffer = write_buffer; | |
142 stream->control = control; | |
143 stream->close = close_f; | |
30456
0eee9d2e7a1d
Add support for FFmpeg's rtsp dummy URL-with-pseudo-demuxer scheme.
reimar
parents:
30426
diff
changeset
|
144 } |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
145 res = STREAM_OK; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
146 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
147 out: |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
148 return res; |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
149 } |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
150 |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
151 const stream_info_t stream_info_ffmpeg = { |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
152 "FFmpeg", |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
153 "ffmpeg", |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
154 "", |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
155 "", |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
156 open_f, |
30190
561453831add
Support rtmp:// URLs directly instead of requiring ffmpeg://rtmp://
reimar
parents:
30189
diff
changeset
|
157 { "ffmpeg", "rtmp", NULL }, |
30189
787bcd39e929
Simplify ffmpeg stream support, we (so far) do not need any special option parsing.
reimar
parents:
29886
diff
changeset
|
158 NULL, |
29881
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
159 1 // Urls are an option string |
5797dc687a8e
Add preliminary support for streaming via FFmpeg's URProtocol functions.
reimar
parents:
diff
changeset
|
160 }; |