FFmpeg
mov_chan.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Justin Ruggles
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * mov 'chan' tag reading/writing.
23  * @author Justin Ruggles
24  */
25 
26 #include <stdint.h>
27 
29 #include "libavcodec/avcodec.h"
30 #include "mov_chan.h"
31 
32 /**
33  * Channel Layout Tag
34  * This tells which channels are present in the audio stream and the order in
35  * which they appear.
36  *
37  * @note We're using the channel layout tag to indicate channel order
38  * when the value is greater than 0x10000. The Apple documentation has
39  * some contradictions as to how this is actually supposed to be handled.
40  *
41  * Core Audio File Format Spec:
42  * "The high 16 bits indicates a specific ordering of the channels."
43  * Core Audio Data Types Reference:
44  * "These identifiers specify the channels included in a layout but
45  * do not specify a particular ordering of those channels."
46  */
48 #define MOV_CH_LAYOUT_UNKNOWN 0xFFFF0000
50  MOV_CH_LAYOUT_USE_BITMAP = ( 1 << 16) | 0,
51  MOV_CH_LAYOUT_DISCRETEINORDER = (147 << 16) | 0,
52  MOV_CH_LAYOUT_MONO = (100 << 16) | 1,
53  MOV_CH_LAYOUT_STEREO = (101 << 16) | 2,
54  MOV_CH_LAYOUT_STEREOHEADPHONES = (102 << 16) | 2,
55  MOV_CH_LAYOUT_MATRIXSTEREO = (103 << 16) | 2,
56  MOV_CH_LAYOUT_MIDSIDE = (104 << 16) | 2,
57  MOV_CH_LAYOUT_XY = (105 << 16) | 2,
58  MOV_CH_LAYOUT_BINAURAL = (106 << 16) | 2,
60  MOV_CH_LAYOUT_QUADRAPHONIC = (108 << 16) | 4,
61  MOV_CH_LAYOUT_PENTAGONAL = (109 << 16) | 5,
62  MOV_CH_LAYOUT_HEXAGONAL = (110 << 16) | 6,
63  MOV_CH_LAYOUT_OCTAGONAL = (111 << 16) | 8,
64  MOV_CH_LAYOUT_CUBE = (112 << 16) | 8,
65  MOV_CH_LAYOUT_MPEG_3_0_A = (113 << 16) | 3,
66  MOV_CH_LAYOUT_MPEG_3_0_B = (114 << 16) | 3,
67  MOV_CH_LAYOUT_MPEG_4_0_A = (115 << 16) | 4,
68  MOV_CH_LAYOUT_MPEG_4_0_B = (116 << 16) | 4,
69  MOV_CH_LAYOUT_MPEG_5_0_A = (117 << 16) | 5,
70  MOV_CH_LAYOUT_MPEG_5_0_B = (118 << 16) | 5,
71  MOV_CH_LAYOUT_MPEG_5_0_C = (119 << 16) | 5,
72  MOV_CH_LAYOUT_MPEG_5_0_D = (120 << 16) | 5,
73  MOV_CH_LAYOUT_MPEG_5_1_A = (121 << 16) | 6,
74  MOV_CH_LAYOUT_MPEG_5_1_B = (122 << 16) | 6,
75  MOV_CH_LAYOUT_MPEG_5_1_C = (123 << 16) | 6,
76  MOV_CH_LAYOUT_MPEG_5_1_D = (124 << 16) | 6,
77  MOV_CH_LAYOUT_MPEG_6_1_A = (125 << 16) | 7,
78  MOV_CH_LAYOUT_MPEG_7_1_A = (126 << 16) | 8,
79  MOV_CH_LAYOUT_MPEG_7_1_B = (127 << 16) | 8,
80  MOV_CH_LAYOUT_MPEG_7_1_C = (128 << 16) | 8,
82  MOV_CH_LAYOUT_SMPTE_DTV = (130 << 16) | 8,
83  MOV_CH_LAYOUT_ITU_2_1 = (131 << 16) | 3,
84  MOV_CH_LAYOUT_ITU_2_2 = (132 << 16) | 4,
85  MOV_CH_LAYOUT_DVD_4 = (133 << 16) | 3,
86  MOV_CH_LAYOUT_DVD_5 = (134 << 16) | 4,
87  MOV_CH_LAYOUT_DVD_6 = (135 << 16) | 5,
88  MOV_CH_LAYOUT_DVD_10 = (136 << 16) | 4,
89  MOV_CH_LAYOUT_DVD_11 = (137 << 16) | 5,
90  MOV_CH_LAYOUT_DVD_18 = (138 << 16) | 5,
91  MOV_CH_LAYOUT_AUDIOUNIT_6_0 = (139 << 16) | 6,
92  MOV_CH_LAYOUT_AUDIOUNIT_7_0 = (140 << 16) | 7,
94  MOV_CH_LAYOUT_AAC_6_0 = (141 << 16) | 6,
95  MOV_CH_LAYOUT_AAC_6_1 = (142 << 16) | 7,
96  MOV_CH_LAYOUT_AAC_7_0 = (143 << 16) | 7,
97  MOV_CH_LAYOUT_AAC_OCTAGONAL = (144 << 16) | 8,
98  MOV_CH_LAYOUT_TMH_10_2_STD = (145 << 16) | 16,
99  MOV_CH_LAYOUT_TMH_10_2_FULL = (146 << 16) | 21,
100  MOV_CH_LAYOUT_AC3_1_0_1 = (149 << 16) | 2,
101  MOV_CH_LAYOUT_AC3_3_0 = (150 << 16) | 3,
102  MOV_CH_LAYOUT_AC3_3_1 = (151 << 16) | 4,
103  MOV_CH_LAYOUT_AC3_3_0_1 = (152 << 16) | 4,
104  MOV_CH_LAYOUT_AC3_2_1_1 = (153 << 16) | 4,
105  MOV_CH_LAYOUT_AC3_3_1_1 = (154 << 16) | 5,
106  MOV_CH_LAYOUT_EAC3_6_0_A = (155 << 16) | 6,
107  MOV_CH_LAYOUT_EAC3_7_0_A = (156 << 16) | 7,
108  MOV_CH_LAYOUT_EAC3_6_1_A = (157 << 16) | 7,
109  MOV_CH_LAYOUT_EAC3_6_1_B = (158 << 16) | 7,
110  MOV_CH_LAYOUT_EAC3_6_1_C = (159 << 16) | 7,
111  MOV_CH_LAYOUT_EAC3_7_1_A = (160 << 16) | 8,
112  MOV_CH_LAYOUT_EAC3_7_1_B = (161 << 16) | 8,
113  MOV_CH_LAYOUT_EAC3_7_1_C = (162 << 16) | 8,
114  MOV_CH_LAYOUT_EAC3_7_1_D = (163 << 16) | 8,
115  MOV_CH_LAYOUT_EAC3_7_1_E = (164 << 16) | 8,
116  MOV_CH_LAYOUT_EAC3_7_1_F = (165 << 16) | 8,
117  MOV_CH_LAYOUT_EAC3_7_1_G = (166 << 16) | 8,
118  MOV_CH_LAYOUT_EAC3_7_1_H = (167 << 16) | 8,
119  MOV_CH_LAYOUT_DTS_3_1 = (168 << 16) | 4,
120  MOV_CH_LAYOUT_DTS_4_1 = (169 << 16) | 5,
121  MOV_CH_LAYOUT_DTS_6_0_A = (170 << 16) | 6,
122  MOV_CH_LAYOUT_DTS_6_0_B = (171 << 16) | 6,
123  MOV_CH_LAYOUT_DTS_6_0_C = (172 << 16) | 6,
124  MOV_CH_LAYOUT_DTS_6_1_A = (173 << 16) | 7,
125  MOV_CH_LAYOUT_DTS_6_1_B = (174 << 16) | 7,
126  MOV_CH_LAYOUT_DTS_6_1_C = (175 << 16) | 7,
127  MOV_CH_LAYOUT_DTS_6_1_D = (182 << 16) | 7,
128  MOV_CH_LAYOUT_DTS_7_0 = (176 << 16) | 7,
129  MOV_CH_LAYOUT_DTS_7_1 = (177 << 16) | 8,
130  MOV_CH_LAYOUT_DTS_8_0_A = (178 << 16) | 8,
131  MOV_CH_LAYOUT_DTS_8_0_B = (179 << 16) | 8,
132  MOV_CH_LAYOUT_DTS_8_1_A = (180 << 16) | 9,
133  MOV_CH_LAYOUT_DTS_8_1_B = (181 << 16) | 9,
134 };
135 
137  uint32_t tag;
138  uint64_t layout;
139 };
140 
145  { MOV_CH_LAYOUT_UNKNOWN, 0 },
146  { MOV_CH_LAYOUT_TMH_10_2_STD, 0 }, // L, R, C, Vhc, Lsd, Rsd,
147  // Ls, Rs, Vhl, Vhr, Lw, Rw,
148  // Csd, Cs, LFE1, LFE2
149  { MOV_CH_LAYOUT_TMH_10_2_FULL, 0 }, // L, R, C, Vhc, Lsd, Rsd,
150  // Ls, Rs, Vhl, Vhr, Lw, Rw,
151  // Csd, Cs, LFE1, LFE2, Lc, Rc,
152  // HI, VI, Haptic
153  { 0, 0 },
154 };
155 
158  { 0, 0 },
159 };
160 
166  { MOV_CH_LAYOUT_XY, AV_CH_LAYOUT_STEREO }, // X (left), Y (right)
167 
169 
172  { 0, 0 },
173 };
174 
179 
180  { MOV_CH_LAYOUT_ITU_2_1, AV_CH_LAYOUT_2_1 }, // L, R, Cs
181 
182  { MOV_CH_LAYOUT_DVD_4, AV_CH_LAYOUT_2POINT1 }, // L, R, LFE
183  { 0, 0 },
184 };
185 
187  { MOV_CH_LAYOUT_AMBISONIC_B_FORMAT, 0 }, // W, X, Y, Z
188 
189  { MOV_CH_LAYOUT_QUADRAPHONIC, AV_CH_LAYOUT_QUAD }, // L, R, Rls, Rrs
190 
193  { MOV_CH_LAYOUT_AC3_3_1, AV_CH_LAYOUT_4POINT0 }, // L, C, R, Cs
194 
195  { MOV_CH_LAYOUT_ITU_2_2, AV_CH_LAYOUT_2_2 }, // L, R, Ls, Rs
196 
197  { MOV_CH_LAYOUT_DVD_5, AV_CH_LAYOUT_2_1 | // L, R, LFE, Cs
199  { MOV_CH_LAYOUT_AC3_2_1_1, AV_CH_LAYOUT_2_1 | // L, R, Cs, LFE
201 
202  { MOV_CH_LAYOUT_DVD_10, AV_CH_LAYOUT_3POINT1 }, // L, R, C, LFE
203  { MOV_CH_LAYOUT_AC3_3_0_1, AV_CH_LAYOUT_3POINT1 }, // L, C, R, LFE
204  { MOV_CH_LAYOUT_DTS_3_1, AV_CH_LAYOUT_3POINT1 }, // C, L, R, LFE
205  { 0, 0 },
206 };
207 
209  { MOV_CH_LAYOUT_PENTAGONAL, AV_CH_LAYOUT_5POINT0_BACK }, // L, R, Rls, Rrs, C
210 
211  { MOV_CH_LAYOUT_MPEG_5_0_A, AV_CH_LAYOUT_5POINT0 }, // L, R, C, Ls, Rs
212  { MOV_CH_LAYOUT_MPEG_5_0_B, AV_CH_LAYOUT_5POINT0 }, // L, R, Ls, Rs, C
213  { MOV_CH_LAYOUT_MPEG_5_0_C, AV_CH_LAYOUT_5POINT0 }, // L, C, R, Ls, Rs
214  { MOV_CH_LAYOUT_MPEG_5_0_D, AV_CH_LAYOUT_5POINT0 }, // C, L, R, Ls, Rs
215 
216  { MOV_CH_LAYOUT_DVD_6, AV_CH_LAYOUT_2_2 | // L, R, LFE, Ls, Rs
218  { MOV_CH_LAYOUT_DVD_18, AV_CH_LAYOUT_2_2 | // L, R, Ls, Rs, LFE
220 
221  { MOV_CH_LAYOUT_DVD_11, AV_CH_LAYOUT_4POINT1 }, // L, R, C, LFE, Cs
222  { MOV_CH_LAYOUT_AC3_3_1_1, AV_CH_LAYOUT_4POINT1 }, // L, C, R, Cs, LFE
223  { MOV_CH_LAYOUT_DTS_4_1, AV_CH_LAYOUT_4POINT1 }, // C, L, R, Cs, LFE
224  { 0, 0 },
225 };
226 
228  { MOV_CH_LAYOUT_HEXAGONAL, AV_CH_LAYOUT_HEXAGONAL }, // L, R, Rls, Rrs, C, Cs
229  { MOV_CH_LAYOUT_DTS_6_0_C, AV_CH_LAYOUT_HEXAGONAL }, // C, Cs, L, R, Rls, Rrs
230 
231  { MOV_CH_LAYOUT_MPEG_5_1_A, AV_CH_LAYOUT_5POINT1 }, // L, R, C, LFE, Ls, Rs
232  { MOV_CH_LAYOUT_MPEG_5_1_B, AV_CH_LAYOUT_5POINT1 }, // L, R, Ls, Rs, C, LFE
233  { MOV_CH_LAYOUT_MPEG_5_1_C, AV_CH_LAYOUT_5POINT1 }, // L, C, R, Ls, Rs, LFE
234  { MOV_CH_LAYOUT_MPEG_5_1_D, AV_CH_LAYOUT_5POINT1 }, // C, L, R, Ls, Rs, LFE
235 
236  { MOV_CH_LAYOUT_AUDIOUNIT_6_0, AV_CH_LAYOUT_6POINT0 }, // L, R, Ls, Rs, C, Cs
237  { MOV_CH_LAYOUT_AAC_6_0, AV_CH_LAYOUT_6POINT0 }, // C, L, R, Ls, Rs, Cs
238  { MOV_CH_LAYOUT_EAC3_6_0_A, AV_CH_LAYOUT_6POINT0 }, // L, C, R, Ls, Rs, Cs
239 
240  { MOV_CH_LAYOUT_DTS_6_0_A, AV_CH_LAYOUT_6POINT0_FRONT }, // Lc, Rc, L, R, Ls, Rs
241 
242  { MOV_CH_LAYOUT_DTS_6_0_B, AV_CH_LAYOUT_5POINT0_BACK | // C, L, R, Rls, Rrs, Ts
244  { 0, 0 },
245 };
246 
248  { MOV_CH_LAYOUT_MPEG_6_1_A, AV_CH_LAYOUT_6POINT1 }, // L, R, C, LFE, Ls, Rs, Cs
249  { MOV_CH_LAYOUT_AAC_6_1, AV_CH_LAYOUT_6POINT1 }, // C, L, R, Ls, Rs, Cs, LFE
250  { MOV_CH_LAYOUT_EAC3_6_1_A, AV_CH_LAYOUT_6POINT1 }, // L, C, R, Ls, Rs, LFE, Cs
251  { MOV_CH_LAYOUT_DTS_6_1_D, AV_CH_LAYOUT_6POINT1 }, // C, L, R, Ls, Rs, LFE, Cs
252 
253  { MOV_CH_LAYOUT_AUDIOUNIT_7_0, AV_CH_LAYOUT_7POINT0 }, // L, R, Ls, Rs, C, Rls, Rrs
254  { MOV_CH_LAYOUT_AAC_7_0, AV_CH_LAYOUT_7POINT0 }, // C, L, R, Ls, Rs, Rls, Rrs
255  { MOV_CH_LAYOUT_EAC3_7_0_A, AV_CH_LAYOUT_7POINT0 }, // L, C, R, Ls, Rs, Rls, Rrs
256 
257  { MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT, AV_CH_LAYOUT_7POINT0_FRONT }, // L, R, Ls, Rs, C, Lc, Rc
258  { MOV_CH_LAYOUT_DTS_7_0, AV_CH_LAYOUT_7POINT0_FRONT }, // Lc, C, Rc, L, R, Ls, Rs
259 
260  { MOV_CH_LAYOUT_EAC3_6_1_B, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Ts
262 
263  { MOV_CH_LAYOUT_EAC3_6_1_C, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Vhc
265 
266  { MOV_CH_LAYOUT_DTS_6_1_A, AV_CH_LAYOUT_6POINT1_FRONT }, // Lc, Rc, L, R, Ls, Rs, LFE
267 
268  { MOV_CH_LAYOUT_DTS_6_1_B, AV_CH_LAYOUT_5POINT1_BACK | // C, L, R, Rls, Rrs, Ts, LFE
270 
271  { MOV_CH_LAYOUT_DTS_6_1_C, AV_CH_LAYOUT_6POINT1_BACK }, // C, Cs, L, R, Rls, Rrs, LFE
272  { 0, 0 },
273 };
274 
276  { MOV_CH_LAYOUT_OCTAGONAL, AV_CH_LAYOUT_OCTAGONAL }, // L, R, Rls, Rrs, C, Cs, Ls, Rs
277  { MOV_CH_LAYOUT_AAC_OCTAGONAL, AV_CH_LAYOUT_OCTAGONAL }, // C, L, R, Ls, Rs, Rls, Rrs, Cs
278 
279  { MOV_CH_LAYOUT_CUBE, AV_CH_LAYOUT_QUAD | // L, R, Rls, Rrs, Vhl, Vhr, Rlt, Rrt
284 
285  { MOV_CH_LAYOUT_MPEG_7_1_A, AV_CH_LAYOUT_7POINT1_WIDE }, // L, R, C, LFE, Ls, Rs, Lc, Rc
286  { MOV_CH_LAYOUT_MPEG_7_1_B, AV_CH_LAYOUT_7POINT1_WIDE }, // C, Lc, Rc, L, R, Ls, Rs, LFE
287  { MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1, AV_CH_LAYOUT_7POINT1_WIDE }, // L, R, Ls, Rs, C, LFE, Lc, Rc
288  { MOV_CH_LAYOUT_EAC3_7_1_B, AV_CH_LAYOUT_7POINT1_WIDE }, // L, C, R, Ls, Rs, LFE, Lc, Rc
289  { MOV_CH_LAYOUT_DTS_7_1, AV_CH_LAYOUT_7POINT1_WIDE }, // Lc, C, Rc, L, R, Ls, Rs, LFE
290 
291  { MOV_CH_LAYOUT_MPEG_7_1_C, AV_CH_LAYOUT_7POINT1 }, // L, R, C, LFE, Ls, Rs, Rls, Rrs
292  { MOV_CH_LAYOUT_EAC3_7_1_A, AV_CH_LAYOUT_7POINT1 }, // L, C, R, Ls, Rs, LFE, Rls, Rrs
293 
294  { MOV_CH_LAYOUT_SMPTE_DTV, AV_CH_LAYOUT_5POINT1 | // L, R, C, LFE, Ls, Rs, Lt, Rt
296 
297  { MOV_CH_LAYOUT_EAC3_7_1_C, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Lsd, Rsd
300 
301  { MOV_CH_LAYOUT_EAC3_7_1_D, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Lw, Rw
304 
305  { MOV_CH_LAYOUT_EAC3_7_1_E, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Vhl, Vhr
308 
309  { MOV_CH_LAYOUT_EAC3_7_1_F, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Cs, Ts
312 
313  { MOV_CH_LAYOUT_EAC3_7_1_G, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Cs, Vhc
316 
317  { MOV_CH_LAYOUT_EAC3_7_1_H, AV_CH_LAYOUT_5POINT1 | // L, C, R, Ls, Rs, LFE, Ts, Vhc
320 
321  { MOV_CH_LAYOUT_DTS_8_0_A, AV_CH_LAYOUT_2_2 | // Lc, Rc, L, R, Ls, Rs, Rls, Rrs
326 
327  { MOV_CH_LAYOUT_DTS_8_0_B, AV_CH_LAYOUT_5POINT0 | // Lc, C, Rc, L, R, Ls, Cs, Rs
331  { 0, 0 },
332 };
333 
335  { MOV_CH_LAYOUT_DTS_8_1_A, AV_CH_LAYOUT_2_2 | // Lc, Rc, L, R, Ls, Rs, Rls, Rrs, LFE
341 
342  { MOV_CH_LAYOUT_DTS_8_1_B, AV_CH_LAYOUT_7POINT1_WIDE | // Lc, C, Rc, L, R, Ls, Cs, Rs, LFE
344  { 0, 0 },
345 };
346 
347 static const struct MovChannelLayoutMap * const mov_ch_layout_map[] = {
358 };
359 
384  0,
385 };
386 
402  0,
403 };
404 
414  0,
415 };
416 
429  0,
430 };
431 
432 static const struct {
435 } mov_codec_ch_layouts[] = {
451  { AV_CODEC_ID_NONE, NULL },
452 };
453 
454 uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
455 {
456  int i, channels;
457  const struct MovChannelLayoutMap *layout_map;
458 
459  /* use ff_mov_get_channel_label() to build a layout instead */
461  return 0;
462 
463  /* handle the use of the channel bitmap */
465  return bitmap < 0x40000 ? bitmap : 0;
466 
467  /* get the layout map based on the channel count for the specified layout tag */
468  channels = tag & 0xFFFF;
469  if (channels > 9)
470  channels = 0;
471  layout_map = mov_ch_layout_map[channels];
472 
473  /* find the channel layout for the specified layout tag */
474  for (i = 0; layout_map[i].tag != 0; i++) {
475  if (layout_map[i].tag == tag)
476  break;
477  }
478  return layout_map[i].layout;
479 }
480 
481 static uint32_t mov_get_channel_label(uint32_t label)
482 {
483  if (label == 0)
484  return 0;
485  if (label <= 18)
486  return 1U << (label - 1);
487  if (label == 38)
488  return AV_CH_STEREO_LEFT;
489  if (label == 39)
490  return AV_CH_STEREO_RIGHT;
491  return 0;
492 }
493 
495  uint64_t channel_layout,
496  uint32_t *bitmap)
497 {
498  int i, j;
499  uint32_t tag = 0;
500  const enum MovChannelLayoutTag *layouts = NULL;
501 
502  /* find the layout list for the specified codec */
503  for (i = 0; mov_codec_ch_layouts[i].codec_id != AV_CODEC_ID_NONE; i++) {
505  break;
506  }
508  layouts = mov_codec_ch_layouts[i].layouts;
509 
510  if (layouts) {
511  int channels;
512  const struct MovChannelLayoutMap *layout_map;
513 
514  /* get the layout map based on the channel count */
516  if (channels > 9)
517  channels = 0;
518  layout_map = mov_ch_layout_map[channels];
519 
520  /* find the layout tag for the specified channel layout */
521  for (i = 0; layouts[i] != 0; i++) {
522  if ((layouts[i] & 0xFFFF) != channels)
523  continue;
524  for (j = 0; layout_map[j].tag != 0; j++) {
525  if (layout_map[j].tag == layouts[i] &&
526  layout_map[j].layout == channel_layout)
527  break;
528  }
529  if (layout_map[j].tag)
530  break;
531  }
532  tag = layouts[i];
533  }
534 
535  /* if no tag was found, use channel bitmap as a backup if possible */
536  if (tag == 0 && channel_layout > 0 && channel_layout < 0x40000) {
538  *bitmap = (uint32_t)channel_layout;
539  } else
540  *bitmap = 0;
541 
542  /* TODO: set channel descriptions as a secondary backup */
543 
544  return tag;
545 }
546 
548  int64_t size)
549 {
550  uint32_t layout_tag, bitmap, num_descr, label_mask;
551  int i;
552 
553  if (size < 12)
554  return AVERROR_INVALIDDATA;
555 
556  layout_tag = avio_rb32(pb);
557  bitmap = avio_rb32(pb);
558  num_descr = avio_rb32(pb);
559 
560  av_log(s, AV_LOG_TRACE, "chan: layout=%"PRIu32" "
561  "bitmap=%"PRIu32" num_descr=%"PRIu32"\n",
562  layout_tag, bitmap, num_descr);
563 
564  if (size < 12ULL + num_descr * 20ULL)
565  return 0;
566 
567  label_mask = 0;
568  for (i = 0; i < num_descr; i++) {
569  uint32_t label;
570  if (pb->eof_reached) {
572  "reached EOF while reading channel layout\n");
573  return AVERROR_INVALIDDATA;
574  }
575  label = avio_rb32(pb); // mChannelLabel
576  avio_rb32(pb); // mChannelFlags
577  avio_rl32(pb); // mCoordinates[0]
578  avio_rl32(pb); // mCoordinates[1]
579  avio_rl32(pb); // mCoordinates[2]
580  size -= 20;
581  if (layout_tag == 0) {
582  uint32_t mask_incr = mov_get_channel_label(label);
583  if (mask_incr == 0) {
584  label_mask = 0;
585  break;
586  }
587  label_mask |= mask_incr;
588  }
589  }
590  if (layout_tag == 0) {
591  if (label_mask)
592  st->codecpar->channel_layout = label_mask;
593  } else
594  st->codecpar->channel_layout = ff_mov_get_channel_layout(layout_tag, bitmap);
595  avio_skip(pb, size - 12);
596 
597  return 0;
598 }
MOV_CH_LAYOUT_MPEG_4_0_B
@ MOV_CH_LAYOUT_MPEG_4_0_B
Definition: mov_chan.c:68
AV_CODEC_ID_PCM_S16LE
@ AV_CODEC_ID_PCM_S16LE
Definition: avcodec.h:463
AV_CH_LAYOUT_7POINT0
#define AV_CH_LAYOUT_7POINT0
Definition: channel_layout.h:105
AV_CH_LAYOUT_6POINT1
#define AV_CH_LAYOUT_6POINT1
Definition: channel_layout.h:102
AV_CODEC_ID_PCM_F32BE
@ AV_CODEC_ID_PCM_F32BE
Definition: avcodec.h:483
MOV_CH_LAYOUT_AAC_OCTAGONAL
@ MOV_CH_LAYOUT_AAC_OCTAGONAL
Definition: mov_chan.c:97
MOV_CH_LAYOUT_MPEG_5_0_D
@ MOV_CH_LAYOUT_MPEG_5_0_D
Definition: mov_chan.c:72
AV_CH_LAYOUT_5POINT0_BACK
#define AV_CH_LAYOUT_5POINT0_BACK
Definition: channel_layout.h:97
AV_CODEC_ID_AC3
@ AV_CODEC_ID_AC3
Definition: avcodec.h:567
MOV_CH_LAYOUT_MPEG_7_1_B
@ MOV_CH_LAYOUT_MPEG_7_1_B
Definition: mov_chan.c:79
MOV_CH_LAYOUT_MPEG_3_0_B
@ MOV_CH_LAYOUT_MPEG_3_0_B
Definition: mov_chan.c:66
AV_CH_TOP_FRONT_CENTER
#define AV_CH_TOP_FRONT_CENTER
Definition: channel_layout.h:62
codec_id
enum AVCodecID codec_id
Definition: mov_chan.c:433
MOV_CH_LAYOUT_DTS_7_0
@ MOV_CH_LAYOUT_DTS_7_0
Definition: mov_chan.c:128
MOV_CH_LAYOUT_MPEG_5_0_B
@ MOV_CH_LAYOUT_MPEG_5_0_B
Definition: mov_chan.c:70
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:434
MOV_CH_LAYOUT_DTS_6_1_A
@ MOV_CH_LAYOUT_DTS_6_1_A
Definition: mov_chan.c:124
AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_MONO
Definition: channel_layout.h:85
ff_mov_get_channel_layout
uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
mov 'chan' tag reading/writing.
Definition: mov_chan.c:454
MOV_CH_LAYOUT_AC3_2_1_1
@ MOV_CH_LAYOUT_AC3_2_1_1
Definition: mov_chan.c:104
AV_CH_TOP_FRONT_RIGHT
#define AV_CH_TOP_FRONT_RIGHT
Definition: channel_layout.h:63
MOV_CH_LAYOUT_DTS_6_0_B
@ MOV_CH_LAYOUT_DTS_6_0_B
Definition: mov_chan.c:122
AV_CH_LAYOUT_HEXAGONAL
#define AV_CH_LAYOUT_HEXAGONAL
Definition: channel_layout.h:101
MOV_CH_LAYOUT_DVD_4
@ MOV_CH_LAYOUT_DVD_4
Definition: mov_chan.c:85
AV_CODEC_ID_ALAC
@ AV_CODEC_ID_ALAC
Definition: avcodec.h:580
MOV_CH_LAYOUT_DISCRETEINORDER
@ MOV_CH_LAYOUT_DISCRETEINORDER
Definition: mov_chan.c:51
AV_CH_LAYOUT_6POINT0_FRONT
#define AV_CH_LAYOUT_6POINT0_FRONT
Definition: channel_layout.h:100
AV_CH_LAYOUT_6POINT1_FRONT
#define AV_CH_LAYOUT_6POINT1_FRONT
Definition: channel_layout.h:104
AV_CH_TOP_FRONT_LEFT
#define AV_CH_TOP_FRONT_LEFT
Definition: channel_layout.h:61
channels
channels
Definition: aptx.c:30
MOV_CH_LAYOUT_STEREO
@ MOV_CH_LAYOUT_STEREO
Definition: mov_chan.c:53
MOV_CH_LAYOUT_EAC3_7_1_H
@ MOV_CH_LAYOUT_EAC3_7_1_H
Definition: mov_chan.c:118
AV_CH_WIDE_LEFT
#define AV_CH_WIDE_LEFT
Definition: channel_layout.h:69
AV_CH_SURROUND_DIRECT_RIGHT
#define AV_CH_SURROUND_DIRECT_RIGHT
Definition: channel_layout.h:72
AV_CH_WIDE_RIGHT
#define AV_CH_WIDE_RIGHT
Definition: channel_layout.h:70
AV_CH_TOP_BACK_LEFT
#define AV_CH_TOP_BACK_LEFT
Definition: channel_layout.h:64
MovChannelLayoutTag
MovChannelLayoutTag
mov 'chan' tag reading/writing.
Definition: mov_chan.c:47
MOV_CH_LAYOUT_AC3_3_1
@ MOV_CH_LAYOUT_AC3_3_1
Definition: mov_chan.c:102
AV_CH_LAYOUT_6POINT0
#define AV_CH_LAYOUT_6POINT0
Definition: channel_layout.h:99
MOV_CH_LAYOUT_TMH_10_2_FULL
@ MOV_CH_LAYOUT_TMH_10_2_FULL
Definition: mov_chan.c:99
MOV_CH_LAYOUT_STEREOHEADPHONES
@ MOV_CH_LAYOUT_STEREOHEADPHONES
Definition: mov_chan.c:54
MOV_CH_LAYOUT_XY
@ MOV_CH_LAYOUT_XY
Definition: mov_chan.c:57
AV_CODEC_ID_PCM_S16BE
@ AV_CODEC_ID_PCM_S16BE
Definition: avcodec.h:464
U
#define U(x)
Definition: vp56_arith.h:37
MOV_CH_LAYOUT_MPEG_7_1_A
@ MOV_CH_LAYOUT_MPEG_7_1_A
Definition: mov_chan.c:78
AV_CH_BACK_LEFT
#define AV_CH_BACK_LEFT
Definition: channel_layout.h:53
mov_ch_layouts_alac
static enum MovChannelLayoutTag mov_ch_layouts_alac[]
Definition: mov_chan.c:405
MOV_CH_LAYOUT_DTS_7_1
@ MOV_CH_LAYOUT_DTS_7_1
Definition: mov_chan.c:129
MOV_CH_LAYOUT_MPEG_4_0_A
@ MOV_CH_LAYOUT_MPEG_4_0_A
Definition: mov_chan.c:67
MOV_CH_LAYOUT_DVD_6
@ MOV_CH_LAYOUT_DVD_6
Definition: mov_chan.c:87
MOV_CH_LAYOUT_DVD_18
@ MOV_CH_LAYOUT_DVD_18
Definition: mov_chan.c:90
AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_STEREO
Definition: channel_layout.h:86
AV_CH_LAYOUT_QUAD
#define AV_CH_LAYOUT_QUAD
Definition: channel_layout.h:94
MOV_CH_LAYOUT_MPEG_7_1_C
@ MOV_CH_LAYOUT_MPEG_7_1_C
Definition: mov_chan.c:80
MOV_CH_LAYOUT_EAC3_7_1_B
@ MOV_CH_LAYOUT_EAC3_7_1_B
Definition: mov_chan.c:112
AV_CODEC_ID_PCM_S8
@ AV_CODEC_ID_PCM_S8
Definition: avcodec.h:467
avio_rb32
unsigned int avio_rb32(AVIOContext *s)
Definition: aviobuf.c:800
AV_LOG_TRACE
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition: log.h:202
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
MOV_CH_LAYOUT_DVD_5
@ MOV_CH_LAYOUT_DVD_5
Definition: mov_chan.c:86
AV_CH_LOW_FREQUENCY
#define AV_CH_LOW_FREQUENCY
Definition: channel_layout.h:52
s
#define s(width, name)
Definition: cbs_vp9.c:257
MOV_CH_LAYOUT_DTS_8_0_A
@ MOV_CH_LAYOUT_DTS_8_0_A
Definition: mov_chan.c:130
MOV_CH_LAYOUT_AC3_3_0
@ MOV_CH_LAYOUT_AC3_3_0
Definition: mov_chan.c:101
MOV_CH_LAYOUT_DTS_6_1_B
@ MOV_CH_LAYOUT_DTS_6_1_B
Definition: mov_chan.c:125
mov_ch_layout_map_7ch
static const struct MovChannelLayoutMap mov_ch_layout_map_7ch[]
Definition: mov_chan.c:247
MOV_CH_LAYOUT_EAC3_7_1_D
@ MOV_CH_LAYOUT_EAC3_7_1_D
Definition: mov_chan.c:114
AV_CH_LAYOUT_7POINT0_FRONT
#define AV_CH_LAYOUT_7POINT0_FRONT
Definition: channel_layout.h:106
AV_CH_LAYOUT_STEREO_DOWNMIX
#define AV_CH_LAYOUT_STEREO_DOWNMIX
Definition: channel_layout.h:112
MOV_CH_LAYOUT_DVD_11
@ MOV_CH_LAYOUT_DVD_11
Definition: mov_chan.c:89
MOV_CH_LAYOUT_MPEG_5_0_A
@ MOV_CH_LAYOUT_MPEG_5_0_A
Definition: mov_chan.c:69
MOV_CH_LAYOUT_AAC_6_1
@ MOV_CH_LAYOUT_AAC_6_1
Definition: mov_chan.c:95
AV_CH_LAYOUT_2_1
#define AV_CH_LAYOUT_2_1
Definition: channel_layout.h:88
AV_CH_STEREO_RIGHT
#define AV_CH_STEREO_RIGHT
See AV_CH_STEREO_LEFT.
Definition: channel_layout.h:68
AVFormatContext
Format I/O context.
Definition: avformat.h:1342
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:1017
MOV_CH_LAYOUT_EAC3_6_1_B
@ MOV_CH_LAYOUT_EAC3_6_1_B
Definition: mov_chan.c:109
MOV_CH_LAYOUT_USE_BITMAP
@ MOV_CH_LAYOUT_USE_BITMAP
Definition: mov_chan.c:50
AV_CH_TOP_CENTER
#define AV_CH_TOP_CENTER
Definition: channel_layout.h:60
mov_ch_layout_map_1ch
static const struct MovChannelLayoutMap mov_ch_layout_map_1ch[]
Definition: mov_chan.c:156
NULL
#define NULL
Definition: coverity.c:32
MOV_CH_LAYOUT_MPEG_6_1_A
@ MOV_CH_LAYOUT_MPEG_6_1_A
Definition: mov_chan.c:77
MOV_CH_LAYOUT_OCTAGONAL
@ MOV_CH_LAYOUT_OCTAGONAL
Definition: mov_chan.c:63
MOV_CH_LAYOUT_ITU_2_2
@ MOV_CH_LAYOUT_ITU_2_2
Definition: mov_chan.c:84
AV_CH_LAYOUT_5POINT1
#define AV_CH_LAYOUT_5POINT1
Definition: channel_layout.h:96
MOV_CH_LAYOUT_MIDSIDE
@ MOV_CH_LAYOUT_MIDSIDE
Definition: mov_chan.c:56
MovChannelLayoutMap::layout
uint64_t layout
Definition: mov_chan.c:138
MOV_CH_LAYOUT_AAC_6_0
@ MOV_CH_LAYOUT_AAC_6_0
Definition: mov_chan.c:94
MOV_CH_LAYOUT_DTS_3_1
@ MOV_CH_LAYOUT_DTS_3_1
Definition: mov_chan.c:119
AV_CH_FRONT_LEFT_OF_CENTER
#define AV_CH_FRONT_LEFT_OF_CENTER
Definition: channel_layout.h:55
MovChannelLayoutMap
Definition: mov_chan.c:136
MOV_CH_LAYOUT_UNKNOWN
#define MOV_CH_LAYOUT_UNKNOWN
Definition: mov_chan.c:48
av_get_channel_layout_nb_channels
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
Definition: channel_layout.c:220
AVCodecID
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:215
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: avcodec.h:566
avio_rl32
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:769
MOV_CH_LAYOUT_EAC3_7_1_A
@ MOV_CH_LAYOUT_EAC3_7_1_A
Definition: mov_chan.c:111
AVIOContext
Bytestream IO Context.
Definition: avio.h:161
AV_CODEC_ID_PCM_S24LE
@ AV_CODEC_ID_PCM_S24LE
Definition: avcodec.h:475
MOV_CH_LAYOUT_DTS_8_1_B
@ MOV_CH_LAYOUT_DTS_8_1_B
Definition: mov_chan.c:133
MOV_CH_LAYOUT_DTS_6_0_A
@ MOV_CH_LAYOUT_DTS_6_0_A
Definition: mov_chan.c:121
MOV_CH_LAYOUT_MATRIXSTEREO
@ MOV_CH_LAYOUT_MATRIXSTEREO
Definition: mov_chan.c:55
MOV_CH_LAYOUT_PENTAGONAL
@ MOV_CH_LAYOUT_PENTAGONAL
Definition: mov_chan.c:61
MOV_CH_LAYOUT_EAC3_7_0_A
@ MOV_CH_LAYOUT_EAC3_7_0_A
Definition: mov_chan.c:107
size
int size
Definition: twinvq_data.h:11134
MOV_CH_LAYOUT_HEXAGONAL
@ MOV_CH_LAYOUT_HEXAGONAL
Definition: mov_chan.c:62
MOV_CH_LAYOUT_EAC3_7_1_F
@ MOV_CH_LAYOUT_EAC3_7_1_F
Definition: mov_chan.c:116
MOV_CH_LAYOUT_AMBISONIC_B_FORMAT
@ MOV_CH_LAYOUT_AMBISONIC_B_FORMAT
Definition: mov_chan.c:59
MOV_CH_LAYOUT_EAC3_7_1_E
@ MOV_CH_LAYOUT_EAC3_7_1_E
Definition: mov_chan.c:115
mov_get_channel_label
static uint32_t mov_get_channel_label(uint32_t label)
Definition: mov_chan.c:481
ff_mov_get_channel_layout_tag
uint32_t ff_mov_get_channel_layout_tag(enum AVCodecID codec_id, uint64_t channel_layout, uint32_t *bitmap)
Get the channel layout tag for the specified codec id and channel layout.
Definition: mov_chan.c:494
AV_CH_LAYOUT_5POINT1_BACK
#define AV_CH_LAYOUT_5POINT1_BACK
Definition: channel_layout.h:98
AV_CH_TOP_BACK_RIGHT
#define AV_CH_TOP_BACK_RIGHT
Definition: channel_layout.h:66
AV_CH_FRONT_RIGHT_OF_CENTER
#define AV_CH_FRONT_RIGHT_OF_CENTER
Definition: channel_layout.h:56
MOV_CH_LAYOUT_QUADRAPHONIC
@ MOV_CH_LAYOUT_QUADRAPHONIC
Definition: mov_chan.c:60
MOV_CH_LAYOUT_DTS_6_1_C
@ MOV_CH_LAYOUT_DTS_6_1_C
Definition: mov_chan.c:126
AV_CH_LAYOUT_3POINT1
#define AV_CH_LAYOUT_3POINT1
Definition: channel_layout.h:90
layout
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 layout
Definition: filter_design.txt:18
mov_ch_layout_map_5ch
static const struct MovChannelLayoutMap mov_ch_layout_map_5ch[]
Definition: mov_chan.c:208
AV_CH_LAYOUT_OCTAGONAL
#define AV_CH_LAYOUT_OCTAGONAL
Definition: channel_layout.h:110
AV_CH_LAYOUT_5POINT0
#define AV_CH_LAYOUT_5POINT0
Definition: channel_layout.h:95
MOV_CH_LAYOUT_EAC3_7_1_G
@ MOV_CH_LAYOUT_EAC3_7_1_G
Definition: mov_chan.c:117
mov_ch_layout_map_9ch
static const struct MovChannelLayoutMap mov_ch_layout_map_9ch[]
Definition: mov_chan.c:334
MOV_CH_LAYOUT_AC3_1_0_1
@ MOV_CH_LAYOUT_AC3_1_0_1
Definition: mov_chan.c:100
mov_ch_layout_map_8ch
static const struct MovChannelLayoutMap mov_ch_layout_map_8ch[]
Definition: mov_chan.c:275
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: avcodec.h:216
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
MOV_CH_LAYOUT_MPEG_5_1_C
@ MOV_CH_LAYOUT_MPEG_5_1_C
Definition: mov_chan.c:75
AV_CH_LAYOUT_2POINT1
#define AV_CH_LAYOUT_2POINT1
Definition: channel_layout.h:87
MOV_CH_LAYOUT_MPEG_5_1_A
@ MOV_CH_LAYOUT_MPEG_5_1_A
Definition: mov_chan.c:73
MOV_CH_LAYOUT_EAC3_7_1_C
@ MOV_CH_LAYOUT_EAC3_7_1_C
Definition: mov_chan.c:113
MOV_CH_LAYOUT_DTS_6_0_C
@ MOV_CH_LAYOUT_DTS_6_0_C
Definition: mov_chan.c:123
MOV_CH_LAYOUT_EAC3_6_1_C
@ MOV_CH_LAYOUT_EAC3_6_1_C
Definition: mov_chan.c:110
AV_CH_LAYOUT_7POINT1
#define AV_CH_LAYOUT_7POINT1
Definition: channel_layout.h:107
MOV_CH_LAYOUT_DTS_4_1
@ MOV_CH_LAYOUT_DTS_4_1
Definition: mov_chan.c:120
AV_CODEC_ID_PCM_F64BE
@ AV_CODEC_ID_PCM_F64BE
Definition: avcodec.h:485
AV_CH_LAYOUT_4POINT1
#define AV_CH_LAYOUT_4POINT1
Definition: channel_layout.h:92
AV_CH_BACK_CENTER
#define AV_CH_BACK_CENTER
Definition: channel_layout.h:57
MOV_CH_LAYOUT_EAC3_6_1_A
@ MOV_CH_LAYOUT_EAC3_6_1_A
Definition: mov_chan.c:108
AV_CH_LAYOUT_7POINT1_WIDE
#define AV_CH_LAYOUT_7POINT1_WIDE
Definition: channel_layout.h:108
AV_CODEC_ID_PCM_S32BE
@ AV_CODEC_ID_PCM_S32BE
Definition: avcodec.h:472
MOV_CH_LAYOUT_AAC_7_0
@ MOV_CH_LAYOUT_AAC_7_0
Definition: mov_chan.c:96
MOV_CH_LAYOUT_AC3_3_1_1
@ MOV_CH_LAYOUT_AC3_3_1_1
Definition: mov_chan.c:105
mov_ch_layout_map
static const struct MovChannelLayoutMap *const mov_ch_layout_map[]
Definition: mov_chan.c:347
MovChannelLayoutMap::tag
uint32_t tag
Definition: mov_chan.c:137
avcodec.h
mov_chan.h
tag
uint32_t tag
Definition: movenc.c:1496
AVStream
Stream structure.
Definition: avformat.h:870
MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT
@ MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT
Definition: mov_chan.c:93
AV_CH_LAYOUT_SURROUND
#define AV_CH_LAYOUT_SURROUND
Definition: channel_layout.h:89
MOV_CH_LAYOUT_MPEG_5_1_B
@ MOV_CH_LAYOUT_MPEG_5_1_B
Definition: mov_chan.c:74
MOV_CH_LAYOUT_TMH_10_2_STD
@ MOV_CH_LAYOUT_TMH_10_2_STD
Definition: mov_chan.c:98
mov_ch_layout_map_6ch
static const struct MovChannelLayoutMap mov_ch_layout_map_6ch[]
Definition: mov_chan.c:227
mov_codec_ch_layouts
static const struct @265 mov_codec_ch_layouts[]
channel_layout.h
MOV_CH_LAYOUT_ITU_2_1
@ MOV_CH_LAYOUT_ITU_2_1
Definition: mov_chan.c:83
MOV_CH_LAYOUT_MPEG_5_1_D
@ MOV_CH_LAYOUT_MPEG_5_1_D
Definition: mov_chan.c:76
MOV_CH_LAYOUT_DTS_8_1_A
@ MOV_CH_LAYOUT_DTS_8_1_A
Definition: mov_chan.c:132
MOV_CH_LAYOUT_USE_DESCRIPTIONS
@ MOV_CH_LAYOUT_USE_DESCRIPTIONS
Definition: mov_chan.c:49
MOV_CH_LAYOUT_MONO
@ MOV_CH_LAYOUT_MONO
Definition: mov_chan.c:52
AVIOContext::eof_reached
int eof_reached
true if was unable to read due to error or eof
Definition: avio.h:239
AV_CH_SURROUND_DIRECT_LEFT
#define AV_CH_SURROUND_DIRECT_LEFT
Definition: channel_layout.h:71
MOV_CH_LAYOUT_BINAURAL
@ MOV_CH_LAYOUT_BINAURAL
Definition: mov_chan.c:58
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:331
mov_ch_layouts_aac
static enum MovChannelLayoutTag mov_ch_layouts_aac[]
Definition: mov_chan.c:360
MOV_CH_LAYOUT_AC3_3_0_1
@ MOV_CH_LAYOUT_AC3_3_0_1
Definition: mov_chan.c:103
MOV_CH_LAYOUT_DTS_8_0_B
@ MOV_CH_LAYOUT_DTS_8_0_B
Definition: mov_chan.c:131
AV_CODEC_ID_PCM_S32LE
@ AV_CODEC_ID_PCM_S32LE
Definition: avcodec.h:471
mov_ch_layout_map_2ch
static const struct MovChannelLayoutMap mov_ch_layout_map_2ch[]
Definition: mov_chan.c:161
AV_CODEC_ID_PCM_U8
@ AV_CODEC_ID_PCM_U8
Definition: avcodec.h:468
MOV_CH_LAYOUT_AUDIOUNIT_6_0
@ MOV_CH_LAYOUT_AUDIOUNIT_6_0
Definition: mov_chan.c:91
AV_CODEC_ID_PCM_F64LE
@ AV_CODEC_ID_PCM_F64LE
Definition: avcodec.h:486
MOV_CH_LAYOUT_MPEG_3_0_A
@ MOV_CH_LAYOUT_MPEG_3_0_A
Definition: mov_chan.c:65
AVCodecParameters::channel_layout
uint64_t channel_layout
Audio only.
Definition: avcodec.h:4059
MOV_CH_LAYOUT_DTS_6_1_D
@ MOV_CH_LAYOUT_DTS_6_1_D
Definition: mov_chan.c:127
AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_4POINT0
Definition: channel_layout.h:91
MOV_CH_LAYOUT_MPEG_5_0_C
@ MOV_CH_LAYOUT_MPEG_5_0_C
Definition: mov_chan.c:71
AV_CH_LAYOUT_6POINT1_BACK
#define AV_CH_LAYOUT_6POINT1_BACK
Definition: channel_layout.h:103
AV_CODEC_ID_PCM_F32LE
@ AV_CODEC_ID_PCM_F32LE
Definition: avcodec.h:484
mov_ch_layout_map_3ch
static const struct MovChannelLayoutMap mov_ch_layout_map_3ch[]
Definition: mov_chan.c:175
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1
@ MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1
Definition: mov_chan.c:81
AV_CH_BACK_RIGHT
#define AV_CH_BACK_RIGHT
Definition: channel_layout.h:54
MOV_CH_LAYOUT_EAC3_6_0_A
@ MOV_CH_LAYOUT_EAC3_6_0_A
Definition: mov_chan.c:106
mov_ch_layout_map_misc
static const struct MovChannelLayoutMap mov_ch_layout_map_misc[]
Definition: mov_chan.c:141
AV_CH_STEREO_LEFT
#define AV_CH_STEREO_LEFT
Stereo downmix.
Definition: channel_layout.h:67
MOV_CH_LAYOUT_AUDIOUNIT_7_0
@ MOV_CH_LAYOUT_AUDIOUNIT_7_0
Definition: mov_chan.c:92
mov_ch_layouts_wav
static enum MovChannelLayoutTag mov_ch_layouts_wav[]
Definition: mov_chan.c:417
AV_CODEC_ID_PCM_S24BE
@ AV_CODEC_ID_PCM_S24BE
Definition: avcodec.h:476
AV_CH_LAYOUT_2_2
#define AV_CH_LAYOUT_2_2
Definition: channel_layout.h:93
mov_ch_layouts_ac3
static enum MovChannelLayoutTag mov_ch_layouts_ac3[]
Definition: mov_chan.c:387
MOV_CH_LAYOUT_CUBE
@ MOV_CH_LAYOUT_CUBE
Definition: mov_chan.c:64
MOV_CH_LAYOUT_SMPTE_DTV
@ MOV_CH_LAYOUT_SMPTE_DTV
Definition: mov_chan.c:82
mov_ch_layout_map_4ch
static const struct MovChannelLayoutMap mov_ch_layout_map_4ch[]
Definition: mov_chan.c:186
ff_mov_read_chan
int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, int64_t size)
Read 'chan' tag from the input stream.
Definition: mov_chan.c:547
MOV_CH_LAYOUT_DVD_10
@ MOV_CH_LAYOUT_DVD_10
Definition: mov_chan.c:88