annotate libnut.c @ 1523:d69f57e86c48 libavformat

update to libnut API, changes to frame_table_input
author ods15
date Fri, 17 Nov 2006 14:43:14 +0000
parents 7d1a53de280a
children bffedde11b4f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1482
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
1 #include "avformat.h"
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
2 #include "riff.h"
1499
88c11d433ffb update to libnut API, rename nut.h->libnut.h
ods15
parents: 1487
diff changeset
3 #include <libnut.h>
1482
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
4
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
5 #define ID_STRING "nut/multimedia container"
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
6 #define ID_LENGTH (strlen(ID_STRING) + 1)
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
7
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
8 typedef struct {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
9 nut_context_t * nut;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
10 nut_stream_header_t * s;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
11 } NUTContext;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
12
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
13 static const CodecTag nut_tags[] = {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
14 { CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 's') },
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
15 { CODEC_ID_MP3, MKTAG('m', 'p', '3', ' ') },
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
16 { CODEC_ID_VORBIS, MKTAG('v', 'r', 'b', 's') },
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
17 { 0, 0 },
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
18 };
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
19
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
20 #ifdef CONFIG_MUXERS
1523
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
21 nut_frame_table_input_t ft_default[] = {
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
22 // There must be atleast this safety net:
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
23 //{ 4128, 0, 0, 1, 0, 1 },
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
24 //{ flag, pts, stream, mul, size, count }
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
25 { 8192, 0, 0, 1, 0, 1 }, // invalid 0x00
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
26 { 56, 0, 0, 1, 0, 1 }, // safety net non key frame
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
27 { 57, 0, 0, 1, 0, 1 }, // safety net key frame
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
28 { 4128, 0, 0, 1, 0, 1 }, // one more safety net
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
29 { 27, 0, 0, 1, 0, 1 }, // EOR frame
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
30 { 1, 1, 1, 337, 336, 1 }, // used 82427 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
31 { 1, 1, 1, 385, 384, 1 }, // used 56044 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
32 { 0, 2, 0, 7, 6, 1 }, // used 20993 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
33 { 0, 1, 0, 7, 6, 1 }, // used 10398 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
34 { 1, 1, 1, 481, 480, 1 }, // used 3527 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
35 { 1, 1, 1, 289, 288, 1 }, // used 2042 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
36 { 1, 1, 1, 577, 576, 1 }, // used 1480 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
37 { 1, 1, 1, 673, 672, 1 }, // used 862 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
38 { 1, 1, 1, 769, 768, 1 }, // used 433 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
39 { 1, 1, 1, 961, 960, 1 }, // used 191 times
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
40 { 32, 2, 0, 101, 0, 101 }, // "1.2.0" => 14187
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
41 { 32, -1, 0, 40, 0, 40 }, // "1.-1.0" => 5707
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
42 { 32, 1, 0, 81, 0, 81 }, // "1.1.0" => 11159
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
43 { 33, 1, 0, 11, 0, 11 }, // "1.1.1" => 1409
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
44 { 105, 0, 0, 6, 0, 6 }, // checksum for video
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
45 { 8192, 0, 0, 1, 0, 1 }, // invalid 0xFF
d69f57e86c48 update to libnut API, changes to frame_table_input
ods15
parents: 1513
diff changeset
46 { -1, 0, 0, 0, 0, 0 }, // end
1482
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
47 };
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
48
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
49 static int av_write(void * h, size_t len, const uint8_t * buf) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
50 ByteIOContext * bc = h;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
51 put_buffer(bc, buf, len);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
52 //put_flush_packet(bc);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
53 return len;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
54 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
55
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
56 static int nut_write_header(AVFormatContext * avf) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
57 NUTContext * priv = avf->priv_data;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
58 ByteIOContext * bc = &avf->pb;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
59 nut_muxer_opts_t mopts = {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
60 .output = {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
61 .priv = bc,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
62 .write = av_write,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
63 },
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
64 .alloc = { av_malloc, av_realloc, av_free },
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
65 .write_index = 1,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
66 .realtime_stream = 0,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
67 .max_distance = 32768,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
68 .fti = ft_default
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
69 };
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
70 nut_stream_header_t * s;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
71 int i;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
72
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
73 priv->s = s = av_mallocz((avf->nb_streams + 1) * sizeof*s);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
74
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
75 for (i = 0; i < avf->nb_streams; i++) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
76 AVCodecContext * codec = avf->streams[i]->codec;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
77 int j;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
78 int fourcc = 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
79 int nom, denom, ssize;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
80
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
81 s[i].type = codec->codec_type == CODEC_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
82
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
83 if (codec->codec_tag) fourcc = codec->codec_tag;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
84 else fourcc = codec_get_tag(nut_tags, codec->codec_id);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
85
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
86 if (!fourcc) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
87 if (codec->codec_type == CODEC_TYPE_VIDEO) fourcc = codec_get_bmp_tag(codec->codec_id);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
88 if (codec->codec_type == CODEC_TYPE_AUDIO) fourcc = codec_get_wav_tag(codec->codec_id);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
89 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
90
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
91 s[i].fourcc_len = 4;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
92 s[i].fourcc = av_malloc(s[i].fourcc_len);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
93 for (j = 0; j < s[i].fourcc_len; j++) s[i].fourcc[j] = (fourcc >> (j*8)) & 0xFF;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
94
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
95 ff_parse_specific_params(codec, &nom, &ssize, &denom);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
96 av_set_pts_info(avf->streams[i], 60, denom, nom);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
97
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
98 s[i].time_base.nom = denom;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
99 s[i].time_base.den = nom;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
100
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
101 s[i].fixed_fps = 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
102 s[i].decode_delay = codec->has_b_frames;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
103 s[i].codec_specific_len = codec->extradata_size;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
104 s[i].codec_specific = codec->extradata;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
105
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
106 if (codec->codec_type == CODEC_TYPE_VIDEO) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
107 s[i].width = codec->width;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
108 s[i].height = codec->height;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
109 s[i].sample_width = 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
110 s[i].sample_height = 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
111 s[i].colorspace_type = 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
112 } else {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
113 s[i].samplerate_nom = codec->sample_rate;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
114 s[i].samplerate_denom = 1;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
115 s[i].channel_count = codec->channels;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
116 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
117 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
118
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
119 s[avf->nb_streams].type = -1;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
120 priv->nut = nut_muxer_init(&mopts, s, NULL);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
121
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
122 return 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
123 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
124
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
125 static int nut_write_packet(AVFormatContext * avf, AVPacket * pkt) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
126 NUTContext * priv = avf->priv_data;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
127 nut_packet_t p;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
128
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
129 p.len = pkt->size;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
130 p.stream = pkt->stream_index;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
131 p.pts = pkt->pts;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
132 p.flags = pkt->flags & PKT_FLAG_KEY ? NUT_FLAG_KEY : 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
133 p.next_pts = 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
134
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
135 nut_write_frame_reorder(priv->nut, &p, pkt->data);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
136
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
137 return 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
138 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
139
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
140 static int nut_write_trailer(AVFormatContext * avf) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
141 ByteIOContext * bc = &avf->pb;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
142 NUTContext * priv = avf->priv_data;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
143 int i;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
144
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
145 nut_muxer_uninit_reorder(priv->nut);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
146 put_flush_packet(bc);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
147
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
148 for(i = 0; priv->s[i].type != -1; i++ ) av_freep(&priv->s[i].fourcc);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
149 av_freep(&priv->s);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
150
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
151 return 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
152 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
153
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
154 AVOutputFormat nut_muxer = {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
155 "nut",
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
156 "nut format",
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
157 "video/x-nut",
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
158 "nut",
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
159 sizeof(NUTContext),
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
160 CODEC_ID_VORBIS,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
161 CODEC_ID_MPEG4,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
162 nut_write_header,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
163 nut_write_packet,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
164 nut_write_trailer,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
165 .flags = AVFMT_GLOBALHEADER,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
166 };
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
167 #endif //CONFIG_MUXERS
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
168
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
169 static int nut_probe(AVProbeData *p) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
170 if (p->buf_size >= ID_LENGTH && !memcmp(p->buf, ID_STRING, ID_LENGTH)) return AVPROBE_SCORE_MAX;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
171
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
172 return 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
173 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
174
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
175 static size_t av_read(void * h, size_t len, uint8_t * buf) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
176 ByteIOContext * bc = h;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
177 return get_buffer(bc, buf, len);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
178 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
179
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
180 static off_t av_seek(void * h, long long pos, int whence) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
181 ByteIOContext * bc = h;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
182 if (whence == SEEK_END) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
183 pos = url_fsize(bc) + pos;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
184 whence = SEEK_SET;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
185 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
186 return url_fseek(bc, pos, whence);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
187 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
188
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
189 static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
190 NUTContext * priv = avf->priv_data;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
191 ByteIOContext * bc = &avf->pb;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
192 nut_demuxer_opts_t dopts = {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
193 .input = {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
194 .priv = bc,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
195 .seek = av_seek,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
196 .read = av_read,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
197 .eof = NULL,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
198 .file_pos = 0,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
199 },
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
200 .alloc = { av_malloc, av_realloc, av_free },
1505
5b225077f098 update to libnut, add cache_syncpoints
ods15
parents: 1499
diff changeset
201 .read_index = 1,
5b225077f098 update to libnut, add cache_syncpoints
ods15
parents: 1499
diff changeset
202 .cache_syncpoints = 1,
1482
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
203 };
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
204 nut_context_t * nut = priv->nut = nut_demuxer_init(&dopts);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
205 nut_stream_header_t * s;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
206 int ret, i;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
207
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
208 if ((ret = nut_read_headers(nut, &s, NULL))) {
1513
7d1a53de280a Update to libnut API, non-negative errors
ods15
parents: 1512
diff changeset
209 av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret));
1482
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
210 nut_demuxer_uninit(nut);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
211 return -1;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
212 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
213
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
214 priv->s = s;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
215
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
216 for (i = 0; s[i].type != -1 && i < 2; i++) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
217 AVStream * st = av_new_stream(avf, i);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
218 int j;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
219
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
220 for (j = 0; j < s[i].fourcc_len && j < 8; j++) st->codec->codec_tag |= s[i].fourcc[j]<<(j*8);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
221
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
222 st->codec->has_b_frames = s[i].decode_delay;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
223
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
224 st->codec->extradata_size = s[i].codec_specific_len;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
225 if (st->codec->extradata_size) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
226 st->codec->extradata = av_mallocz(st->codec->extradata_size);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
227 memcpy(st->codec->extradata, s[i].codec_specific, st->codec->extradata_size);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
228 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
229
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
230 av_set_pts_info(avf->streams[i], 60, s[i].time_base.nom, s[i].time_base.den);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
231 st->start_time = 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
232 st->duration = s[i].max_pts;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
233
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
234 st->codec->codec_id = codec_get_id(nut_tags, st->codec->codec_tag);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
235
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
236 switch(s[i].type) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
237 case NUT_AUDIO_CLASS:
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
238 st->codec->codec_type = CODEC_TYPE_AUDIO;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
239 if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_wav_id(st->codec->codec_tag);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
240
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
241 st->codec->channels = s[i].channel_count;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
242 st->codec->sample_rate = s[i].samplerate_nom / s[i].samplerate_denom;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
243 break;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
244 case NUT_VIDEO_CLASS:
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
245 st->codec->codec_type = CODEC_TYPE_VIDEO;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
246 if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = codec_get_bmp_id(st->codec->codec_tag);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
247
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
248 st->codec->width = s[i].width;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
249 st->codec->height = s[i].height;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
250 st->codec->sample_aspect_ratio.num = s[i].sample_width;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
251 st->codec->sample_aspect_ratio.den = s[i].sample_height;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
252 break;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
253 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
254 if (st->codec->codec_id == CODEC_ID_NONE) av_log(avf, AV_LOG_ERROR, "Unknown codec?!\n");
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
255 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
256
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
257 return 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
258 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
259
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
260 static int nut_read_packet(AVFormatContext * avf, AVPacket * pkt) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
261 NUTContext * priv = avf->priv_data;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
262 nut_packet_t pd;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
263 int ret;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
264
1513
7d1a53de280a Update to libnut API, non-negative errors
ods15
parents: 1512
diff changeset
265 ret = nut_read_next_packet(priv->nut, &pd);
1482
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
266
1513
7d1a53de280a Update to libnut API, non-negative errors
ods15
parents: 1512
diff changeset
267 if (ret || av_new_packet(pkt, pd.len) < 0) {
7d1a53de280a Update to libnut API, non-negative errors
ods15
parents: 1512
diff changeset
268 if (ret != NUT_ERR_EOF)
7d1a53de280a Update to libnut API, non-negative errors
ods15
parents: 1512
diff changeset
269 av_log(avf, AV_LOG_ERROR, " NUT error: %s\n", nut_error(ret));
7d1a53de280a Update to libnut API, non-negative errors
ods15
parents: 1512
diff changeset
270 return -1;
7d1a53de280a Update to libnut API, non-negative errors
ods15
parents: 1512
diff changeset
271 }
1482
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
272
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
273 if (pd.flags & NUT_FLAG_KEY) pkt->flags |= PKT_FLAG_KEY;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
274 pkt->pts = pd.pts;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
275 pkt->stream_index = pd.stream;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
276 pkt->pos = url_ftell(&avf->pb);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
277
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
278 ret = nut_read_frame(priv->nut, &pd.len, pkt->data);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
279
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
280 return ret;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
281 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
282
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
283 static int nut_read_seek(AVFormatContext * avf, int stream_index, int64_t target_ts, int flags) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
284 NUTContext * priv = avf->priv_data;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
285 int active_streams[] = { stream_index, -1 };
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
286 double time_pos = target_ts * priv->s[stream_index].time_base.nom / (double)priv->s[stream_index].time_base.den;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
287
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
288 if (nut_seek(priv->nut, time_pos, 2*!(flags & AVSEEK_FLAG_BACKWARD), active_streams)) return -1;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
289
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
290 return 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
291 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
292
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
293 static int nut_read_close(AVFormatContext *s) {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
294 NUTContext * priv = s->priv_data;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
295
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
296 nut_demuxer_uninit(priv->nut);
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
297
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
298 return 0;
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
299 }
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
300
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
301 AVInputFormat nut_demuxer = {
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
302 "nut",
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
303 "nut format",
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
304 sizeof(NUTContext),
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
305 nut_probe,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
306 nut_read_header,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
307 nut_read_packet,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
308 nut_read_close,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
309 nut_read_seek,
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
310 .extensions = "nut",
617beb4c6247 Add libnut support until ffmpeg gets an independant and complete de/muxer for NUT
ods15
parents:
diff changeset
311 };