Skip to content
Newer
Older
100644 312 lines (253 sloc) 9.42 KB
eca0609 @DonDiego Add LGPL header as requested by Oded.
DonDiego authored Feb 25, 2007
1 /*
2 * NUT (de)muxing via libnut
3 * copyright (c) 2006 Oded Shimon <ods15@ods15.dyndns.org>
4 *
2912e87 @mansr Replace FFmpeg with Libav in licence headers
mansr authored Mar 18, 2011
5 * This file is part of Libav.
eca0609 @DonDiego Add LGPL header as requested by Oded.
DonDiego authored Feb 25, 2007
6 *
2912e87 @mansr Replace FFmpeg with Libav in licence headers
mansr authored Mar 18, 2011
7 * Libav is free software; you can redistribute it and/or
eca0609 @DonDiego Add LGPL header as requested by Oded.
DonDiego authored Feb 25, 2007
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
2912e87 @mansr Replace FFmpeg with Libav in licence headers
mansr authored Mar 18, 2011
12 * Libav is distributed in the hope that it will be useful,
eca0609 @DonDiego Add LGPL header as requested by Oded.
DonDiego authored Feb 25, 2007
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
2912e87 @mansr Replace FFmpeg with Libav in licence headers
mansr authored Mar 18, 2011
18 * License along with Libav; if not, write to the Free Software
eca0609 @DonDiego Add LGPL header as requested by Oded.
DonDiego authored Feb 25, 2007
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
0020596 Add doxygen file header to libnut.c
Oded Shimon authored Mar 10, 2007
22 /**
ba87f08 @DonDiego Remove explicit filename from Doxygen @file commands.
DonDiego authored Apr 20, 2010
23 * @file
0020596 Add doxygen file header to libnut.c
Oded Shimon authored Mar 10, 2007
24 * NUT demuxing and muxing via libnut.
25 * @author Oded Shimon <ods15@ods15.dyndns.org>
26 */
27
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
28 #include "avformat.h"
c3f9ebf @elenril lavf: make av_set_pts_info private.
elenril authored Nov 29, 2011
29 #include "internal.h"
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
30 #include "riff.h"
4d8aa1c update to libnut API, rename nut.h->libnut.h
Oded Shimon authored Nov 14, 2006
31 #include <libnut.h>
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
32
33 #define ID_STRING "nut/multimedia container"
34 #define ID_LENGTH (strlen(ID_STRING) + 1)
35
36 typedef struct {
bffc76b Update lavf/libnut.c to _tt type names in libnut API
Oded Shimon authored Dec 12, 2008
37 nut_context_tt * nut;
38 nut_stream_header_tt * s;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
39 } NUTContext;
40
7caf0cc @michaelni add codec_id <-> codec_tag tables to AVIn/OutputFormat
michaelni authored Jan 21, 2007
41 static const AVCodecTag nut_tags[] = {
468f810 change mpeg4 fourcc from "mp4s" to "mp4v"
Oded Shimon authored Nov 17, 2006
42 { CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 'v') },
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
43 { CODEC_ID_MP3, MKTAG('m', 'p', '3', ' ') },
44 { CODEC_ID_VORBIS, MKTAG('v', 'r', 'b', 's') },
45 { 0, 0 },
46 };
47
b250f9c @aurelj Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurelj authored Jan 13, 2009
48 #if CONFIG_LIBNUT_MUXER
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
49 static int av_write(void * h, size_t len, const uint8_t * buf) {
ae628ec @elenril avio: rename ByteIOContext to AVIOContext.
elenril authored Feb 20, 2011
50 AVIOContext * bc = h;
77eb550 @elenril avio: avio: avio_ prefixes for put_* functions
elenril authored Feb 21, 2011
51 avio_write(bc, buf, len);
b7f2fdd @elenril avio: rename put_flush_packet -> avio_flush
elenril authored Mar 14, 2011
52 //avio_flush(bc);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
53 return len;
54 }
55
56 static int nut_write_header(AVFormatContext * avf) {
57 NUTContext * priv = avf->priv_data;
ae628ec @elenril avio: rename ByteIOContext to AVIOContext.
elenril authored Feb 20, 2011
58 AVIOContext * bc = avf->pb;
bffc76b Update lavf/libnut.c to _tt type names in libnut API
Oded Shimon authored Dec 12, 2008
59 nut_muxer_opts_tt mopts = {
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
60 .output = {
61 .priv = bc,
62 .write = av_write,
63 },
64 .alloc = { av_malloc, av_realloc, av_free },
65 .write_index = 1,
66 .realtime_stream = 0,
67 .max_distance = 32768,
bf054f7 update to libnut, use framecode table generator
Oded Shimon authored Nov 17, 2006
68 .fti = NULL,
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
69 };
bffc76b Update lavf/libnut.c to _tt type names in libnut API
Oded Shimon authored Dec 12, 2008
70 nut_stream_header_tt * s;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
71 int i;
72
73 priv->s = s = av_mallocz((avf->nb_streams + 1) * sizeof*s);
74
75 for (i = 0; i < avf->nb_streams; i++) {
76 AVCodecContext * codec = avf->streams[i]->codec;
77 int j;
78 int fourcc = 0;
d7d3efa sync to libnut, nom->num
Oded Shimon authored Dec 23, 2006
79 int num, denom, ssize;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
80
72415b2 Define AVMediaType enum, and use it instead of enum CodecType, which
Stefano Sabatini authored Mar 30, 2010
81 s[i].type = codec->codec_type == AVMEDIA_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
82
83 if (codec->codec_tag) fourcc = codec->codec_tag;
1a40491 @danielverkamp Add ff_ prefixes to exported symbols in libavformat/riff.h.
danielverkamp authored Jun 22, 2009
84 else fourcc = ff_codec_get_tag(nut_tags, codec->codec_id);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
85
86 if (!fourcc) {
72415b2 Define AVMediaType enum, and use it instead of enum CodecType, which
Stefano Sabatini authored Mar 30, 2010
87 if (codec->codec_type == AVMEDIA_TYPE_VIDEO) fourcc = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id);
88 if (codec->codec_type == AVMEDIA_TYPE_AUDIO) fourcc = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
89 }
90
91 s[i].fourcc_len = 4;
92 s[i].fourcc = av_malloc(s[i].fourcc_len);
93 for (j = 0; j < s[i].fourcc_len; j++) s[i].fourcc[j] = (fourcc >> (j*8)) & 0xFF;
94
d7d3efa sync to libnut, nom->num
Oded Shimon authored Dec 23, 2006
95 ff_parse_specific_params(codec, &num, &ssize, &denom);
c3f9ebf @elenril lavf: make av_set_pts_info private.
elenril authored Nov 29, 2011
96 avpriv_set_pts_info(avf->streams[i], 60, denom, num);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
97
d7d3efa sync to libnut, nom->num
Oded Shimon authored Dec 23, 2006
98 s[i].time_base.num = denom;
99 s[i].time_base.den = num;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
100
101 s[i].fixed_fps = 0;
102 s[i].decode_delay = codec->has_b_frames;
103 s[i].codec_specific_len = codec->extradata_size;
104 s[i].codec_specific = codec->extradata;
105
72415b2 Define AVMediaType enum, and use it instead of enum CodecType, which
Stefano Sabatini authored Mar 30, 2010
106 if (codec->codec_type == AVMEDIA_TYPE_VIDEO) {
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
107 s[i].width = codec->width;
108 s[i].height = codec->height;
109 s[i].sample_width = 0;
110 s[i].sample_height = 0;
111 s[i].colorspace_type = 0;
112 } else {
d7d3efa sync to libnut, nom->num
Oded Shimon authored Dec 23, 2006
113 s[i].samplerate_num = codec->sample_rate;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
114 s[i].samplerate_denom = 1;
115 s[i].channel_count = codec->channels;
116 }
117 }
118
119 s[avf->nb_streams].type = -1;
120 priv->nut = nut_muxer_init(&mopts, s, NULL);
121
122 return 0;
123 }
124
125 static int nut_write_packet(AVFormatContext * avf, AVPacket * pkt) {
126 NUTContext * priv = avf->priv_data;
bffc76b Update lavf/libnut.c to _tt type names in libnut API
Oded Shimon authored Dec 12, 2008
127 nut_packet_tt p;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
128
129 p.len = pkt->size;
130 p.stream = pkt->stream_index;
131 p.pts = pkt->pts;
cc947f0 Replace all occurences of PKT_FLAG_KEY with AV_PKT_FLAG_KEY.
Jean-Daniel Dupas authored Mar 31, 2010
132 p.flags = pkt->flags & AV_PKT_FLAG_KEY ? NUT_FLAG_KEY : 0;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
133 p.next_pts = 0;
134
135 nut_write_frame_reorder(priv->nut, &p, pkt->data);
136
137 return 0;
138 }
139
140 static int nut_write_trailer(AVFormatContext * avf) {
ae628ec @elenril avio: rename ByteIOContext to AVIOContext.
elenril authored Feb 20, 2011
141 AVIOContext * bc = avf->pb;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
142 NUTContext * priv = avf->priv_data;
143 int i;
144
145 nut_muxer_uninit_reorder(priv->nut);
b7f2fdd @elenril avio: rename put_flush_packet -> avio_flush
elenril authored Mar 14, 2011
146 avio_flush(bc);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
147
148 for(i = 0; priv->s[i].type != -1; i++ ) av_freep(&priv->s[i].fourcc);
149 av_freep(&priv->s);
150
151 return 0;
152 }
153
c6610a2 @Flameeyes Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
Flameeyes authored Jan 25, 2011
154 AVOutputFormat ff_libnut_muxer = {
dfc2c4d @elenril lavf: use designated initialisers for all (de)muxers.
elenril authored Jul 16, 2011
155 .name = "libnut",
156 .long_name = "nut format",
157 .mime_type = "video/x-nut",
158 .extensions = "nut",
159 .priv_data_size = sizeof(NUTContext),
160 .audio_codec = CODEC_ID_VORBIS,
161 .video_codec = CODEC_ID_MPEG4,
162 .write_header = nut_write_header,
163 .write_packet = nut_write_packet,
164 .write_trailer = nut_write_trailer,
20234a4 @mstorsjo cosmetics: Align muxer/demuxer declarations
mstorsjo authored Apr 6, 2012
165 .flags = AVFMT_GLOBALHEADER,
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
166 };
8212568 @DonDiego Replace generic CONFIG_MUXERS preprocessor conditionals by more specific
DonDiego authored Sep 2, 2008
167 #endif /* CONFIG_LIBNUT_MUXER */
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
168
169 static int nut_probe(AVProbeData *p) {
87e8788 @michaelni allocate 32 extra bytes at the end of the probe buffer and remove mos…
michaelni authored Apr 8, 2007
170 if (!memcmp(p->buf, ID_STRING, ID_LENGTH)) return AVPROBE_SCORE_MAX;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
171
172 return 0;
173 }
174
175 static size_t av_read(void * h, size_t len, uint8_t * buf) {
ae628ec @elenril avio: rename ByteIOContext to AVIOContext.
elenril authored Feb 20, 2011
176 AVIOContext * bc = h;
b7effd4 @elenril avio: avio_ prefixes for get_* functions
elenril authored Feb 21, 2011
177 return avio_read(bc, buf, len);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
178 }
179
180 static off_t av_seek(void * h, long long pos, int whence) {
ae628ec @elenril avio: rename ByteIOContext to AVIOContext.
elenril authored Feb 20, 2011
181 AVIOContext * bc = h;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
182 if (whence == SEEK_END) {
76aa876 @elenril avio: avio_ prefix for url_fsize
elenril authored Mar 4, 2011
183 pos = avio_size(bc) + pos;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
184 whence = SEEK_SET;
185 }
6b4aa5d @elenril avio: avio_ prefix for url_fseek
elenril authored Feb 28, 2011
186 return avio_seek(bc, pos, whence);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
187 }
188
6e9651d @elenril lavf: remove AVFormatParameters from AVFormatContext.read_header sign…
elenril authored Jan 12, 2012
189 static int nut_read_header(AVFormatContext * avf) {
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
190 NUTContext * priv = avf->priv_data;
ae628ec @elenril avio: rename ByteIOContext to AVIOContext.
elenril authored Feb 20, 2011
191 AVIOContext * bc = avf->pb;
bffc76b Update lavf/libnut.c to _tt type names in libnut API
Oded Shimon authored Dec 12, 2008
192 nut_demuxer_opts_tt dopts = {
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
193 .input = {
194 .priv = bc,
195 .seek = av_seek,
196 .read = av_read,
197 .eof = NULL,
198 .file_pos = 0,
199 },
200 .alloc = { av_malloc, av_realloc, av_free },
0d666a4 update to libnut, add cache_syncpoints
Oded Shimon authored Nov 14, 2006
201 .read_index = 1,
202 .cache_syncpoints = 1,
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
203 };
bffc76b Update lavf/libnut.c to _tt type names in libnut API
Oded Shimon authored Dec 12, 2008
204 nut_context_tt * nut = priv->nut = nut_demuxer_init(&dopts);
205 nut_stream_header_tt * s;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
206 int ret, i;
207
208 if ((ret = nut_read_headers(nut, &s, NULL))) {
e4bb708 Update to libnut API, non-negative errors
Oded Shimon authored Nov 16, 2006
209 av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret));
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
210 nut_demuxer_uninit(nut);
211 return -1;
212 }
213
214 priv->s = s;
215
216 for (i = 0; s[i].type != -1 && i < 2; i++) {
84ad31f @elenril lavf: replace av_new_stream->avformat_new_stream part II.
elenril authored Jun 18, 2011
217 AVStream * st = avformat_new_stream(avf, NULL);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
218 int j;
219
220 for (j = 0; j < s[i].fourcc_len && j < 8; j++) st->codec->codec_tag |= s[i].fourcc[j]<<(j*8);
221
222 st->codec->has_b_frames = s[i].decode_delay;
223
224 st->codec->extradata_size = s[i].codec_specific_len;
225 if (st->codec->extradata_size) {
226 st->codec->extradata = av_mallocz(st->codec->extradata_size);
227 memcpy(st->codec->extradata, s[i].codec_specific, st->codec->extradata_size);
228 }
229
c3f9ebf @elenril lavf: make av_set_pts_info private.
elenril authored Nov 29, 2011
230 avpriv_set_pts_info(avf->streams[i], 60, s[i].time_base.num, s[i].time_base.den);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
231 st->start_time = 0;
232 st->duration = s[i].max_pts;
233
1a40491 @danielverkamp Add ff_ prefixes to exported symbols in libavformat/riff.h.
danielverkamp authored Jun 22, 2009
234 st->codec->codec_id = ff_codec_get_id(nut_tags, st->codec->codec_tag);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
235
236 switch(s[i].type) {
237 case NUT_AUDIO_CLASS:
72415b2 Define AVMediaType enum, and use it instead of enum CodecType, which
Stefano Sabatini authored Mar 30, 2010
238 st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
1a40491 @danielverkamp Add ff_ prefixes to exported symbols in libavformat/riff.h.
danielverkamp authored Jun 22, 2009
239 if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, st->codec->codec_tag);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
240
241 st->codec->channels = s[i].channel_count;
d7d3efa sync to libnut, nom->num
Oded Shimon authored Dec 23, 2006
242 st->codec->sample_rate = s[i].samplerate_num / s[i].samplerate_denom;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
243 break;
244 case NUT_VIDEO_CLASS:
72415b2 Define AVMediaType enum, and use it instead of enum CodecType, which
Stefano Sabatini authored Mar 30, 2010
245 st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
1a40491 @danielverkamp Add ff_ prefixes to exported symbols in libavformat/riff.h.
danielverkamp authored Jun 22, 2009
246 if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, st->codec->codec_tag);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
247
248 st->codec->width = s[i].width;
249 st->codec->height = s[i].height;
5972945 @aurelj convert every muxer/demuxer to write/read sample_aspect_ratio from/to
aurelj authored Aug 23, 2008
250 st->sample_aspect_ratio.num = s[i].sample_width;
251 st->sample_aspect_ratio.den = s[i].sample_height;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
252 break;
253 }
254 if (st->codec->codec_id == CODEC_ID_NONE) av_log(avf, AV_LOG_ERROR, "Unknown codec?!\n");
255 }
256
257 return 0;
258 }
259
260 static int nut_read_packet(AVFormatContext * avf, AVPacket * pkt) {
261 NUTContext * priv = avf->priv_data;
bffc76b Update lavf/libnut.c to _tt type names in libnut API
Oded Shimon authored Dec 12, 2008
262 nut_packet_tt pd;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
263 int ret;
264
e4bb708 Update to libnut API, non-negative errors
Oded Shimon authored Nov 16, 2006
265 ret = nut_read_next_packet(priv->nut, &pd);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
266
e4bb708 Update to libnut API, non-negative errors
Oded Shimon authored Nov 16, 2006
267 if (ret || av_new_packet(pkt, pd.len) < 0) {
268 if (ret != NUT_ERR_EOF)
269 av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret));
270 return -1;
271 }
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
272
cc947f0 Replace all occurences of PKT_FLAG_KEY with AV_PKT_FLAG_KEY.
Jean-Daniel Dupas authored Mar 31, 2010
273 if (pd.flags & NUT_FLAG_KEY) pkt->flags |= AV_PKT_FLAG_KEY;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
274 pkt->pts = pd.pts;
275 pkt->stream_index = pd.stream;
a2704c9 @elenril avio: add avio_tell macro as a replacement for url_ftell
elenril authored Mar 3, 2011
276 pkt->pos = avio_tell(avf->pb);
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
277
278 ret = nut_read_frame(priv->nut, &pd.len, pkt->data);
279
280 return ret;
281 }
282
283 static int nut_read_seek(AVFormatContext * avf, int stream_index, int64_t target_ts, int flags) {
284 NUTContext * priv = avf->priv_data;
285 int active_streams[] = { stream_index, -1 };
d7d3efa sync to libnut, nom->num
Oded Shimon authored Dec 23, 2006
286 double time_pos = target_ts * priv->s[stream_index].time_base.num / (double)priv->s[stream_index].time_base.den;
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
287
288 if (nut_seek(priv->nut, time_pos, 2*!(flags & AVSEEK_FLAG_BACKWARD), active_streams)) return -1;
289
290 return 0;
291 }
292
293 static int nut_read_close(AVFormatContext *s) {
294 NUTContext * priv = s->priv_data;
295
296 nut_demuxer_uninit(priv->nut);
297
298 return 0;
299 }
300
c6610a2 @Flameeyes Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
Flameeyes authored Jan 25, 2011
301 AVInputFormat ff_libnut_demuxer = {
dfc2c4d @elenril lavf: use designated initialisers for all (de)muxers.
elenril authored Jul 16, 2011
302 .name = "libnut",
303 .long_name = NULL_IF_CONFIG_SMALL("NUT format"),
304 .priv_data_size = sizeof(NUTContext),
305 .read_probe = nut_probe,
306 .read_header = nut_read_header,
307 .read_packet = nut_read_packet,
308 .read_close = nut_read_close,
309 .read_seek = nut_read_seek,
20234a4 @mstorsjo cosmetics: Align muxer/demuxer declarations
mstorsjo authored Apr 6, 2012
310 .extensions = "nut",
f956e12 Add libnut support until ffmpeg gets an independant and complete de/m…
Oded Shimon authored Nov 12, 2006
311 };
Something went wrong with that request. Please try again.