FFmpeg
Loading...
Searching...
No Matches
audiotoolboxdec.c File Reference
#include <AudioToolbox/AudioToolbox.h>
#include "config.h"
#include "config_components.h"
#include "avcodec.h"
#include "ac3_parser_internal.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "mpegaudiodecheader.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/log.h"

Go to the source code of this file.

Data Structures

struct  ATDecodeContext
 

Macros

#define kAudioFormatEnhancedAC3   'ec-3'
 
#define COPY_SAMPLES(type)
 
#define FFAT_DEC_CLASS(NAME)
 
#define FFAT_DEC(NAME, ID, bsf_name)
 

Functions

static UInt32 ffat_get_format_id (enum AVCodecID codec, int profile)
 
static int ffat_get_channel_id (AudioChannelLabel label)
 
static int ffat_compare_channel_descriptions (const void *a, const void *b)
 
static AudioChannelLayout * ffat_convert_layout (AudioChannelLayout *layout, UInt32 *size)
 
static int ffat_update_ctx (AVCodecContext *avctx)
 
static void put_descr (PutByteContext *pb, int tag, unsigned int size)
 
static uint8_t * ffat_get_magic_cookie (AVCodecContext *avctx, UInt32 *cookie_size)
 
static av_cold int ffat_usable_extradata (AVCodecContext *avctx)
 
static int ffat_set_extradata (AVCodecContext *avctx)
 
static av_cold int ffat_create_decoder (AVCodecContext *avctx, const AVPacket *pkt)
 
static av_cold int ffat_init_decoder (AVCodecContext *avctx)
 
static OSStatus ffat_decode_callback (AudioConverterRef converter, UInt32 *nb_packets, AudioBufferList *data, AudioStreamPacketDescription **packets, void *inctx)
 
static void ffat_copy_samples (AVCodecContext *avctx, AVFrame *frame)
 
static int ffat_decode (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
 
static av_cold void ffat_decode_flush (AVCodecContext *avctx)
 
static av_cold int ffat_close_decoder (AVCodecContext *avctx)
 

Macro Definition Documentation

◆ kAudioFormatEnhancedAC3

#define kAudioFormatEnhancedAC3   'ec-3'

Definition at line 40 of file audiotoolboxdec.c.

Referenced by ffat_get_format_id().

◆ COPY_SAMPLES

#define COPY_SAMPLES ( type)
Value:
type *in_ptr = (type*)at->decoded_data; \
type *end_ptr = in_ptr + frame->nb_samples * avctx->ch_layout.nb_channels; \
type *out_ptr = (type*)frame->data[0]; \
for (; in_ptr < end_ptr; in_ptr += avctx->ch_layout.nb_channels, out_ptr += avctx->ch_layout.nb_channels) { \
int c; \
for (c = 0; c < avctx->ch_layout.nb_channels; c++) \
out_ptr[c] = in_ptr[at->channel_map[c]]; \
}
static AVFrame * frame
cl_device_type type
static double c[64]

Definition at line 469 of file audiotoolboxdec.c.

Referenced by ffat_copy_samples().

◆ FFAT_DEC_CLASS

#define FFAT_DEC_CLASS ( NAME)
Value:
static const AVClass ffat_##NAME##_dec_class = { \
.class_name = "at_" #NAME "_dec", \
.version = LIBAVUTIL_VERSION_INT, \
};
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
Describe the class of an AVClass context structure.
Definition log.h:76

Definition at line 589 of file audiotoolboxdec.c.

◆ FFAT_DEC

