22#include "config_components.h"
36#define CODEC2_HEADER_SIZE 7
37#define CODEC2_MAGIC 0xC0DEC2
41#define EXPECTED_CODEC2_MAJOR_VERSION 0
42#define EXPECTED_CODEC2_MINOR_VERSION 8
87 return frame_size_table[
mode];
110 return block_align_table[
mode];
201 if (
c2->frames_per_packet > INT_MAX / block_align)
203 size =
c2->frames_per_packet * block_align;
211 n = ret / block_align;
261#define FRAMES_PER_PACKET \
262 { "frames_per_packet", "Number of frames to read at a time. Higher = faster decoding, lower granularity", \
263 offsetof(Codec2Context, frames_per_packet), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM}
277 .class_name =
"codec2 demuxer",
285 .class_name =
"codec2raw demuxer",
292#if CONFIG_CODEC2_DEMUXER
296 .p.extensions =
"c2",
308#if CONFIG_CODEC2_MUXER
312 .p.extensions =
"c2",
324#if CONFIG_CODEC2RAW_DEMUXER
326 .p.name =
"codec2raw",
void avio_wb24(AVIOContext *s, unsigned int val)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
unsigned int avio_rb24(AVIOContext *s)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
static int codec2_mode_bit_rate(AVFormatContext *s, int mode)
static int codec2raw_read_header(AVFormatContext *s)
static int codec2_probe(const AVProbeData *p)
static const AVOption codec2raw_options[]
static int codec2_mode_block_align(AVFormatContext *s, int mode)
static int codec2_read_header(AVFormatContext *s)
#define FRAMES_PER_PACKET
static int codec2_read_packet(AVFormatContext *s, AVPacket *pkt)
static int codec2_read_header_common(AVFormatContext *s, AVStream *st)
static const AVClass codec2_demux_class
static int codec2_write_header(AVFormatContext *s)
#define EXPECTED_CODEC2_MAJOR_VERSION
#define EXPECTED_CODEC2_MINOR_VERSION
static const AVClass codec2raw_demux_class
#define CODEC2_HEADER_SIZE
static int codec2_mode_frame_size(AVFormatContext *s, int mode)
static const AVOption codec2_options[]
#define CODEC2_AVOPTIONS(desc, classname, min_val, default_val, option_flags)
static uint8_t codec2_mode_from_extradata(uint8_t *ptr)
#define CODEC2_EXTRADATA_SIZE
static void codec2_make_extradata(uint8_t *ptr, int mode)
mode
Use these values in ebur128_init (or'ed).
static int read_header(FFV1Context *f, RangeCoder *c)
static const uint8_t frame_size[4]
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AV_CHANNEL_LAYOUT_MONO
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_SAMPLE_FMT_S16
signed 16 bits
#define LIBAVUTIL_VERSION_INT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
@ AV_CLASS_CATEGORY_DEMUXER
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
An AVChannelLayout holds information about the channel layout of audio data.
Describe the class of an AVClass context structure.
int extradata_size
Size of the extradata content in bytes.
int frame_size
Audio frame size, if known.
AVChannelLayout ch_layout
The channel layout and number of channels.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int64_t data_offset
offset of the first packet