FFmpeg
Data Structures | Macros | Functions | Variables
codec2.c File Reference
#include "config_components.h"
#include "libavcodec/codec2utils.h"
#include "libavutil/channel_layout.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "avio_internal.h"
#include "avformat.h"
#include "internal.h"
#include "mux.h"
#include "rawenc.h"
#include "pcm.h"

Go to the source code of this file.

Data Structures

struct  Codec2Context
 

Macros

#define CODEC2_HEADER_SIZE   7
 
#define CODEC2_MAGIC   0xC0DEC2
 
#define EXPECTED_CODEC2_MAJOR_VERSION   0
 
#define EXPECTED_CODEC2_MINOR_VERSION   8
 
#define FRAMES_PER_PACKET
 

Functions

static int codec2_probe (const AVProbeData *p)
 
static int codec2_mode_frame_size (AVFormatContext *s, int mode)
 
static int codec2_mode_block_align (AVFormatContext *s, int mode)
 
static int codec2_mode_bit_rate (AVFormatContext *s, int mode)
 
static int codec2_read_header_common (AVFormatContext *s, AVStream *st)
 
static int codec2_read_header (AVFormatContext *s)
 
static int codec2_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int codec2_write_header (AVFormatContext *s)
 
static int codec2raw_read_header (AVFormatContext *s)
 

Variables

static const AVOption codec2_options []
 
static const AVOption codec2raw_options []
 
static const AVClass codec2_demux_class
 
static const AVClass codec2raw_demux_class
 

Macro Definition Documentation

◆ CODEC2_HEADER_SIZE

#define CODEC2_HEADER_SIZE   7

Definition at line 35 of file codec2.c.

◆ CODEC2_MAGIC

#define CODEC2_MAGIC   0xC0DEC2

Definition at line 36 of file codec2.c.

◆ EXPECTED_CODEC2_MAJOR_VERSION

#define EXPECTED_CODEC2_MAJOR_VERSION   0

Definition at line 40 of file codec2.c.

◆ EXPECTED_CODEC2_MINOR_VERSION

#define EXPECTED_CODEC2_MINOR_VERSION   8

Definition at line 41 of file codec2.c.

◆ FRAMES_PER_PACKET

#define FRAMES_PER_PACKET
Value:
{ "frames_per_packet", "Number of frames to read at a time. Higher = faster decoding, lower granularity", \
offsetof(Codec2Context, frames_per_packet), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM}

Definition at line 265 of file codec2.c.

Function Documentation

◆ codec2_probe()

static int codec2_probe ( const AVProbeData p)
static

Definition at line 49 of file codec2.c.

◆ codec2_mode_frame_size()

static int codec2_mode_frame_size ( AVFormatContext s,
int  mode 
)
static

Definition at line 68 of file codec2.c.

Referenced by codec2_mode_bit_rate(), and codec2_read_header_common().

◆ codec2_mode_block_align()

static int codec2_mode_block_align ( AVFormatContext s,
int  mode 
)
static

Definition at line 91 of file codec2.c.

Referenced by codec2_mode_bit_rate(), and codec2_read_header_common().

◆ codec2_mode_bit_rate()

static int codec2_mode_bit_rate ( AVFormatContext s,
int  mode 
)
static

Definition at line 115 of file codec2.c.

Referenced by codec2_read_header_common().

◆ codec2_read_header_common()

static int codec2_read_header_common ( AVFormatContext s,
AVStream st 
)
static

Definition at line 127 of file codec2.c.

Referenced by codec2_read_header(), and codec2raw_read_header().

◆ codec2_read_header()

static int codec2_read_header ( AVFormatContext s)
static

Definition at line 151 of file codec2.c.

◆ codec2_read_packet()

static int codec2_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 186 of file codec2.c.

◆ codec2_write_header()

static int codec2_write_header ( AVFormatContext s)
static

Definition at line 214 of file codec2.c.

◆ codec2raw_read_header()

static int codec2raw_read_header ( AVFormatContext s)
static

Definition at line 237 of file codec2.c.

Variable Documentation

◆ codec2_options

const AVOption codec2_options[]
static
Initial value:
= {
{ NULL },
}

Definition at line 269 of file codec2.c.

◆ codec2raw_options

const AVOption codec2raw_options[]
static
Initial value:
= {
CODEC2_AVOPTIONS("codec2 mode [mandatory]", Codec2Context, -1, -1, AV_OPT_FLAG_DECODING_PARAM),
{ NULL },
}

Definition at line 274 of file codec2.c.

◆ codec2_demux_class

const AVClass codec2_demux_class
static
Initial value:
= {
.class_name = "codec2 demuxer",
.item_name = av_default_item_name,
.option = codec2_options,
}

Definition at line 280 of file codec2.c.

◆ codec2raw_demux_class

const AVClass codec2raw_demux_class
static
Initial value:
= {
.class_name = "codec2raw demuxer",
.item_name = av_default_item_name,
.option = codec2raw_options,
}

Definition at line 288 of file codec2.c.

codec2_options
static const AVOption codec2_options[]
Definition: codec2.c:269
AV_CLASS_CATEGORY_DEMUXER
@ AV_CLASS_CATEGORY_DEMUXER
Definition: log.h:33
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
CODEC2_AVOPTIONS
#define CODEC2_AVOPTIONS(desc, classname, min_val, default_val, option_flags)
Definition: codec2utils.h:36
FRAMES_PER_PACKET
#define FRAMES_PER_PACKET
Definition: codec2.c:265
codec2raw_options
static const AVOption codec2raw_options[]
Definition: codec2.c:274
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition: opt.h:255
Codec2Context
Definition: codec2.c:43