23#include "config_components.h"
38#define ASF_NB_BLOCKS 32
147#if CONFIG_ARGO_ASF_DEMUXER
175 if (!argo_asf_is_known_version(&hdr))
274 .p.name =
"argo_asf",
284#if CONFIG_ARGO_ASF_MUXER
290 if (
ctx->version_major == 1 &&
ctx->version_minor == 1 && par->
sample_rate != 22050) {
343 .version_major = (uint16_t)
ctx->version_major,
344 .version_minor = (uint16_t)
ctx->version_minor,
349 const char *
name, *end;
374 if (
ctx->version_major == 1 &&
ctx->version_minor == 1)
385 argo_asf_write_file_header(&fhdr,
s->pb);
386 argo_asf_write_chunk_header(&chdr,
s->pb);
399 if (
ctx->nb_blocks + nb_blocks > UINT32_MAX)
404 ctx->nb_blocks += nb_blocks;
420static const AVOption argo_asf_options[] = {
422 .name =
"version_major",
423 .help =
"override file major version",
426 .default_val = {.i64 = 2},
432 .name =
"version_minor",
433 .help =
"override file minor version",
436 .default_val = {.i64 = 1},
443 .help =
"embedded file name (max 8 characters)",
446 .default_val = {.str =
NULL},
452static const AVClass argo_asf_muxer_class = {
453 .class_name =
"argo_asf_muxer",
455 .option = argo_asf_options,
460 .p.name =
"argo_asf",
469 .p.priv_class = &argo_asf_muxer_class,
472 .init = argo_asf_write_init,
473 .write_header = argo_asf_write_header,
474 .write_packet = argo_asf_write_packet,
475 .write_trailer = argo_asf_write_trailer,
int ff_argo_asf_validate_file_header(AVFormatContext *s, const ArgoASFFileHeader *hdr)
void ff_argo_asf_parse_file_header(ArgoASFFileHeader *hdr, const uint8_t *buf)
int ff_argo_asf_fill_stream(AVFormatContext *s, AVStream *st, const ArgoASFFileHeader *fhdr, const ArgoASFChunkHeader *ckhdr)
void ff_argo_asf_parse_chunk_header(ArgoASFChunkHeader *hdr, const uint8_t *buf)
#define ASF_CHUNK_HEADER_SIZE
#define ASF_FILE_HEADER_SIZE
#define ASF_MIN_BUFFER_SIZE
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
void avio_wl32(AVIOContext *s, unsigned int val)
void avio_wl16(AVIOContext *s, unsigned int val)
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
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)
#define flags(name, subs,...)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
static int read_header(FFV1Context *f, RangeCoder *c)
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_MONO
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#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_S16P
signed 16 bits, planar
const char * av_basename(const char *path)
Thread safe basename.
#define LIBAVUTIL_VERSION_INT
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
#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....
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
An AVChannelLayout holds information about the channel layout of audio data.
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
This struct describes the properties of an encoded stream.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
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.
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 nb_frames
number of frames in this stream if known or 0
int64_t duration
Decoding: duration of the stream, in stream time base.
int index
stream index in AVFormatContext
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
#define avpriv_request_sample(...)
static AVFormatContext * ctx