32 #define AVPRIV_CODEC2_HEADER_SIZE 7 33 #define AVPRIV_CODEC2_MAGIC 0xC0DEC2 37 #define EXPECTED_CODEC2_MAJOR_VERSION 0 38 #define EXPECTED_CODEC2_MINOR_VERSION 8 133 if (block_align <= 0 || frame_size <= 0 || c2->frames_per_packet <= 0) {
146 n = ret / block_align;
183 av_log(s,
AV_LOG_ERROR,
"-mode must be set in order to make sense of raw codec2 files\n");
204 #define FRAMES_PER_PACKET \ 205 { "frames_per_packet", "Number of frames to read at a time. Higher = faster decoding, lower granularity", \ 206 offsetof(Codec2Context, frames_per_packet), AV_OPT_TYPE_INT, {.i64 = 1}, 1, INT_MAX, AV_OPT_FLAG_DECODING_PARAM} 242 #if CONFIG_CODEC2_DEMUXER 254 .priv_class = &codec2_demux_class,
258 #if CONFIG_CODEC2_MUXER 269 .priv_class = &codec2_mux_class,
273 #if CONFIG_CODEC2RAW_DEMUXER 283 .priv_class = &codec2raw_demux_class,
static const AVOption codec2raw_options[]
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const AVClass codec2_demux_class
#define LIBAVUTIL_VERSION_INT
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define FRAMES_PER_PACKET
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
const char * av_default_item_name(void *ptr)
Return the context name.
AVFormatInternal * internal
An opaque field for libavformat internal usage.
static uint8_t avpriv_codec2_mode_from_extradata(uint8_t *ptr)
#define AVPRIV_CODEC2_HEADER_SIZE
int frame_size
Audio only.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
int avpriv_codec2_mode_bit_rate(void *logctx, int mode)
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
uint64_t channel_layout
Audio only.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
static int codec2_read_packet(AVFormatContext *s, AVPacket *pkt)
static int codec2_probe(AVProbeData *p)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
#define EXPECTED_CODEC2_MINOR_VERSION
#define AVPRIV_CODEC2_AVOPTIONS(desc, classname, min_val, default_val, option_flags)
int extradata_size
Size of the extradata content in bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
int block_align
Audio only.
#define AVPRIV_CODEC2_EXTRADATA_SIZE
static uint16_t avpriv_codec2_version_from_extradata(uint8_t *ptr)
unsigned int avio_rb24(AVIOContext *s)
void avio_wb24(AVIOContext *s, unsigned int val)
int avpriv_codec2_mode_frame_size(void *logctx, int mode)
static int codec2_read_header_common(AVFormatContext *s, AVStream *st)
static int read_header(FFV1Context *f)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define EXPECTED_CODEC2_MAJOR_VERSION
int avpriv_codec2_mode_block_align(void *logctx, int mode)
AVIOContext * pb
I/O context.
#define AVPRIV_CODEC2_MAGIC
Describe the class of an AVClass context structure.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
static int codec2raw_read_header(AVFormatContext *s)
This structure contains the data a format has to probe a file.
static const AVClass codec2_mux_class
static const AVOption codec2_options[]
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
int sample_rate
Audio only.
static int codec2_write_header(AVFormatContext *s)
static void avpriv_codec2_make_extradata(uint8_t *ptr, int mode)
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static const AVClass codec2raw_demux_class
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
mode
Use these values in ebur128_init (or'ed).
static int codec2_read_header(AVFormatContext *s)