22#include "config_components.h"
38#define ASF_INDEXED_INTERVAL 10000000
39#define ASF_INDEX_BLOCK (1<<9)
40#define ASF_PAYLOADS_PER_PACKET 63
42#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
43#define ASF_PACKET_ERROR_CORRECTION_FLAGS \
44 (ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT | \
45 ASF_PACKET_ERROR_CORRECTION_DATA_SIZE)
47#if (ASF_PACKET_ERROR_CORRECTION_FLAGS != 0)
48# define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 1
50# define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 0
53#define ASF_PPI_PROPERTY_FLAGS \
54 (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE | \
55 ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD | \
56 ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE | \
57 ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE)
59#define ASF_PPI_LENGTH_TYPE_FLAGS 0
61#define ASF_PAYLOAD_FLAGS ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD
63#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
64# define ASF_PPI_SEQUENCE_FIELD_SIZE 1
66#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
67# define ASF_PPI_SEQUENCE_FIELD_SIZE 2
69#if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
70# define ASF_PPI_SEQUENCE_FIELD_SIZE 4
72#ifndef ASF_PPI_SEQUENCE_FIELD_SIZE
73# define ASF_PPI_SEQUENCE_FIELD_SIZE 0
76#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
77# define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 1
79#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
80# define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 2
82#if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
83# define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 4
85#ifndef ASF_PPI_PACKET_LENGTH_FIELD_SIZE
86# define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 0
89#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
90# define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 1
92#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
93# define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 2
95#if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
96# define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 4
98#ifndef ASF_PPI_PADDING_LENGTH_FIELD_SIZE
99# define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 0
102#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
103# define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 1
105#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
106# define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 2
108#if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
109# define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 4
111#ifndef ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE
112# define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 0
115#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
116# define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 1
118#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
119# define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 2
121#if (ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE))
122# define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 4
124#ifndef ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE
125# define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 0
128#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
129# define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 1
131#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
132# define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 2
134#if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
135# define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 4
137#ifndef ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE
138# define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 0
141#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_BYTE == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
142# define ASF_PAYLOAD_LENGTH_FIELD_SIZE 1
144#if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
145# define ASF_PAYLOAD_LENGTH_FIELD_SIZE 2
147#ifndef ASF_PAYLOAD_LENGTH_FIELD_SIZE
148# define ASF_PAYLOAD_LENGTH_FIELD_SIZE 0
151#define PACKET_HEADER_MIN_SIZE \
152 (ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE + \
153 ASF_PACKET_ERROR_CORRECTION_DATA_SIZE + \
156 ASF_PPI_PACKET_LENGTH_FIELD_SIZE + \
157 ASF_PPI_SEQUENCE_FIELD_SIZE + \
158 ASF_PPI_PADDING_LENGTH_FIELD_SIZE + \
163#define ASF_PAYLOAD_REPLICATED_DATA_LENGTH 0x08
165#define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD \
167 ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
168 ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
169 ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
170 ASF_PAYLOAD_REPLICATED_DATA_LENGTH)
172#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS \
174 ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
175 ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
176 ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
177 ASF_PAYLOAD_REPLICATED_DATA_LENGTH + \
178 ASF_PAYLOAD_LENGTH_FIELD_SIZE)
180#define SINGLE_PAYLOAD_HEADERS \
181 (PACKET_HEADER_MIN_SIZE + \
182 PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD)
184#define MULTI_PAYLOAD_HEADERS \
185 (PACKET_HEADER_MIN_SIZE + \
187 2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
189#define DATA_HEADER_SIZE 50
191#define PACKET_SIZE_MAX 65536
192#define PACKET_SIZE_MIN 100
245#define PREROLL_TIME 3100
282 int payload_length,
int flags)
288 length = payload_length + 8;
302 if (pres_time <= asf->index_ptr[
i].send_time)
308 return send_time / 10000;
323 for (
unsigned i = 0;
i <
s->nb_chapters;
i++) {
356 int header_size, extra_size, extra_size2, wav_extra_size;
357 int has_title, has_aspect_ratio = 0;
359 int64_t header_offset, cur_pos, hpos;
362 int audio_language_counts[128] = { 0 };
373 has_title = tags[0] || tags[1] || tags[2] || tags[3] || tags[4];
383 for (
unsigned n = 0; n <
s->nb_streams; n++) {
402 if (!strcmp(asf->
languages[
i], iso6391lang)) {
426 avio_wl32(pb, 3 + has_title + !!metadata_count +
s->nb_streams);
453 int nb_audio_languages = 0;
464 if (audio_language_counts[
i])
465 nb_audio_languages++;
467 if (nb_audio_languages > 1) {
472 if (audio_language_counts[
i]) {
474 for (
unsigned n = 0; n <
s->nb_streams; n++)
482 for (
unsigned n = 0; n <
s->nb_streams; n++) {
489 avio_wl32(pb,
s->streams[n]->codecpar->bit_rate);
492 avio_wl32(pb,
s->streams[n]->codecpar->bit_rate);
505 if (has_aspect_ratio) {
509 for (
unsigned n = 0; n <
s->nb_streams; n++) {
563 if (metadata_count) {
579 for (
unsigned n = 0; n <
s->nb_streams; n++) {
590 extra_size = 18 + wav_extra_size;
596 extra_size = 0x33 + wav_extra_size;
624 if (wavsize != extra_size) {
658 for (
unsigned n = 0; n <
s->nb_streams; n++) {
671 desc =
"Windows Media Audio V8";
708 header_size = cur_pos - header_offset;
712 avio_seek(pb, header_offset - 10 - 30, SEEK_SET);
714 avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
719 header_size += 24 + 6;
720 avio_seek(pb, header_offset - 14, SEEK_SET);
744 s->max_interleave_delta = 0;
747 if (
s->nb_streams > 127) {
769 if (
s->avoid_negative_ts < 0)
770 s->avoid_negative_ts = 1;
785 unsigned sendtime,
unsigned duration,
786 int nb_payloads,
int padsize)
834 int packet_hdr_size, packet_filled_size;
848 av_assert0(packet_hdr_size <= asf->packet_size_left);
863 int64_t presentation_time,
int m_obj_size,
864 int m_obj_offset,
int payload_len,
int flags)
886 avio_wl32(pb, (uint32_t) presentation_time);
894 int64_t timestamp,
const uint8_t *buf,
895 int m_obj_size,
int flags)
898 int m_obj_offset, payload_len, frag_len1;
901 while (m_obj_offset < m_obj_size) {
902 payload_len = m_obj_size - m_obj_offset;
909 frag_len1 = multi_payload_constant - 1;
920 if (frag_len1 < payload_len &&
932 if (payload_len > frag_len1)
933 payload_len = frag_len1;
934 else if (payload_len == (frag_len1 - 1))
935 payload_len = frag_len1 - 2;
938 m_obj_size, m_obj_offset, payload_len,
flags);
951 m_obj_offset += payload_len;
965 uint32_t packet_number, uint16_t packet_count,
966 uint64_t packet_offset)
1010 uint32_t packet_number;
1017 par =
s->streams[
pkt->stream_index]->codecpar;
1042 uint16_t packet_count = asf->
nb_packets - packet_number;
1053 uint16_t
max, uint32_t count)
1058 avio_wl64(pb, 24 + 16 + 8 + 4 + 4 + (4 + 2) * count);
1063 for (uint32_t
i = 0;
i < count;
i++) {
1114 .class_name =
"ASF (stream) muxer",
1124 .p.mime_type =
"video/x-ms-asf",
1125 .p.extensions =
"asf,wmv,wma",
1139#if CONFIG_ASF_STREAM_MUXER
1141 .p.name =
"asf_stream",
1143 .p.mime_type =
"video/x-ms-asf",
1144 .p.extensions =
"asf,wmv,wma",
static double val(void *priv, double ch)
const AVMetadataConv ff_asf_metadata_conv[]
const ff_asf_guid ff_asf_video_conceal_none
const ff_asf_guid ff_asf_codec_comment1_header
const ff_asf_guid ff_asf_mutex_language
#define ASF_PPI_FLAG_MULTIPLE_PAYLOADS_PRESENT
const ff_asf_guid ff_asf_video_stream
const ff_asf_guid ff_asf_stream_header
#define ASF_PL_FLAG_KEY_FRAME
#define ff_asf_extended_stream_properties_object
const ff_asf_guid ff_asf_audio_conceal_spread
const ff_asf_guid ff_asf_language_guid
const ff_asf_guid ff_asf_group_mutual_exclusion_object
const ff_asf_guid ff_asf_header
const ff_asf_guid ff_asf_audio_stream
const ff_asf_guid ff_asf_simple_index_header
const ff_asf_guid ff_asf_extended_content_header
const ff_asf_guid ff_asf_reserved_4
const ff_asf_guid ff_asf_head1_guid
const ff_asf_guid ff_asf_head2_guid
const ff_asf_guid ff_asf_marker_header
#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD
const ff_asf_guid ff_asf_data_header
static int64_t ff_asf_avtime_to_filetime(int64_t avtime)
#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE
const ff_asf_guid ff_asf_codec_comment_header
const ff_asf_guid ff_asf_my_guid
const ff_asf_guid ff_asf_file_header
const ff_asf_guid ff_asf_comment_header
const ff_asf_guid ff_asf_metadata_header
#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE
static int asf_write_index(AVFormatContext *s, const ASFIndex *index, uint16_t max, uint32_t count)
static void asf_write_markers(AVFormatContext *s, AVIOContext *dyn_buf)
#define SINGLE_PAYLOAD_HEADERS
static int update_index(AVFormatContext *s, int start_sec, uint32_t packet_number, uint16_t packet_count, uint64_t packet_offset)
#define PACKET_HEADER_MIN_SIZE
static void flush_packet(AVFormatContext *s)
static const AVOption asf_options[]
static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
#define ASF_PAYLOAD_REPLICATED_DATA_LENGTH
#define ASF_INDEXED_INTERVAL
#define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD
static void asf_deinit(AVFormatContext *s)
static const AVCodecTag codec_asf_bmp_tags[]
static int32_t get_send_time(ASFContext *asf, int64_t pres_time, uint64_t *offset)
#define MULTI_PAYLOAD_HEADERS
#define ASF_PAYLOADS_PER_PACKET
static const AVClass asf_muxer_class
static void put_payload_header(AVFormatContext *s, ASFStream *stream, int64_t presentation_time, int m_obj_size, int m_obj_offset, int payload_len, int flags)
static int put_payload_parsing_info(AVFormatContext *s, unsigned sendtime, unsigned duration, int nb_payloads, int padsize)
#define ASF_PAYLOAD_FLAGS
static int64_t put_header(AVIOContext *pb, const ff_asf_guid *g)
static void put_frame(AVFormatContext *s, ASFStream *stream, AVStream *avst, int64_t timestamp, const uint8_t *buf, int m_obj_size, int flags)
static void put_chunk(AVFormatContext *s, int type, int payload_length, int flags)
static int asf_write_header(AVFormatContext *s)
static int asf_write_stream_header(AVFormatContext *s)
static const AVCodecTag *const asf_codec_tags[]
#define ASF_PACKET_ERROR_CORRECTION_FLAGS
static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data_chunk_size)
#define ASF_PPI_PROPERTY_FLAGS
static void end_header(AVIOContext *pb, int64_t pos)
static int asf_write_trailer(AVFormatContext *s)
static void put_str16(AVIOContext *s, AVIOContext *dyn_buf, const char *tag)
#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS
#define ASF_PPI_LENGTH_TYPE_FLAGS
simple assert() macros that are a bit more flexible than ISO C assert().
#define av_assert0(cond)
assert() equivalent, that is always enabled.
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type)
Mark the written bytestream as a specific type.
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_wl64(AVIOContext *s, uint64_t val)
void avio_wl32(AVIOContext *s, unsigned int val)
void avio_wl16(AVIOContext *s, unsigned int val)
void avio_w8(AVIOContext *s, int b)
@ AVIO_DATA_MARKER_FLUSH_POINT
A point in the output bytestream where the underlying AVIOContext might flush the buffer depending on...
int avio_put_str16le(AVIOContext *s, const char *str)
Convert an UTF-8 string to UTF-16LE and write it.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
void ffio_reset_dyn_buf(AVIOContext *s)
Reset a dynamic buffer.
void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size)
Wrap a buffer in an AVIOContext for writing.
void ffio_fill(AVIOContext *s, int b, int64_t count)
const char * ff_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace)
Convert a language code to a target codespace.
@ AV_LANG_ISO639_1
3-char terminological language codes as per ISO-IEC 639-2
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static void deinit(AVFormatContext *s)
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
static void write_header(FFV1Context *f)
#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.
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const char * av_default_item_name(void *ptr)
Return the context name.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate an array through a pointer to a pointer.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define LIBAVUTIL_VERSION_INT
static void scale(int *out, const int *in, const int w, const int h, const int shift)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define MKTAG(a, b, c, d)
Memory handling functions.
int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds)
Parse creation_time in AVFormatContext metadata if exists and warn if the parsing fails.
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
const AVCodecTag ff_codec_bmp_tags[]
const AVCodecTag ff_codec_wav_tags[]
internal header for RIFF based (de)muxers do NOT include this in end user applications
#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX
Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs.
void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, int for_asf, int ignore_extradata, int rgb_frame_is_flipped)
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags)
Write WAVEFORMAT header structure.
void ff_put_guid(AVIOContext *s, const ff_asf_guid *g)
#define FF_ARRAY_ELEMS(a)
int64_t packet_timestamp_start
uint64_t nb_packets
how many packets are there in the file, invalid if broadcasting
uint32_t next_packet_number
ASFStream streams[128]
it's max number and it's not that big
uint32_t nb_index_memory_alloc
uint16_t next_packet_count
uint64_t next_packet_offset
uint64_t data_offset
beginning of the first data packet
unsigned char multi_payloads_present
unsigned int packet_nb_payloads
uint8_t packet_buf[PACKET_SIZE_MAX]
const char * languages[128]
int64_t packet_timestamp_end
uint16_t stream_language_index
Describe the class of an AVClass context structure.
This struct describes the properties of a single codec described by an AVCodecID.
const char * name
Name of the codec described by this descriptor.
This struct describes the properties of an encoded stream.
int extradata_size
Size of the extradata content in bytes.
int height
The height of the video frame in pixels.
int width
The width of the video frame in pixels.
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.
AVRational sample_aspect_ratio
The aspect ratio (width/height) which a single pixel should have when displayed.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
unsigned char * buf_ptr
Current position in the buffer.
unsigned char * buffer
Start of the buffer.
This structure stores compressed data.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
static int write_trailer(AVFormatContext *s1)