FFmpeg
audiotoolboxenc.c
Go to the documentation of this file.
1 /*
2  * Audio Toolbox system codecs
3  *
4  * copyright (c) 2016 rcombs
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include <AudioToolbox/AudioToolbox.h>
24 
25 #define FF_BUFQUEUE_SIZE 256
27 
28 #include "config.h"
29 #include "audio_frame_queue.h"
30 #include "avcodec.h"
31 #include "bytestream.h"
32 #include "codec_internal.h"
33 #include "encode.h"
34 #include "internal.h"
35 #include "libavformat/isom.h"
36 #include "libavutil/avassert.h"
38 #include "libavutil/opt.h"
39 #include "libavutil/log.h"
40 
41 typedef struct ATDecodeContext {
43  int mode;
44  int quality;
45 
46  AudioConverterRef converter;
49 
50  unsigned pkt_size;
52  int eof;
54 
57 
58 static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
59 {
60  switch (codec) {
61  case AV_CODEC_ID_AAC:
62  switch (profile) {
63  case AV_PROFILE_AAC_LOW:
64  default:
65  return kAudioFormatMPEG4AAC;
66  case AV_PROFILE_AAC_HE:
67  return kAudioFormatMPEG4AAC_HE;
69  return kAudioFormatMPEG4AAC_HE_V2;
70  case AV_PROFILE_AAC_LD:
71  return kAudioFormatMPEG4AAC_LD;
72 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
73  case AV_PROFILE_AAC_ELD:
74  return kAudioFormatMPEG4AAC_ELD;
75 #endif
76  }
78  return kAudioFormatAppleIMA4;
79  case AV_CODEC_ID_ALAC:
80  return kAudioFormatAppleLossless;
81 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
82  case AV_CODEC_ID_ILBC:
83  return kAudioFormatiLBC;
84 #endif
86  return kAudioFormatALaw;
88  return kAudioFormatULaw;
89  default:
90  av_assert0(!"Invalid codec ID!");
91  return 0;
92  }
93 }
94 
95 static void ffat_update_ctx(AVCodecContext *avctx)
96 {
97  ATDecodeContext *at = avctx->priv_data;
98  UInt32 size = sizeof(unsigned);
99  AudioConverterPrimeInfo prime_info;
100  AudioStreamBasicDescription out_format;
101 
102  AudioConverterGetProperty(at->converter,
103  kAudioConverterPropertyMaximumOutputPacketSize,
104  &size, &at->pkt_size);
105 
106  if (at->pkt_size <= 0)
107  at->pkt_size = 1024 * 50;
108 
109  size = sizeof(prime_info);
110 
111  if (!AudioConverterGetProperty(at->converter,
112  kAudioConverterPrimeInfo,
113  &size, &prime_info)) {
114  avctx->initial_padding = prime_info.leadingFrames;
115  }
116 
117  size = sizeof(out_format);
118  if (!AudioConverterGetProperty(at->converter,
119  kAudioConverterCurrentOutputStreamDescription,
120  &size, &out_format)) {
121  if (out_format.mFramesPerPacket)
122  avctx->frame_size = out_format.mFramesPerPacket;
123  if (out_format.mBytesPerPacket && avctx->codec_id == AV_CODEC_ID_ILBC)
124  avctx->block_align = out_format.mBytesPerPacket;
125  }
126 
127  at->frame_size = avctx->frame_size;
128  if (avctx->codec_id == AV_CODEC_ID_PCM_MULAW ||
129  avctx->codec_id == AV_CODEC_ID_PCM_ALAW) {
130  at->pkt_size *= 1024;
131  avctx->frame_size *= 1024;
132  }
133 }
134 
135 static int read_descr(GetByteContext *gb, int *tag)
136 {
137  int len = 0;
138  int count = 4;
139  *tag = bytestream2_get_byte(gb);
140  while (count--) {
141  int c = bytestream2_get_byte(gb);
142  len = (len << 7) | (c & 0x7f);
143  if (!(c & 0x80))
144  break;
145  }
146  return len;
147 }
148 
149 static int get_ilbc_mode(AVCodecContext *avctx)
150 {
151  if (avctx->block_align == 38)
152  return 20;
153  else if (avctx->block_align == 50)
154  return 30;
155  else if (avctx->bit_rate > 0)
156  return avctx->bit_rate <= 14000 ? 30 : 20;
157  else
158  return 30;
159 }
160 
162 {
163  uint64_t map = 1 << channel;
164  if (map <= AV_CH_LOW_FREQUENCY)
165  return channel + 1;
166  else if (map <= AV_CH_BACK_RIGHT)
167  return channel + 29;
168  else if (map <= AV_CH_BACK_CENTER)
169  return channel - 1;
170  else if (map <= AV_CH_SIDE_RIGHT)
171  return channel - 4;
172  else if (map <= AV_CH_TOP_BACK_RIGHT)
173  return channel + 1;
174  else if (map <= AV_CH_STEREO_RIGHT)
175  return -1;
176  else if (map <= AV_CH_WIDE_RIGHT)
177  return channel + 4;
178  else if (map <= AV_CH_SURROUND_DIRECT_RIGHT)
179  return channel - 23;
180  else if (map == AV_CH_LOW_FREQUENCY_2)
181  return kAudioChannelLabel_LFE2;
182  else
183  return -1;
184 }
185 
186 static int remap_layout(AudioChannelLayout *layout, const AVChannelLayout *in_layout)
187 {
188  int i;
189  layout->mChannelLayoutTag = kAudioChannelLayoutTag_UseChannelDescriptions;
190  layout->mNumberChannelDescriptions = in_layout->nb_channels;
191  for (i = 0; i < in_layout->nb_channels; i++) {
192  int c, label;
193 
195  if (c < 0 || c >= 64)
196  return AVERROR(EINVAL);
197  label = get_channel_label(c);
198  layout->mChannelDescriptions[i].mChannelLabel = label;
199  if (label < 0)
200  return AVERROR(EINVAL);
201  c++;
202  }
203  return 0;
204 }
205 
206 static int get_aac_tag(const AVChannelLayout *in_layout)
207 {
208  static const struct {
209  AVChannelLayout chl;
210  int tag;
211  } map[] = {
212  { AV_CHANNEL_LAYOUT_MONO, kAudioChannelLayoutTag_Mono },
213  { AV_CHANNEL_LAYOUT_STEREO, kAudioChannelLayoutTag_Stereo },
214  { AV_CHANNEL_LAYOUT_QUAD, kAudioChannelLayoutTag_AAC_Quadraphonic },
215  { AV_CHANNEL_LAYOUT_OCTAGONAL, kAudioChannelLayoutTag_AAC_Octagonal },
216  { AV_CHANNEL_LAYOUT_SURROUND, kAudioChannelLayoutTag_AAC_3_0 },
217  { AV_CHANNEL_LAYOUT_4POINT0, kAudioChannelLayoutTag_AAC_4_0 },
218  { AV_CHANNEL_LAYOUT_5POINT0, kAudioChannelLayoutTag_AAC_5_0 },
219  { AV_CHANNEL_LAYOUT_5POINT1, kAudioChannelLayoutTag_AAC_5_1 },
220  { AV_CHANNEL_LAYOUT_6POINT0, kAudioChannelLayoutTag_AAC_6_0 },
221  { AV_CHANNEL_LAYOUT_6POINT1, kAudioChannelLayoutTag_AAC_6_1 },
222  { AV_CHANNEL_LAYOUT_7POINT0, kAudioChannelLayoutTag_AAC_7_0 },
223  { AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, kAudioChannelLayoutTag_AAC_7_1 },
224  { AV_CHANNEL_LAYOUT_7POINT1, kAudioChannelLayoutTag_MPEG_7_1_C },
225  };
226  int i;
227 
228  for (i = 0; i < FF_ARRAY_ELEMS(map); i++)
229  if (!av_channel_layout_compare(in_layout, &map[i].chl))
230  return map[i].tag;
231 
232  return 0;
233 }
234 
236 {
237  ATDecodeContext *at = avctx->priv_data;
238  OSStatus status;
239 
240  AudioStreamBasicDescription in_format = {
241  .mSampleRate = avctx->sample_rate,
242  .mFormatID = kAudioFormatLinearPCM,
243  .mFormatFlags = ((avctx->sample_fmt == AV_SAMPLE_FMT_FLT ||
244  avctx->sample_fmt == AV_SAMPLE_FMT_DBL) ? kAudioFormatFlagIsFloat
245  : avctx->sample_fmt == AV_SAMPLE_FMT_U8 ? 0
246  : kAudioFormatFlagIsSignedInteger)
247  | kAudioFormatFlagIsPacked,
248  .mBytesPerPacket = av_get_bytes_per_sample(avctx->sample_fmt) * avctx->ch_layout.nb_channels,
249  .mFramesPerPacket = 1,
250  .mBytesPerFrame = av_get_bytes_per_sample(avctx->sample_fmt) * avctx->ch_layout.nb_channels,
251  .mChannelsPerFrame = avctx->ch_layout.nb_channels,
252  .mBitsPerChannel = av_get_bytes_per_sample(avctx->sample_fmt) * 8,
253  };
254  AudioStreamBasicDescription out_format = {
255  .mSampleRate = avctx->sample_rate,
256  .mFormatID = ffat_get_format_id(avctx->codec_id, avctx->profile),
257  .mChannelsPerFrame = in_format.mChannelsPerFrame,
258  };
259  UInt32 layout_size = sizeof(AudioChannelLayout) +
260  sizeof(AudioChannelDescription) * avctx->ch_layout.nb_channels;
261  AudioChannelLayout *channel_layout = av_malloc(layout_size);
262 
263  if (!channel_layout)
264  return AVERROR(ENOMEM);
265 
266  if (avctx->codec_id == AV_CODEC_ID_ILBC) {
267  int mode = get_ilbc_mode(avctx);
268  out_format.mFramesPerPacket = 8000 * mode / 1000;
269  out_format.mBytesPerPacket = (mode == 20 ? 38 : 50);
270  }
271 
272  status = AudioConverterNew(&in_format, &out_format, &at->converter);
273 
274  if (status != 0) {
275  av_log(avctx, AV_LOG_ERROR, "AudioToolbox init error: %i\n", (int)status);
276  av_free(channel_layout);
277  return AVERROR_UNKNOWN;
278  }
279 
282 
283  if ((status = remap_layout(channel_layout, &avctx->ch_layout)) < 0) {
284  av_log(avctx, AV_LOG_ERROR, "Invalid channel layout\n");
285  av_free(channel_layout);
286  return status;
287  }
288 
289  if (AudioConverterSetProperty(at->converter, kAudioConverterInputChannelLayout,
290  layout_size, channel_layout)) {
291  av_log(avctx, AV_LOG_ERROR, "Unsupported input channel layout\n");
292  av_free(channel_layout);
293  return AVERROR(EINVAL);
294  }
295  if (avctx->codec_id == AV_CODEC_ID_AAC) {
296  int tag = get_aac_tag(&avctx->ch_layout);
297  if (tag) {
298  channel_layout->mChannelLayoutTag = tag;
299  channel_layout->mNumberChannelDescriptions = 0;
300  }
301  }
302  if (AudioConverterSetProperty(at->converter, kAudioConverterOutputChannelLayout,
303  layout_size, channel_layout)) {
304  av_log(avctx, AV_LOG_ERROR, "Unsupported output channel layout\n");
305  av_free(channel_layout);
306  return AVERROR(EINVAL);
307  }
308  av_free(channel_layout);
309 
310  if (avctx->bits_per_raw_sample)
311  AudioConverterSetProperty(at->converter,
312  kAudioConverterPropertyBitDepthHint,
313  sizeof(avctx->bits_per_raw_sample),
314  &avctx->bits_per_raw_sample);
315 
316 #if !TARGET_OS_IPHONE
317  if (at->mode == -1)
318  at->mode = (avctx->flags & AV_CODEC_FLAG_QSCALE) ?
319  kAudioCodecBitRateControlMode_Variable :
320  kAudioCodecBitRateControlMode_Constant;
321 
322  AudioConverterSetProperty(at->converter, kAudioCodecPropertyBitRateControlMode,
323  sizeof(at->mode), &at->mode);
324 
325  if (at->mode == kAudioCodecBitRateControlMode_Variable) {
326  int q = avctx->global_quality / FF_QP2LAMBDA;
327  if (q < 0 || q > 14) {
328  av_log(avctx, AV_LOG_WARNING,
329  "VBR quality %d out of range, should be 0-14\n", q);
330  q = av_clip(q, 0, 14);
331  }
332  q = 127 - q * 9;
333  AudioConverterSetProperty(at->converter, kAudioCodecPropertySoundQualityForVBR,
334  sizeof(q), &q);
335  } else
336 #endif
337  if (avctx->bit_rate > 0) {
338  UInt32 rate = avctx->bit_rate;
339  UInt32 size;
340  status = AudioConverterGetPropertyInfo(at->converter,
341  kAudioConverterApplicableEncodeBitRates,
342  &size, NULL);
343  if (!status && size) {
344  UInt32 new_rate = rate;
345  int count;
346  int i;
347  AudioValueRange *ranges = av_malloc(size);
348  if (!ranges)
349  return AVERROR(ENOMEM);
350  AudioConverterGetProperty(at->converter,
351  kAudioConverterApplicableEncodeBitRates,
352  &size, ranges);
353  count = size / sizeof(AudioValueRange);
354  for (i = 0; i < count; i++) {
355  AudioValueRange *range = &ranges[i];
356  if (rate >= range->mMinimum && rate <= range->mMaximum) {
357  new_rate = rate;
358  break;
359  } else if (rate > range->mMaximum) {
360  new_rate = range->mMaximum;
361  } else {
362  new_rate = range->mMinimum;
363  break;
364  }
365  }
366  if (new_rate != rate) {
367  av_log(avctx, AV_LOG_WARNING,
368  "Bitrate %u not allowed; changing to %u\n", rate, new_rate);
369  rate = new_rate;
370  }
371  av_free(ranges);
372  }
373  AudioConverterSetProperty(at->converter, kAudioConverterEncodeBitRate,
374  sizeof(rate), &rate);
375  }
376 
377  at->quality = 96 - at->quality * 32;
378  AudioConverterSetProperty(at->converter, kAudioConverterCodecQuality,
379  sizeof(at->quality), &at->quality);
380 
381  if (!AudioConverterGetPropertyInfo(at->converter, kAudioConverterCompressionMagicCookie,
382  &avctx->extradata_size, NULL) &&
383  avctx->extradata_size) {
384  int extradata_size = avctx->extradata_size;
385  uint8_t *extradata;
387  return AVERROR(ENOMEM);
388  if (avctx->codec_id == AV_CODEC_ID_ALAC) {
389  avctx->extradata_size = 0x24;
390  AV_WB32(avctx->extradata, 0x24);
391  AV_WB32(avctx->extradata + 4, MKBETAG('a','l','a','c'));
392  extradata = avctx->extradata + 12;
393  avctx->extradata_size = 0x24;
394  } else {
395  extradata = avctx->extradata;
396  }
397  status = AudioConverterGetProperty(at->converter,
398  kAudioConverterCompressionMagicCookie,
399  &extradata_size, extradata);
400  if (status != 0) {
401  av_log(avctx, AV_LOG_ERROR, "AudioToolbox cookie error: %i\n", (int)status);
402  return AVERROR_UNKNOWN;
403  } else if (avctx->codec_id == AV_CODEC_ID_AAC) {
404  GetByteContext gb;
405  int tag, len;
406  bytestream2_init(&gb, extradata, extradata_size);
407  do {
408  len = read_descr(&gb, &tag);
409  if (tag == MP4DecConfigDescrTag) {
410  bytestream2_skip(&gb, 13);
411  len = read_descr(&gb, &tag);
412  if (tag == MP4DecSpecificDescrTag) {
413  len = FFMIN(gb.buffer_end - gb.buffer, len);
414  memmove(extradata, gb.buffer, len);
415  avctx->extradata_size = len;
416  break;
417  }
418  } else if (tag == MP4ESDescrTag) {
419  int flags;
420  bytestream2_skip(&gb, 2);
421  flags = bytestream2_get_byte(&gb);
422  if (flags & 0x80) //streamDependenceFlag
423  bytestream2_skip(&gb, 2);
424  if (flags & 0x40) //URL_Flag
425  bytestream2_skip(&gb, bytestream2_get_byte(&gb));
426  if (flags & 0x20) //OCRstreamFlag
427  bytestream2_skip(&gb, 2);
428  }
429  } while (bytestream2_get_bytes_left(&gb));
430  } else if (avctx->codec_id != AV_CODEC_ID_ALAC) {
431  avctx->extradata_size = extradata_size;
432  }
433  }
434 
435  ffat_update_ctx(avctx);
436 
437 #if !TARGET_OS_IPHONE && defined(__MAC_10_9)
438  if (at->mode == kAudioCodecBitRateControlMode_Variable && avctx->rc_max_rate) {
439  UInt32 max_size = avctx->rc_max_rate * avctx->frame_size / avctx->sample_rate;
440  if (max_size)
441  AudioConverterSetProperty(at->converter, kAudioCodecPropertyPacketSizeLimitForVBR,
442  sizeof(max_size), &max_size);
443  }
444 #endif
445 
446  ff_af_queue_init(avctx, &at->afq);
447 
449  if (!at->encoding_frame)
450  return AVERROR(ENOMEM);
451 
452  return 0;
453 }
454 
455 static OSStatus ffat_encode_callback(AudioConverterRef converter, UInt32 *nb_packets,
456  AudioBufferList *data,
457  AudioStreamPacketDescription **packets,
458  void *inctx)
459 {
460  AVCodecContext *avctx = inctx;
461  ATDecodeContext *at = avctx->priv_data;
462  AVFrame *frame;
463  int ret;
464 
465  if (!at->frame_queue.available) {
466  if (at->eof) {
467  *nb_packets = 0;
468  return 0;
469  } else {
470  *nb_packets = 0;
471  return 1;
472  }
473  }
474 
476 
477  data->mNumberBuffers = 1;
478  data->mBuffers[0].mNumberChannels = avctx->ch_layout.nb_channels;
479  data->mBuffers[0].mDataByteSize = frame->nb_samples *
481  avctx->ch_layout.nb_channels;
482  data->mBuffers[0].mData = frame->data[0];
483  if (*nb_packets > frame->nb_samples)
484  *nb_packets = frame->nb_samples;
485 
487  if (ret < 0) {
488  *nb_packets = 0;
489  return ret;
490  }
491 
492  ff_bufqueue_add(avctx, &at->used_frame_queue, frame);
493 
494  return 0;
495 }
496 
497 static int ffat_encode(AVCodecContext *avctx, AVPacket *avpkt,
498  const AVFrame *frame, int *got_packet_ptr)
499 {
500  ATDecodeContext *at = avctx->priv_data;
501  OSStatus ret;
502 
503  AudioBufferList out_buffers = {
504  .mNumberBuffers = 1,
505  .mBuffers = {
506  {
507  .mNumberChannels = avctx->ch_layout.nb_channels,
508  .mDataByteSize = at->pkt_size,
509  }
510  }
511  };
512  AudioStreamPacketDescription out_pkt_desc = {0};
513 
514  if (frame) {
515  AVFrame *in_frame;
516 
517  if (ff_bufqueue_is_full(&at->frame_queue)) {
518  /*
519  * The frame queue is significantly larger than needed in practice,
520  * but no clear way to determine the minimum number of samples to
521  * get output from AudioConverterFillComplexBuffer().
522  */
523  av_log(avctx, AV_LOG_ERROR, "Bug: frame queue is too small.\n");
524  return AVERROR_BUG;
525  }
526 
527  if ((ret = ff_af_queue_add(&at->afq, frame)) < 0)
528  return ret;
529 
530  in_frame = av_frame_clone(frame);
531  if (!in_frame)
532  return AVERROR(ENOMEM);
533 
534  ff_bufqueue_add(avctx, &at->frame_queue, in_frame);
535  } else {
536  at->eof = 1;
537  }
538 
539  if ((ret = ff_alloc_packet(avctx, avpkt, at->pkt_size)) < 0)
540  return ret;
541 
542 
543  out_buffers.mBuffers[0].mData = avpkt->data;
544 
545  *got_packet_ptr = avctx->frame_size / at->frame_size;
546 
547  ret = AudioConverterFillComplexBuffer(at->converter, ffat_encode_callback, avctx,
548  got_packet_ptr, &out_buffers,
549  (avctx->frame_size > at->frame_size) ? NULL : &out_pkt_desc);
550 
552 
553  if ((!ret || ret == 1) && *got_packet_ptr) {
554  avpkt->size = out_buffers.mBuffers[0].mDataByteSize;
555  ff_af_queue_remove(&at->afq, out_pkt_desc.mVariableFramesInPacket ?
556  out_pkt_desc.mVariableFramesInPacket :
557  avctx->frame_size,
558  &avpkt->pts,
559  &avpkt->duration);
560  } else if (ret && ret != 1) {
561  av_log(avctx, AV_LOG_ERROR, "Encode error: %i\n", ret);
562  return AVERROR_EXTERNAL;
563  }
564 
565  return 0;
566 }
567 
569 {
570  ATDecodeContext *at = avctx->priv_data;
571  AudioConverterReset(at->converter);
574 }
575 
577 {
578  ATDecodeContext *at = avctx->priv_data;
579  AudioConverterDispose(at->converter);
582  ff_af_queue_close(&at->afq);
584  return 0;
585 }
586 
587 static const AVProfile aac_profiles[] = {
588  { AV_PROFILE_AAC_LOW, "LC" },
589  { AV_PROFILE_AAC_HE, "HE-AAC" },
590  { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
591  { AV_PROFILE_AAC_LD, "LD" },
592  { AV_PROFILE_AAC_ELD, "ELD" },
593  { AV_PROFILE_UNKNOWN },
594 };
595 
596 #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
597 static const AVOption options[] = {
598 #if !TARGET_OS_IPHONE
599  {"aac_at_mode", "ratecontrol mode", offsetof(ATDecodeContext, mode), AV_OPT_TYPE_INT, {.i64 = -1}, -1, kAudioCodecBitRateControlMode_Variable, AE, "mode"},
600  {"auto", "VBR if global quality is given; CBR otherwise", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, INT_MIN, INT_MAX, AE, "mode"},
601  {"cbr", "constant bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = kAudioCodecBitRateControlMode_Constant}, INT_MIN, INT_MAX, AE, "mode"},
602  {"abr", "long-term average bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = kAudioCodecBitRateControlMode_LongTermAverage}, INT_MIN, INT_MAX, AE, "mode"},
603  {"cvbr", "constrained variable bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = kAudioCodecBitRateControlMode_VariableConstrained}, INT_MIN, INT_MAX, AE, "mode"},
604  {"vbr" , "variable bitrate", 0, AV_OPT_TYPE_CONST, {.i64 = kAudioCodecBitRateControlMode_Variable}, INT_MIN, INT_MAX, AE, "mode"},
605 #endif
606  {"aac_at_quality", "quality vs speed control", offsetof(ATDecodeContext, quality), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 2, AE},
607  { NULL },
608 };
609 
610 #define FFAT_ENC_CLASS(NAME) \
611  static const AVClass ffat_##NAME##_enc_class = { \
612  .class_name = "at_" #NAME "_enc", \
613  .item_name = av_default_item_name, \
614  .option = options, \
615  .version = LIBAVUTIL_VERSION_INT, \
616  };
617 
618 #define FFAT_ENC(NAME, ID, PROFILES, CAPS, CHANNEL_LAYOUTS, CH_LAYOUTS) \
619  FFAT_ENC_CLASS(NAME) \
620  const FFCodec ff_##NAME##_at_encoder = { \
621  .p.name = #NAME "_at", \
622  CODEC_LONG_NAME(#NAME " (AudioToolbox)"), \
623  .p.type = AVMEDIA_TYPE_AUDIO, \
624  .p.id = ID, \
625  .priv_data_size = sizeof(ATDecodeContext), \
626  .init = ffat_init_encoder, \
627  .close = ffat_close_encoder, \
628  FF_CODEC_ENCODE_CB(ffat_encode), \
629  .flush = ffat_encode_flush, \
630  .p.priv_class = &ffat_##NAME##_enc_class, \
631  .p.capabilities = AV_CODEC_CAP_DELAY | \
632  AV_CODEC_CAP_ENCODER_FLUSH CAPS, \
633  CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(CHANNEL_LAYOUTS) \
634  .p.ch_layouts = CH_LAYOUTS, \
635  .p.sample_fmts = (const enum AVSampleFormat[]) { \
636  AV_SAMPLE_FMT_S16, \
637  AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE \
638  }, \
639  .p.profiles = PROFILES, \
640  .p.wrapper_name = "at", \
641  };
642 
656  { 0 },
657 };
658 
659 #if FF_API_OLD_CHANNEL_LAYOUT
660 static const uint64_t aac_at_channel_layouts[] = {
673  0,
674 };
675 #endif
676 
677 FFAT_ENC(aac, AV_CODEC_ID_AAC, aac_profiles, , aac_at_channel_layouts, aac_at_ch_layouts)
678 //FFAT_ENC(adpcm_ima_qt, AV_CODEC_ID_ADPCM_IMA_QT, NULL)
AV_CH_LAYOUT_7POINT0
#define AV_CH_LAYOUT_7POINT0
Definition: channel_layout.h:231
read_descr
static int read_descr(GetByteContext *gb, int *tag)
Definition: audiotoolboxenc.c:135
AVCodecContext::frame_size
int frame_size
Number of samples per channel in an audio frame.
Definition: avcodec.h:1092
AV_CH_LAYOUT_6POINT1
#define AV_CH_LAYOUT_6POINT1
Definition: channel_layout.h:228
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
AV_CH_LAYOUT_7POINT1_WIDE_BACK
#define AV_CH_LAYOUT_7POINT1_WIDE_BACK
Definition: channel_layout.h:235
AV_CODEC_ID_ADPCM_IMA_QT
@ AV_CODEC_ID_ADPCM_IMA_QT
Definition: codec_id.h:369
MP4DecConfigDescrTag
#define MP4DecConfigDescrTag
Definition: isom.h:341
FFAT_ENC
#define FFAT_ENC(NAME, ID, PROFILES, CAPS, CHANNEL_LAYOUTS, CH_LAYOUTS)
Definition: audiotoolboxenc.c:618
av_clip
#define av_clip
Definition: common.h:96
AV_CHANNEL_LAYOUT_OCTAGONAL
#define AV_CHANNEL_LAYOUT_OCTAGONAL
Definition: channel_layout.h:409
get_channel_label
static av_cold int get_channel_label(int channel)
Definition: audiotoolboxenc.c:161
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
opt.h
ff_af_queue_remove
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, int64_t *duration)
Remove frame(s) from the queue.
Definition: audio_frame_queue.c:75
AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_STEREO
Definition: channel_layout.h:383
AVCodecContext::sample_rate
int sample_rate
samples per second
Definition: avcodec.h:1064
GetByteContext
Definition: bytestream.h:33
AV_CH_LOW_FREQUENCY_2
#define AV_CH_LOW_FREQUENCY_2
Definition: channel_layout.h:188
ff_af_queue_close
void ff_af_queue_close(AudioFrameQueue *afq)
Close AudioFrameQueue.
Definition: audio_frame_queue.c:36
AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_MONO
Definition: channel_layout.h:210
AV_CODEC_FLAG_QSCALE
#define AV_CODEC_FLAG_QSCALE
Use fixed qscale.
Definition: avcodec.h:220
ff_af_queue_init
av_cold void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq)
Initialize AudioFrameQueue.
Definition: audio_frame_queue.c:28
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:100
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:340
av_channel_layout_channel_from_index
enum AVChannel av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx)
Get the channel with the given index in a channel layout.
Definition: channel_layout.c:806
internal.h
AVPacket::data
uint8_t * data
Definition: packet.h:491
AVOption
AVOption.
Definition: opt.h:251
encode.h
data
const char data[16]
Definition: mxf.c:148
AV_CODEC_ID_ALAC
@ AV_CODEC_ID_ALAC
Definition: codec_id.h:458
ffat_init_encoder
static av_cold int ffat_init_encoder(AVCodecContext *avctx)
Definition: audiotoolboxenc.c:235
get_ilbc_mode
static int get_ilbc_mode(AVCodecContext *avctx)
Definition: audiotoolboxenc.c:149
aac_profiles
static const AVProfile aac_profiles[]
Definition: audiotoolboxenc.c:587
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:509
AVChannelLayout::order
enum AVChannelOrder order
Channel order used in this layout.
Definition: channel_layout.h:312
AVERROR_UNKNOWN
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
Definition: error.h:73
ffat_get_format_id
static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
Definition: audiotoolboxenc.c:58
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:317
quality
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about quality
Definition: rate_distortion.txt:12
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:361
ff_bufqueue_get
static AVFrame * ff_bufqueue_get(struct FFBufQueue *queue)
Get the first buffer from the queue and remove it.
Definition: bufferqueue.h:98
AV_CH_SURROUND_DIRECT_RIGHT
#define AV_CH_SURROUND_DIRECT_RIGHT
Definition: channel_layout.h:187
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:30
AV_CH_WIDE_RIGHT
#define AV_CH_WIDE_RIGHT
Definition: channel_layout.h:185
AVProfile
AVProfile.
Definition: codec.h:179
AV_CH_LAYOUT_6POINT0
#define AV_CH_LAYOUT_6POINT0
Definition: channel_layout.h:224
bytestream2_skip
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:168
ATDecodeContext::used_frame_queue
struct FFBufQueue used_frame_queue
Definition: audiotoolboxenc.c:48
ATDecodeContext::frame_size
int frame_size
Definition: audiotoolboxenc.c:53
ffat_close_encoder
static av_cold int ffat_close_encoder(AVCodecContext *avctx)
Definition: audiotoolboxenc.c:576
ATDecodeContext::eof
int eof
Definition: audiotoolboxdec.c:56
MP4DecSpecificDescrTag
#define MP4DecSpecificDescrTag
Definition: isom.h:342
AVCodecContext::ch_layout
AVChannelLayout ch_layout
Audio channel layout.
Definition: avcodec.h:2107
AE
#define AE
Definition: audiotoolboxenc.c:596
remap_layout
static int remap_layout(AudioChannelLayout *layout, const AVChannelLayout *in_layout)
Definition: audiotoolboxenc.c:186
audio_frame_queue.h
AVCodecContext::initial_padding
int initial_padding
Audio only.
Definition: avcodec.h:1794
AVCodecContext::flags
int flags
AV_CODEC_FLAG_*.
Definition: avcodec.h:521
ffat_encode_callback
static OSStatus ffat_encode_callback(AudioConverterRef converter, UInt32 *nb_packets, AudioBufferList *data, AudioStreamPacketDescription **packets, void *inctx)
Definition: audiotoolboxenc.c:455
ff_af_queue_add
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
Add a frame to the queue.
Definition: audio_frame_queue.c:44
ATDecodeContext::mode
int mode
Definition: audiotoolboxenc.c:43
AV_CH_LAYOUT_STEREO
#define AV_CH_LAYOUT_STEREO
Definition: channel_layout.h:211
AV_CHANNEL_LAYOUT_SURROUND
#define AV_CHANNEL_LAYOUT_SURROUND
Definition: channel_layout.h:386
AV_CH_LAYOUT_QUAD
#define AV_CH_LAYOUT_QUAD
Definition: channel_layout.h:219
ff_bufqueue_is_full
static int ff_bufqueue_is_full(struct FFBufQueue *queue)
Test if a buffer queue is full.
Definition: bufferqueue.h:60
av_frame_alloc
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:88
options
static const AVOption options[]
Definition: audiotoolboxenc.c:597
avassert.h
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
av_cold
#define av_cold
Definition: attributes.h:90
AV_PROFILE_UNKNOWN
#define AV_PROFILE_UNKNOWN
Definition: defs.h:65
AV_CH_LOW_FREQUENCY
#define AV_CH_LOW_FREQUENCY
Definition: channel_layout.h:167
AV_CHANNEL_LAYOUT_4POINT0
#define AV_CHANNEL_LAYOUT_4POINT0
Definition: channel_layout.h:388
AVCodecContext::extradata_size
int extradata_size
Definition: avcodec.h:543
AV_CHANNEL_LAYOUT_7POINT1
#define AV_CHANNEL_LAYOUT_7POINT1
Definition: channel_layout.h:405
AVCodecContext::global_quality
int global_quality
Global quality for codecs which cannot change it per frame.
Definition: avcodec.h:507
AV_CHANNEL_ORDER_UNSPEC
@ AV_CHANNEL_ORDER_UNSPEC
Only the channel count is specified, without any further information about the channel order.
Definition: channel_layout.h:112
GetByteContext::buffer
const uint8_t * buffer
Definition: bytestream.h:34
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
AudioFrameQueue
Definition: audio_frame_queue.h:32
AVCodecContext::bits_per_raw_sample
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition: avcodec.h:1517
ATDecodeContext::encoding_frame
AVFrame * encoding_frame
Definition: audiotoolboxenc.c:55
AV_PROFILE_AAC_ELD
#define AV_PROFILE_AAC_ELD
Definition: defs.h:75
av_frame_clone
AVFrame * av_frame_clone(const AVFrame *src)
Create a new frame that references the same data as src.
Definition: frame.c:609
AV_CODEC_ID_PCM_MULAW
@ AV_CODEC_ID_PCM_MULAW
Definition: codec_id.h:336
AVCodecContext::rc_max_rate
int64_t rc_max_rate
maximum bitrate
Definition: avcodec.h:1284
frame
static AVFrame * frame
Definition: demux_decode.c:54
AVCodecContext::codec_id
enum AVCodecID codec_id
Definition: avcodec.h:451
AV_CH_STEREO_RIGHT
#define AV_CH_STEREO_RIGHT
Definition: channel_layout.h:183
AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK
#define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK
Definition: channel_layout.h:407
MP4ESDescrTag
#define MP4ESDescrTag
Definition: isom.h:340
AV_CODEC_ID_PCM_ALAW
@ AV_CODEC_ID_PCM_ALAW
Definition: codec_id.h:337
ATDecodeContext::quality
int quality
Definition: audiotoolboxenc.c:44
get_aac_tag
static int get_aac_tag(const AVChannelLayout *in_layout)
Definition: audiotoolboxenc.c:206
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
isom.h
ffat_update_ctx
static void ffat_update_ctx(AVCodecContext *avctx)
Definition: audiotoolboxenc.c:95
AVCodecContext::bit_rate
int64_t bit_rate
the average bitrate
Definition: avcodec.h:491
ff_bufqueue_discard_all
static void ff_bufqueue_discard_all(struct FFBufQueue *queue)
Unref and remove all buffers from the queue.
Definition: bufferqueue.h:111
AV_CH_LAYOUT_5POINT1
#define AV_CH_LAYOUT_5POINT1
Definition: channel_layout.h:221
AV_CODEC_CAP_VARIABLE_FRAME_SIZE
#define AV_CODEC_CAP_VARIABLE_FRAME_SIZE
Audio encoder supports receiving a different number of samples in each call.
Definition: codec.h:128
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
bytestream2_get_bytes_left
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:158
AVCodecID
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: codec_id.h:49
AV_WB32
#define AV_WB32(p, v)
Definition: intreadwrite.h:417
AV_CODEC_ID_AAC
@ AV_CODEC_ID_AAC
Definition: codec_id.h:444
bufferqueue.h
AVPacket::size
int size
Definition: packet.h:492
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:307
codec_internal.h
AV_PROFILE_AAC_LD
#define AV_PROFILE_AAC_LD
Definition: defs.h:74
AVCodecContext::sample_fmt
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:1080
size
int size
Definition: twinvq_data.h:10344
MKBETAG
#define MKBETAG(a, b, c, d)
Definition: macros.h:56
range
enum AVColorRange range
Definition: mediacodec_wrapper.c:2646
AV_CHANNEL_LAYOUT_6POINT0
#define AV_CHANNEL_LAYOUT_6POINT0
Definition: channel_layout.h:396
AVERROR_EXTERNAL
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition: error.h:59
ff_bufqueue_add
static void ff_bufqueue_add(void *log, struct FFBufQueue *queue, AVFrame *buf)
Add a buffer to the queue.
Definition: bufferqueue.h:71
AV_CH_TOP_BACK_RIGHT
#define AV_CH_TOP_BACK_RIGHT
Definition: channel_layout.h:181
av_channel_layout_compare
int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1)
Check whether two channel layouts are semantically the same, i.e.
Definition: channel_layout.c:942
av_channel_layout_default
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
Definition: channel_layout.c:972
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
AV_CH_LAYOUT_OCTAGONAL
#define AV_CH_LAYOUT_OCTAGONAL
Definition: channel_layout.h:237
AV_CH_LAYOUT_5POINT0
#define AV_CH_LAYOUT_5POINT0
Definition: channel_layout.h:220
AVFrame::nb_samples
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:420
log.h
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:484
av_get_bytes_per_sample
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
Definition: samplefmt.c:108
AVCodecContext::extradata
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:542
FFBufQueue
Structure holding the queue.
Definition: bufferqueue.h:49
AV_CHANNEL_LAYOUT_QUAD
#define AV_CHANNEL_LAYOUT_QUAD
Definition: channel_layout.h:391
AV_SAMPLE_FMT_U8
@ AV_SAMPLE_FMT_U8
unsigned 8 bits
Definition: samplefmt.h:57
FFBufQueue::available
unsigned short available
number of available buffers
Definition: bufferqueue.h:52
AV_CH_BACK_CENTER
#define AV_CH_BACK_CENTER
Definition: channel_layout.h:172
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
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:254
AV_CH_SIDE_RIGHT
#define AV_CH_SIDE_RIGHT
Definition: channel_layout.h:174
len
int len
Definition: vorbis_enc_data.h:426
profile
int profile
Definition: mxfenc.c:2115
GetByteContext::buffer_end
const uint8_t * buffer_end
Definition: bytestream.h:34
avcodec.h
tag
uint32_t tag
Definition: movenc.c:1737
ret
ret
Definition: filter_design.txt:187
AVCodecContext::block_align
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs.
Definition: avcodec.h:1113
AV_CH_LAYOUT_SURROUND
#define AV_CH_LAYOUT_SURROUND
Definition: channel_layout.h:214
ffat_encode_flush
static av_cold void ffat_encode_flush(AVCodecContext *avctx)
Definition: audiotoolboxenc.c:568
AV_CHANNEL_LAYOUT_7POINT0
#define AV_CHANNEL_LAYOUT_7POINT0
Definition: channel_layout.h:403
AV_INPUT_BUFFER_PADDING_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
Definition: defs.h:40
AV_PROFILE_AAC_LOW
#define AV_PROFILE_AAC_LOW
Definition: defs.h:69
av_frame_replace
int av_frame_replace(AVFrame *dst, const AVFrame *src)
Ensure the destination frame refers to the same data described by the source frame,...
Definition: frame.c:482
ATDecodeContext::converter
AudioConverterRef converter
Definition: audiotoolboxdec.c:45
AVCodecContext
main external API structure.
Definition: avcodec.h:441
status
ov_status_e status
Definition: dnn_backend_openvino.c:119
channel_layout.h
AV_PROFILE_AAC_HE_V2
#define AV_PROFILE_AAC_HE_V2
Definition: defs.h:73
ffat_encode
static int ffat_encode(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr)
Definition: audiotoolboxenc.c:497
mode
mode
Definition: ebur128.h:83
ATDecodeContext
Definition: audiotoolboxdec.c:42
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1596
map
const VDPAUPixFmtMap * map
Definition: hwcontext_vdpau.c:71
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:382
AV_PROFILE_AAC_HE
#define AV_PROFILE_AAC_HE
Definition: defs.h:72
av_free
#define av_free(p)
Definition: tableprint_vlc.h:33
AVPacket
This structure stores compressed data.
Definition: packet.h:468
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:468
aac_at_ch_layouts
static const AVChannelLayout aac_at_ch_layouts[]
Definition: audiotoolboxenc.c:643
ATDecodeContext::pkt_size
unsigned pkt_size
Definition: audiotoolboxenc.c:50
AV_CH_LAYOUT_4POINT0
#define AV_CH_LAYOUT_4POINT0
Definition: channel_layout.h:216
AV_CODEC_ID_ILBC
@ AV_CODEC_ID_ILBC
Definition: codec_id.h:501
bytestream.h
ATDecodeContext::av_class
AVClass * av_class
Definition: audiotoolboxdec.c:43
bytestream2_init
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:137
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
AVERROR_BUG
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:52
ATDecodeContext::afq
AudioFrameQueue afq
Definition: audiotoolboxenc.c:51
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AV_CHANNEL_LAYOUT_6POINT1
#define AV_CHANNEL_LAYOUT_6POINT1
Definition: channel_layout.h:400
AV_CH_BACK_RIGHT
#define AV_CH_BACK_RIGHT
Definition: channel_layout.h:169
AV_CHANNEL_LAYOUT_5POINT0
#define AV_CHANNEL_LAYOUT_5POINT0
Definition: channel_layout.h:392
AV_SAMPLE_FMT_DBL
@ AV_SAMPLE_FMT_DBL
double
Definition: samplefmt.h:61
FF_QP2LAMBDA
#define FF_QP2LAMBDA
factor to convert from H.263 QP to lambda
Definition: avutil.h:227
AV_CHANNEL_LAYOUT_5POINT1
#define AV_CHANNEL_LAYOUT_5POINT1
Definition: channel_layout.h:393
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
ff_alloc_packet
int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and allocate data.
Definition: encode.c:61
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:60
channel
channel
Definition: ebur128.h:39
ATDecodeContext::frame_queue
struct FFBufQueue frame_queue
Definition: audiotoolboxenc.c:47