#define FFAT_DEC ( NAME,
ID,
bsf_name )
Value:
const FFCodec ff_##NAME##_at_decoder = { \
.p.name = #NAME "_at", \
CODEC_LONG_NAME(#NAME " (AudioToolbox)"), \
.p.type = AVMEDIA_TYPE_AUDIO, \
.p.id = ID, \
.priv_data_size = sizeof(ATDecodeContext), \
.flush = ffat_decode_flush, \
.p.priv_class = &ffat_##NAME##_dec_class, \
.bsfs = bsf_name, \
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \
.p.wrapper_name = "at", \
};
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
static int ffat_decode(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
static av_cold void ffat_decode_flush(AVCodecContext *avctx)
static av_cold int ffat_close_decoder(AVCodecContext *avctx)
#define FFAT_DEC_CLASS(NAME)
static av_cold int ffat_init_decoder(AVCodecContext *avctx)
#define FF_CODEC_DECODE_CB(func)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition codec.h:79
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
Definition codec.h:94
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
#define ID(_0)
Definition mov_chan.c:124

Definition at line 595 of file audiotoolboxdec.c.

Function Documentation

◆ ffat_get_format_id()

static UInt32 ffat_get_format_id ( enum AVCodecID codec,
int profile )
static

Definition at line 60 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder().

◆ ffat_get_channel_id()

static int ffat_get_channel_id ( AudioChannelLabel label)
static

Definition at line 101 of file audiotoolboxdec.c.

Referenced by ffat_compare_channel_descriptions(), and ffat_update_ctx().

◆ ffat_compare_channel_descriptions()

static int ffat_compare_channel_descriptions ( const void * a,
const void * b )
static

Definition at line 129 of file audiotoolboxdec.c.

Referenced by ffat_update_ctx().

◆ ffat_convert_layout()

static AudioChannelLayout * ffat_convert_layout ( AudioChannelLayout * layout,
UInt32 * size )
static

Definition at line 136 of file audiotoolboxdec.c.

Referenced by ffat_update_ctx().

◆ ffat_update_ctx()

static int ffat_update_ctx ( AVCodecContext * avctx)
static

Definition at line 164 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder().

◆ put_descr()

static void put_descr ( PutByteContext * pb,
int tag,
unsigned int size )
static

Definition at line 225 of file audiotoolboxdec.c.

Referenced by ffat_get_magic_cookie().

◆ ffat_get_magic_cookie()

static uint8_t * ffat_get_magic_cookie ( AVCodecContext * avctx,
UInt32 * cookie_size )
static

Definition at line 234 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder(), and ffat_set_extradata().

◆ ffat_usable_extradata()

static av_cold int ffat_usable_extradata ( AVCodecContext * avctx)
static

Definition at line 274 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder(), ffat_init_decoder(), and ffat_set_extradata().

◆ ffat_set_extradata()

static int ffat_set_extradata ( AVCodecContext * avctx)
static

Definition at line 284 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder().

◆ ffat_create_decoder()

static av_cold int ffat_create_decoder ( AVCodecContext * avctx,
const AVPacket * pkt )
static

Definition at line 306 of file audiotoolboxdec.c.

Referenced by ffat_decode(), and ffat_init_decoder().

◆ ffat_init_decoder()

static av_cold int ffat_init_decoder ( AVCodecContext * avctx)
static

Definition at line 413 of file audiotoolboxdec.c.

◆ ffat_decode_callback()

static OSStatus ffat_decode_callback ( AudioConverterRef converter,
UInt32 * nb_packets,
AudioBufferList * data,
AudioStreamPacketDescription ** packets,
void * inctx )
static

Definition at line 430 of file audiotoolboxdec.c.

Referenced by ffat_decode().

◆ ffat_copy_samples()

static void ffat_copy_samples ( AVCodecContext * avctx,
AVFrame * frame )
static

Definition at line 479 of file audiotoolboxdec.c.

Referenced by ffat_decode().

◆ ffat_decode()

static int ffat_decode ( AVCodecContext * avctx,
AVFrame * frame,
int * got_frame_ptr,
AVPacket * avpkt )
static

Definition at line 489 of file audiotoolboxdec.c.

◆ ffat_decode_flush()

static av_cold void ffat_decode_flush ( AVCodecContext * avctx)
static

Definition at line 569 of file audiotoolboxdec.c.

◆ ffat_close_decoder()

static av_cold int ffat_close_decoder ( AVCodecContext * avctx)
static

Definition at line 577 of file audiotoolboxdec.c.