FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
audiotoolboxdec.c File Reference
#include <AudioToolbox/AudioToolbox.h>
#include "config.h"
#include "avcodec.h"
#include "ac3_parser_internal.h"
#include "bytestream.h"
#include "internal.h"
#include "mpegaudiodecheader.h"
#include "libavutil/avassert.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_tffat_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, 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, void *data, 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

#define kAudioFormatEnhancedAC3   'ec-3'

Definition at line 36 of file audiotoolboxdec.c.

Referenced by ffat_get_format_id().

#define COPY_SAMPLES (   type)
Value:
type *in_ptr = (type*)at->decoded_data; \
type *end_ptr = in_ptr + frame->nb_samples * avctx->channels; \
type *out_ptr = (type*)frame->data[0]; \
for (; in_ptr < end_ptr; in_ptr += avctx->channels, out_ptr += avctx->channels) { \
for (c = 0; c < avctx->channels; c++) \
out_ptr[c] = in_ptr[at->channel_map[c]]; \
}
static AVFrame * frame
GLint GLenum type
Definition: opengl_enc.c:105
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:215
int
static double c[64]
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:267
for(j=16;j >0;--j)

Definition at line 454 of file audiotoolboxdec.c.

Referenced by ffat_copy_samples().

#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
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
Describe the class of an AVClass context structure.
Definition: log.h:67

Definition at line 578 of file audiotoolboxdec.c.

#define FFAT_DEC (   NAME,
  ID,
  bsf_name 
)
Value:
AVCodec ff_##NAME##_at_decoder = { \
.name = #NAME "_at", \
.long_name = NULL_IF_CONFIG_SMALL(#NAME " (AudioToolbox)"), \
.type = AVMEDIA_TYPE_AUDIO, \
.id = ID, \
.priv_data_size = sizeof(ATDecodeContext), \
.close = ffat_close_decoder, \
.priv_class = &ffat_##NAME##_dec_class, \
.bsfs = bsf_name, \
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, \
};
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
#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: avcodec.h:981
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
static av_cold void ffat_decode_flush(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
#define FFAT_DEC_CLASS(NAME)
static av_cold int ffat_init_decoder(AVCodecContext *avctx)
#define ID(x)
Definition: cast5.c:29
static int ffat_decode(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static av_cold int ffat_close_decoder(AVCodecContext *avctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:956

Definition at line 584 of file audiotoolboxdec.c.

Function Documentation

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

Definition at line 56 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder().

static int ffat_get_channel_id ( AudioChannelLabel  label)
static

Definition at line 95 of file audiotoolboxdec.c.

Referenced by ffat_compare_channel_descriptions(), and ffat_update_ctx().

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

Definition at line 123 of file audiotoolboxdec.c.

Referenced by ffat_update_ctx().

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

Definition at line 130 of file audiotoolboxdec.c.

Referenced by ffat_update_ctx().

static int ffat_update_ctx ( AVCodecContext avctx)
static

Definition at line 158 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder().

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

Definition at line 218 of file audiotoolboxdec.c.

Referenced by ffat_get_magic_cookie().

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

Definition at line 227 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder(), and ffat_set_extradata().

static av_cold int ffat_usable_extradata ( AVCodecContext avctx)
static

Definition at line 267 of file audiotoolboxdec.c.

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

static int ffat_set_extradata ( AVCodecContext avctx)
static

Definition at line 277 of file audiotoolboxdec.c.

Referenced by ffat_create_decoder().

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

Definition at line 299 of file audiotoolboxdec.c.

Referenced by ffat_decode(), and ffat_init_decoder().

static av_cold int ffat_init_decoder ( AVCodecContext avctx)
static

Definition at line 398 of file audiotoolboxdec.c.

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

Definition at line 415 of file audiotoolboxdec.c.

Referenced by ffat_decode().

static void ffat_copy_samples ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 464 of file audiotoolboxdec.c.

Referenced by ffat_decode().

static int ffat_decode ( AVCodecContext avctx,
void data,
int got_frame_ptr,
AVPacket avpkt 
)
static

Definition at line 474 of file audiotoolboxdec.c.

static av_cold void ffat_decode_flush ( AVCodecContext avctx)
static

Definition at line 558 of file audiotoolboxdec.c.

static av_cold int ffat_close_decoder ( AVCodecContext avctx)
static

Definition at line 566 of file audiotoolboxdec.c.