FFmpeg
nut.c
Go to the documentation of this file.
1 /*
2  * nut
3  * Copyright (c) 2004-2007 Michael Niedermayer
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
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  *
12  * FFmpeg is distributed in the hope that it will be useful,
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
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/mathematics.h"
23 #include "libavutil/tree.h"
24 #include "nut.h"
25 #include "riff.h"
26 #include "internal.h"
27 
29  { AV_CODEC_ID_TEXT, MKTAG('U', 'T', 'F', '8') },
30  { AV_CODEC_ID_DVD_SUBTITLE, MKTAG('D', 'V', 'D', 'S') },
31  { AV_CODEC_ID_DVB_SUBTITLE, MKTAG('D', 'V', 'B', 'S') },
32  { AV_CODEC_ID_DVB_TELETEXT, MKTAG('D', 'V', 'B', 'T') },
33  { AV_CODEC_ID_NONE, 0 }
34 };
35 
37  { AV_CODEC_ID_TEXT, MKTAG('U', 'T', 'F', '8') },
38  { AV_CODEC_ID_NONE, 0 }
39 };
40 
42  { AV_CODEC_ID_GIF, MKTAG('G', 'I', 'F', 0 ) },
43  { AV_CODEC_ID_XFACE, MKTAG('X', 'F', 'A', 'C') },
44  { AV_CODEC_ID_VP9, MKTAG('V', 'P', '9', '0') },
45  { AV_CODEC_ID_HEVC, MKTAG('H', 'E', 'V', 'C') },
46  { AV_CODEC_ID_CPIA, MKTAG('C', 'P', 'i', 'A') },
47  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 15 ) },
48  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 15 ) },
49  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 16 ) },
50  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 16 ) },
51  { AV_CODEC_ID_RAWVIDEO, MKTAG(15 , 'B', 'G', 'R') },
52  { AV_CODEC_ID_RAWVIDEO, MKTAG(15 , 'R', 'G', 'B') },
53  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'B', 'G', 'R') },
54  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'R', 'G', 'B') },
55  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 12 ) },
56  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 12 ) },
57  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 'B', 'G', 'R') },
58  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 'R', 'G', 'B') },
59  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 'A') },
60  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 0 ) },
61  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 'A') },
62  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 0 ) },
63  { AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'B', 'G', 'R') },
64  { AV_CODEC_ID_RAWVIDEO, MKTAG( 0 , 'B', 'G', 'R') },
65  { AV_CODEC_ID_RAWVIDEO, MKTAG('A', 'R', 'G', 'B') },
66  { AV_CODEC_ID_RAWVIDEO, MKTAG( 0 , 'R', 'G', 'B') },
67  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 24 ) },
68  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 24 ) },
69  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '1', '1', 'P') },
70  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '2', '2', 'P') },
71  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '2', '2', 'P') },
72  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '0', 'P') },
73  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '0', 'P') },
74  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '4', 'P') },
75  { AV_CODEC_ID_RAWVIDEO, MKTAG('4', '4', '4', 'P') },
76  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', '1', 'W', '0') },
77  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', '0', 'W', '1') },
78  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 8 ) },
79  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 8 ) },
80  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 4 ) },
81  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 4 ) },
82  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', '4', 'B', 'Y') },
83  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', '4', 'B', 'Y') },
84  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'G', 'R', 48 ) },
85  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'G', 'B', 48 ) },
86  { AV_CODEC_ID_RAWVIDEO, MKTAG(48 , 'B', 'G', 'R') },
87  { AV_CODEC_ID_RAWVIDEO, MKTAG(48 , 'R', 'G', 'B') },
88  { AV_CODEC_ID_RAWVIDEO, MKTAG('R', 'B', 'A', 64 ) },
89  { AV_CODEC_ID_RAWVIDEO, MKTAG('B', 'R', 'A', 64 ) },
90  { AV_CODEC_ID_RAWVIDEO, MKTAG(64 , 'R', 'B', 'A') },
91  { AV_CODEC_ID_RAWVIDEO, MKTAG(64 , 'B', 'R', 'A') },
92  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 9 ) },
93  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 11 , '3', 'Y') },
94  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 9 ) },
95  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 10 , '3', 'Y') },
96  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 9 ) },
97  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9 , 0 , '3', 'Y') },
98  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 10 ) },
99  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 11 , '3', 'Y') },
100  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 10 ) },
101  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 10 , '3', 'Y') },
102  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 10 ) },
103  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 0 , '3', 'Y') },
104  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 12 ) },
105  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 11 , '3', 'Y') },
106  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 12 ) },
107  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 10 , '3', 'Y') },
108  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 12 ) },
109  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 0 , '3', 'Y') },
110  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 14 ) },
111  { AV_CODEC_ID_RAWVIDEO, MKTAG(14 , 11 , '3', 'Y') },
112  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 14 ) },
113  { AV_CODEC_ID_RAWVIDEO, MKTAG(14 , 10 , '3', 'Y') },
114  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 14 ) },
115  { AV_CODEC_ID_RAWVIDEO, MKTAG(14 , 0 , '3', 'Y') },
116  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0 , 16 ) },
117  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '1', 'Y') },
118  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 11 , 16 ) },
119  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 11 , '3', 'Y') },
120  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 10 , 16 ) },
121  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 10 , '3', 'Y') },
122  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '3', 0 , 16 ) },
123  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 0 , '3', 'Y') },
124  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11 , 8 ) },
125  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10 , 8 ) },
126  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0 , 8 ) },
127  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '2', 0 , 8 ) },
128 
129  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 9) },
130  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 0, '1', 'Y') },
131  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11, 9) },
132  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 11, '4', 'Y') },
133  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10, 9) },
134  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 10, '4', 'Y') },
135  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0, 9) },
136  { AV_CODEC_ID_RAWVIDEO, MKTAG(9, 0, '4', 'Y') },
137 
138  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 10) },
139  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 0, '1', 'Y') },
140  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11, 10) },
141  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 11, '4', 'Y') },
142  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10, 10) },
143  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 10, '4', 'Y') },
144  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0, 10) },
145  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 0, '4', 'Y') },
146 
147  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0, 12) },
148  { AV_CODEC_ID_RAWVIDEO, MKTAG(12, 0, '4', 'Y') },
149  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10, 12) },
150  { AV_CODEC_ID_RAWVIDEO, MKTAG(12, 10, '4', 'Y') },
151 
152  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 12) },
153  { AV_CODEC_ID_RAWVIDEO, MKTAG(12, 0, '1', 'Y') },
154  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 16) },
155  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 0, '1', 'Y') },
156  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 11, 16) },
157  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 11, '4', 'Y') },
158  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 10, 16) },
159  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 10, '4', 'Y') },
160  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '4', 0, 16) },
161  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 0, '4', 'Y') },
162 
163  { AV_CODEC_ID_RAWVIDEO, MKTAG('Y', '1', 0, 14) },
164  { AV_CODEC_ID_RAWVIDEO, MKTAG(14, 0, '1', 'Y') },
165 
166  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 8) },
167 
168  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 9) },
169  { AV_CODEC_ID_RAWVIDEO, MKTAG( 9, 0, '3', 'G') },
170  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 10) },
171  { AV_CODEC_ID_RAWVIDEO, MKTAG(10, 0, '3', 'G') },
172  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 12) },
173  { AV_CODEC_ID_RAWVIDEO, MKTAG(12, 0, '3', 'G') },
174  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 14) },
175  { AV_CODEC_ID_RAWVIDEO, MKTAG(14, 0, '3', 'G') },
176  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '3', 0, 16) },
177  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 0, '3', 'G') },
178 
179  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 0, 8) },
180 
181  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 10 ) },
182  { AV_CODEC_ID_RAWVIDEO, MKTAG(10 , 00 , '4', 'G') },
183  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 12 ) },
184  { AV_CODEC_ID_RAWVIDEO, MKTAG(12 , 00 , '4', 'G') },
185  { AV_CODEC_ID_RAWVIDEO, MKTAG('G', '4', 00 , 16 ) },
186  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 00 , '4', 'G') },
187 
188  { AV_CODEC_ID_RAWVIDEO, MKTAG('X', 'Y', 'Z' , 36 ) },
189  { AV_CODEC_ID_RAWVIDEO, MKTAG(36 , 'Z' , 'Y', 'X') },
190 
191  { AV_CODEC_ID_RAWVIDEO, MKTAG('P', 'A', 'L', 8 ) },
192 
193  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'B', 'G', 8 ) },
194  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'B', 'G', 16 ) },
195  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'G', 'B', 0xBA) },
196  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'R', 'G', 8 ) },
197  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'R', 'G', 16 ) },
198  { AV_CODEC_ID_RAWVIDEO, MKTAG(16 , 'G', 'R', 0xBA) },
199  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'B', 8 ) },
200  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'B', 16 ) },
201  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 'B', 'G', 0xBA) },
202  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'R', 8 ) },
203  { AV_CODEC_ID_RAWVIDEO, MKTAG(0xBA, 'G', 'R', 16 ) },
204  { AV_CODEC_ID_RAWVIDEO, MKTAG(16, 'R', 'G', 0xBA) },
205 
206  { AV_CODEC_ID_NONE, 0 }
207 };
208 
210  { AV_CODEC_ID_COMFORT_NOISE, MKTAG('3', '3', '8', '9') },
211  { AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') },
212  { AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') },
213  { AV_CODEC_ID_MP3, MKTAG('M', 'P', '3', ' ') },
214  { AV_CODEC_ID_OPUS, MKTAG('O', 'p', 'u', 's') },
215  { AV_CODEC_ID_WAVPACK, MKTAG('w', 'v', 'p', 'k') },
216  { AV_CODEC_ID_NONE, 0 }
217 };
218 
220  { AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') },
221  { AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) },
222  { AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') },
223  { AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) },
224  { AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') },
225  { AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) },
226  { AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') },
227  { AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) },
228  { AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') },
229  { AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) },
230  { AV_CODEC_ID_PCM_S64BE, MKTAG(64 , 'D', 'S', 'P') },
231  { AV_CODEC_ID_PCM_S64LE, MKTAG('P', 'S', 'D', 64 ) },
232  { AV_CODEC_ID_PCM_S8, MKTAG('P', 'S', 'D', 8 ) },
233  { AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') },
234  { AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) },
235  { AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') },
236  { AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) },
237  { AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') },
238  { AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) },
239  { AV_CODEC_ID_PCM_U8, MKTAG('P', 'U', 'D', 8 ) },
240  { AV_CODEC_ID_PCM_S8_PLANAR, MKTAG('P', 'S', 'P', 8 ) },
241  { AV_CODEC_ID_PCM_S16BE_PLANAR, MKTAG(16 , 'P', 'S', 'P') },
242  { AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) },
243  { AV_CODEC_ID_PCM_S24LE_PLANAR, MKTAG('P', 'S', 'P', 24 ) },
244  { AV_CODEC_ID_PCM_S32LE_PLANAR, MKTAG('P', 'S', 'P', 32 ) },
245  { AV_CODEC_ID_NONE, 0 }
246 };
247 
248 const AVCodecTag * const ff_nut_codec_tags[] = {
251 };
252 
253 void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val)
254 {
255  int i;
256  for (i = 0; i < nut->avf->nb_streams; i++)
257  nut->stream[i].last_pts =
259  time_base.num * (int64_t)nut->stream[i].time_base->den,
260  time_base.den * (int64_t)nut->stream[i].time_base->num,
261  AV_ROUND_DOWN);
262 }
263 
264 int64_t ff_lsb2full(StreamContext *stream, int64_t lsb)
265 {
266  int64_t mask = (1ULL << stream->msb_pts_shift) - 1;
267  int64_t delta = stream->last_pts - mask / 2;
268  return ((lsb - delta) & mask) + delta;
269 }
270 
271 int ff_nut_sp_pos_cmp(const void *a, const void *b)
272 {
273  const Syncpoint *va = a, *vb = b;
274  return ((va->pos - vb->pos) >> 32) - ((vb->pos - va->pos) >> 32);
275 }
276 
277 int ff_nut_sp_pts_cmp(const void *a, const void *b)
278 {
279  const Syncpoint *va = a, *vb = b;
280  return ((va->ts - vb->ts) >> 32) - ((vb->ts - va->ts) >> 32);
281 }
282 
283 int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts)
284 {
285  Syncpoint *sp = av_mallocz(sizeof(Syncpoint));
286  struct AVTreeNode *node = av_tree_node_alloc();
287 
288  if (!sp || !node) {
289  av_freep(&sp);
290  av_freep(&node);
291  return AVERROR(ENOMEM);
292  }
293 
294  nut->sp_count++;
295 
296  sp->pos = pos;
297  sp->back_ptr = back_ptr;
298  sp->ts = ts;
300  if (node) {
301  av_free(sp);
302  av_free(node);
303  }
304 
305  return 0;
306 }
307 
308 static int enu_free(void *opaque, void *elem)
309 {
310  av_free(elem);
311  return 0;
312 }
313 
315 {
316  if (nut->syncpoints) {
319  }
320 }
321 
323  { "default", AV_DISPOSITION_DEFAULT },
324  { "dub", AV_DISPOSITION_DUB },
325  { "original", AV_DISPOSITION_ORIGINAL },
326  { "comment", AV_DISPOSITION_COMMENT },
327  { "lyrics", AV_DISPOSITION_LYRICS },
328  { "karaoke", AV_DISPOSITION_KARAOKE },
329  { "", 0 }
330 };
331 
333  { "Author", "artist" },
334  { "X-CreationTime", "date" },
335  { "CreationTime", "date" },
336  { "SourceFilename", "filename" },
337  { "X-Language", "language" },
338  { "X-Disposition", "disposition" },
339  { "X-Replaces", "replaces" },
340  { "X-Depends", "depends" },
341  { "X-Uses", "uses" },
342  { "X-UsesFont", "usesfont" },
343  { 0 },
344 };
AV_CODEC_ID_PCM_S16LE
@ AV_CODEC_ID_PCM_S16LE
Definition: codec_id.h:301
AV_CODEC_ID_PCM_F32BE
@ AV_CODEC_ID_PCM_F32BE
Definition: codec_id.h:321
ff_nut_audio_extra_tags
const AVCodecTag ff_nut_audio_extra_tags[]
Definition: nut.c:209
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
MKTAG
#define MKTAG(a, b, c, d)
Definition: common.h:406
av_tree_insert
void * av_tree_insert(AVTreeNode **tp, void *key, int(*cmp)(const void *key, const void *b), AVTreeNode **next)
Insert or remove an element.
Definition: tree.c:59
ff_nut_data_tags
const AVCodecTag ff_nut_data_tags[]
Definition: nut.c:36
AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:62
AV_DISPOSITION_DEFAULT
#define AV_DISPOSITION_DEFAULT
Definition: avformat.h:810
AV_CODEC_ID_PCM_S32LE_PLANAR
@ AV_CODEC_ID_PCM_S32LE_PLANAR
Definition: codec_id.h:330
AVTreeNode::elem
void * elem
Definition: tree.c:28
AV_CODEC_ID_DVB_TELETEXT
@ AV_CODEC_ID_DVB_TELETEXT
Definition: codec_id.h:515
AV_CODEC_ID_PCM_S16BE_PLANAR
@ AV_CODEC_ID_PCM_S16BE_PLANAR
Definition: codec_id.h:331
ff_nut_dispositions
const Dispositions ff_nut_dispositions[]
Definition: nut.c:322
b
#define b
Definition: input.c:41
AV_CODEC_ID_PCM_U24LE
@ AV_CODEC_ID_PCM_U24LE
Definition: codec_id.h:315
AVMetadataConv
Definition: metadata.h:34
ff_codec_wav_tags
const AVCodecTag ff_codec_wav_tags[]
Definition: riff.c:506
mathematics.h
ff_nut_reset_ts
void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val)
Definition: nut.c:253
Syncpoint
Definition: nut.h:58
av_tree_node_alloc
struct AVTreeNode * av_tree_node_alloc(void)
Allocate an AVTreeNode.
Definition: tree.c:34
av_tree_enumerate
void av_tree_enumerate(AVTreeNode *t, void *opaque, int(*cmp)(void *opaque, void *elem), int(*enu)(void *opaque, void *elem))
Apply enu(opaque, &elem) to all the elements in the tree in a given range.
Definition: tree.c:155
AV_CODEC_ID_PCM_S16LE_PLANAR
@ AV_CODEC_ID_PCM_S16LE_PLANAR
Definition: codec_id.h:319
AV_CODEC_ID_PCM_S64LE
@ AV_CODEC_ID_PCM_S64LE
Definition: codec_id.h:333
ff_nut_sp_pos_cmp
int ff_nut_sp_pos_cmp(const void *a, const void *b)
Definition: nut.c:271
ff_nut_free_sp
void ff_nut_free_sp(NUTContext *nut)
Definition: nut.c:314
AV_CODEC_ID_PCM_S16BE
@ AV_CODEC_ID_PCM_S16BE
Definition: codec_id.h:302
NUTContext::avf
AVFormatContext * avf
Definition: nut.h:93
val
static double val(void *priv, double ch)
Definition: aeval.c:76
AV_CODEC_ID_MP3
@ AV_CODEC_ID_MP3
preferred ID for decoding MPEG audio layer 1, 2 or 3
Definition: codec_id.h:411
Syncpoint::ts
int64_t ts
Definition: nut.h:62
AVRational::num
int num
Numerator.
Definition: rational.h:59
AV_CODEC_ID_DVB_SUBTITLE
@ AV_CODEC_ID_DVB_SUBTITLE
Definition: codec_id.h:509
NUTContext::sp_count
int sp_count
Definition: nut.h:109
AV_CODEC_ID_PCM_S8
@ AV_CODEC_ID_PCM_S8
Definition: codec_id.h:305
NUTContext
Definition: nut.h:91
AVCodecTag
Definition: internal.h:42
AV_CODEC_ID_XFACE
@ AV_CODEC_ID_XFACE
Definition: codec_id.h:256
mask
static const uint16_t mask[17]
Definition: lzw.c:38
ff_nut_metadata_conv
const AVMetadataConv ff_nut_metadata_conv[]
Definition: nut.c:332
nut.h
AV_CODEC_ID_VP9
@ AV_CODEC_ID_VP9
Definition: codec_id.h:217
StreamContext::last_pts
int64_t last_pts
Definition: nut.h:78
AV_CODEC_ID_PCM_MULAW
@ AV_CODEC_ID_PCM_MULAW
Definition: codec_id.h:307
AV_CODEC_ID_PCM_U16BE
@ AV_CODEC_ID_PCM_U16BE
Definition: codec_id.h:304
AV_CODEC_ID_PCM_ALAW
@ AV_CODEC_ID_PCM_ALAW
Definition: codec_id.h:308
internal.h
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_ID_PCM_U24BE
@ AV_CODEC_ID_PCM_U24BE
Definition: codec_id.h:316
ff_nut_sp_pts_cmp
int ff_nut_sp_pts_cmp(const void *a, const void *b)
Definition: nut.c:277
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AV_CODEC_ID_PCM_U32BE
@ AV_CODEC_ID_PCM_U32BE
Definition: codec_id.h:312
AV_DISPOSITION_COMMENT
#define AV_DISPOSITION_COMMENT
Definition: avformat.h:813
AV_CODEC_ID_DVD_SUBTITLE
@ AV_CODEC_ID_DVD_SUBTITLE
Definition: codec_id.h:508
AV_CODEC_ID_CPIA
@ AV_CODEC_ID_CPIA
Definition: codec_id.h:255
AV_CODEC_ID_PCM_S64BE
@ AV_CODEC_ID_PCM_S64BE
Definition: codec_id.h:334
AVTreeNode
Definition: tree.c:26
ff_nut_video_tags
const AVCodecTag ff_nut_video_tags[]
Definition: nut.c:41
AV_DISPOSITION_ORIGINAL
#define AV_DISPOSITION_ORIGINAL
Definition: avformat.h:812
av_tree_destroy
void av_tree_destroy(AVTreeNode *t)
Definition: tree.c:146
AV_CODEC_ID_PCM_S24LE_PLANAR
@ AV_CODEC_ID_PCM_S24LE_PLANAR
Definition: codec_id.h:329
AVFormatContext::nb_streams
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
Definition: avformat.h:1391
StreamContext
Definition: transcoding.c:47
av_rescale_rnd
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
Definition: mathematics.c:58
AV_CODEC_ID_PCM_S24LE
@ AV_CODEC_ID_PCM_S24LE
Definition: codec_id.h:313
sp
#define sp
Definition: regdef.h:63
ff_nut_audio_tags
const AVCodecTag ff_nut_audio_tags[]
Definition: nut.c:219
NUTContext::stream
StreamContext * stream
Definition: nut.h:100
AV_CODEC_ID_OPUS
@ AV_CODEC_ID_OPUS
Definition: codec_id.h:470
AV_DISPOSITION_DUB
#define AV_DISPOSITION_DUB
Definition: avformat.h:811
tree.h
AV_CODEC_ID_COMFORT_NOISE
@ AV_CODEC_ID_COMFORT_NOISE
Definition: codec_id.h:471
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
StreamContext::msb_pts_shift
int msb_pts_shift
Definition: nut.h:81
AV_CODEC_ID_GIF
@ AV_CODEC_ID_GIF
Definition: codec_id.h:146
ff_nut_add_sp
int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts)
Definition: nut.c:283
NUTContext::syncpoints
struct AVTreeNode * syncpoints
Definition: nut.h:108
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:47
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
ff_lsb2full
int64_t ff_lsb2full(StreamContext *stream, int64_t lsb)
Definition: nut.c:264
enu_free
static int enu_free(void *opaque, void *elem)
Definition: nut.c:308
delta
float delta
Definition: vorbis_enc_data.h:457
AV_ROUND_DOWN
@ AV_ROUND_DOWN
Round toward -infinity.
Definition: mathematics.h:82
AV_CODEC_ID_PCM_F64BE
@ AV_CODEC_ID_PCM_F64BE
Definition: codec_id.h:323
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:223
AV_DISPOSITION_KARAOKE
#define AV_DISPOSITION_KARAOKE
Definition: avformat.h:815
AV_CODEC_ID_PCM_S32BE
@ AV_CODEC_ID_PCM_S32BE
Definition: codec_id.h:310
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:237
Dispositions
Definition: nut.h:128
Syncpoint::pos
uint64_t pos
Definition: nut.h:59
pos
unsigned int pos
Definition: spdifenc.c:412
AV_CODEC_ID_TEXT
@ AV_CODEC_ID_TEXT
raw UTF-8 text
Definition: codec_id.h:510
ff_codec_bmp_tags
const AVCodecTag ff_codec_bmp_tags[]
Definition: riff.c:32
ff_nut_codec_tags
const AVCodecTag *const ff_nut_codec_tags[]
Definition: nut.c:248
AVRational::den
int den
Denominator.
Definition: rational.h:60
AV_CODEC_ID_PCM_U32LE
@ AV_CODEC_ID_PCM_U32LE
Definition: codec_id.h:311
AV_CODEC_ID_PCM_S32LE
@ AV_CODEC_ID_PCM_S32LE
Definition: codec_id.h:309
AV_CODEC_ID_PCM_U8
@ AV_CODEC_ID_PCM_U8
Definition: codec_id.h:306
ff_nut_subtitle_tags
const AVCodecTag ff_nut_subtitle_tags[]
Definition: nut.c:28
AV_CODEC_ID_PCM_F64LE
@ AV_CODEC_ID_PCM_F64LE
Definition: codec_id.h:324
av_free
#define av_free(p)
Definition: tableprint_vlc.h:34
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
riff.h
AV_CODEC_ID_PCM_S8_PLANAR
@ AV_CODEC_ID_PCM_S8_PLANAR
Definition: codec_id.h:328
AV_CODEC_ID_PCM_U16LE
@ AV_CODEC_ID_PCM_U16LE
Definition: codec_id.h:303
AV_CODEC_ID_PCM_F32LE
@ AV_CODEC_ID_PCM_F32LE
Definition: codec_id.h:322
AV_CODEC_ID_WAVPACK
@ AV_CODEC_ID_WAVPACK
Definition: codec_id.h:435
StreamContext::time_base
AVRational time_base
Definition: signature.h:103
AV_CODEC_ID_PCM_S24BE
@ AV_CODEC_ID_PCM_S24BE
Definition: codec_id.h:314
AV_DISPOSITION_LYRICS
#define AV_DISPOSITION_LYRICS
Definition: avformat.h:814