FFmpeg
Data Structures | Macros | Functions | Variables
codec2.c File Reference
#include <memory.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 "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 33 of file codec2.c.

◆ CODEC2_MAGIC

#define CODEC2_MAGIC   0xC0DEC2

Definition at line 34 of file codec2.c.

◆ EXPECTED_CODEC2_MAJOR_VERSION

#define EXPECTED_CODEC2_MAJOR_VERSION   0

Definition at line 38 of file codec2.c.

◆ EXPECTED_CODEC2_MINOR_VERSION

#define EXPECTED_CODEC2_MINOR_VERSION   8

Definition at line 39 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 264 of file codec2.c.

Function Documentation

◆ codec2_probe()

static int codec2_probe ( const AVProbeData p)
static

Definition at line 47 of file codec2.c.

◆ codec2_mode_frame_size()

static int codec2_mode_frame_size ( AVFormatContext s,
int  mode 
)
static

Definition at line 66 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 89 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 113 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 125 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 150 of file codec2.c.

◆ codec2_read_packet()

static int codec2_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 185 of file codec2.c.

◆ codec2_write_header()

static int codec2_write_header ( AVFormatContext s)
static

Definition at line 213 of file codec2.c.

◆ codec2raw_read_header()

static int codec2raw_read_header ( AVFormatContext s)
static

Definition at line 236 of file codec2.c.

Variable Documentation

◆ codec2_options

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

Definition at line 268 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 273 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 279 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 287 of file codec2.c.

codec2_options
static const AVOption codec2_options[]
Definition: codec2.c:268
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:235
CODEC2_AVOPTIONS
#define CODEC2_AVOPTIONS(desc, classname, min_val, default_val, option_flags)
Definition: codec2utils.h:36
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:278
FRAMES_PER_PACKET
#define FRAMES_PER_PACKET
Definition: codec2.c:264
codec2raw_options
static const AVOption codec2raw_options[]
Definition: codec2.c:273
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
Codec2Context
Definition: codec2.c:41