Go to the documentation of this file.
22 #include "config_components.h"
37 #define ASF_INDEXED_INTERVAL 10000000
38 #define ASF_INDEX_BLOCK (1<<9)
39 #define ASF_PAYLOADS_PER_PACKET 63
41 #define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE 0x2
42 #define ASF_PACKET_ERROR_CORRECTION_FLAGS \
43 (ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT | \
44 ASF_PACKET_ERROR_CORRECTION_DATA_SIZE)
46 #if (ASF_PACKET_ERROR_CORRECTION_FLAGS != 0)
47 # define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 1
49 # define ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE 0
52 #define ASF_PPI_PROPERTY_FLAGS \
53 (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE | \
54 ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD | \
55 ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE | \
56 ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE)
58 #define ASF_PPI_LENGTH_TYPE_FLAGS 0
60 #define ASF_PAYLOAD_FLAGS ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD
62 #if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
63 # define ASF_PPI_SEQUENCE_FIELD_SIZE 1
65 #if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
66 # define ASF_PPI_SEQUENCE_FIELD_SIZE 2
68 #if (ASF_PPI_FLAG_SEQUENCE_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_SEQUENCE_FIELD_SIZE))
69 # define ASF_PPI_SEQUENCE_FIELD_SIZE 4
71 #ifndef ASF_PPI_SEQUENCE_FIELD_SIZE
72 # define ASF_PPI_SEQUENCE_FIELD_SIZE 0
75 #if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
76 # define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 1
78 #if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
79 # define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 2
81 #if (ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE))
82 # define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 4
84 #ifndef ASF_PPI_PACKET_LENGTH_FIELD_SIZE
85 # define ASF_PPI_PACKET_LENGTH_FIELD_SIZE 0
88 #if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
89 # define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 1
91 #if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
92 # define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 2
94 #if (ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_DWORD == (ASF_PPI_LENGTH_TYPE_FLAGS & ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE))
95 # define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 4
97 #ifndef ASF_PPI_PADDING_LENGTH_FIELD_SIZE
98 # define ASF_PPI_PADDING_LENGTH_FIELD_SIZE 0
101 #if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
102 # define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 1
104 #if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
105 # define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 2
107 #if (ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE))
108 # define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 4
110 #ifndef ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE
111 # define ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE 0
114 #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))
115 # define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 1
117 #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))
118 # define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 2
120 #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))
121 # define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 4
123 #ifndef ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE
124 # define ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE 0
127 #if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
128 # define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 1
130 #if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_WORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
131 # define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 2
133 #if (ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_DWORD == (ASF_PPI_PROPERTY_FLAGS & ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE))
134 # define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 4
136 #ifndef ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE
137 # define ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE 0
140 #if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_BYTE == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
141 # define ASF_PAYLOAD_LENGTH_FIELD_SIZE 1
143 #if (ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD == (ASF_PAYLOAD_FLAGS & ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE))
144 # define ASF_PAYLOAD_LENGTH_FIELD_SIZE 2
146 #ifndef ASF_PAYLOAD_LENGTH_FIELD_SIZE
147 # define ASF_PAYLOAD_LENGTH_FIELD_SIZE 0
150 #define PACKET_HEADER_MIN_SIZE \
151 (ASF_PACKET_ERROR_CORRECTION_FLAGS_FIELD_SIZE + \
152 ASF_PACKET_ERROR_CORRECTION_DATA_SIZE + \
155 ASF_PPI_PACKET_LENGTH_FIELD_SIZE + \
156 ASF_PPI_SEQUENCE_FIELD_SIZE + \
157 ASF_PPI_PADDING_LENGTH_FIELD_SIZE + \
162 #define ASF_PAYLOAD_REPLICATED_DATA_LENGTH 0x08
164 #define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD \
166 ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
167 ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
168 ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
169 ASF_PAYLOAD_REPLICATED_DATA_LENGTH)
171 #define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS \
173 ASF_PAYLOAD_MEDIA_OBJECT_NUMBER_FIELD_SIZE + \
174 ASF_PAYLOAD_OFFSET_INTO_MEDIA_OBJECT_FIELD_SIZE + \
175 ASF_PAYLOAD_REPLICATED_DATA_LENGTH_FIELD_SIZE + \
176 ASF_PAYLOAD_REPLICATED_DATA_LENGTH + \
177 ASF_PAYLOAD_LENGTH_FIELD_SIZE)
179 #define SINGLE_PAYLOAD_HEADERS \
180 (PACKET_HEADER_MIN_SIZE + \
181 PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD)
183 #define MULTI_PAYLOAD_HEADERS \
184 (PACKET_HEADER_MIN_SIZE + \
186 2 * PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS)
188 #define DATA_HEADER_SIZE 50
190 #define PACKET_SIZE_MAX 65536
191 #define PACKET_SIZE_MIN 100
244 #define PREROLL_TIME 3100
281 int payload_length,
int flags)
287 length = payload_length + 8;
301 t = ti * INT64_C(10);
302 t += INT64_C(116444736000000000);
311 if (pres_time <= asf->index_ptr[
i].send_time)
317 return send_time / 10000;
332 for (
unsigned i = 0;
i <
s->nb_chapters;
i++) {
360 int64_t data_chunk_size)
365 int header_size, extra_size, extra_size2, wav_extra_size;
366 int has_title, has_aspect_ratio = 0;
368 int64_t header_offset, cur_pos, hpos;
371 int audio_language_counts[128] = { 0 };
382 has_title = tags[0] || tags[1] || tags[2] || tags[3] || tags[4];
392 for (
unsigned n = 0; n <
s->nb_streams; n++) {
411 if (!strcmp(asf->
languages[
i], iso6391lang)) {
435 avio_wl32(pb, 3 + has_title + !!metadata_count +
s->nb_streams);
462 int nb_audio_languages = 0;
473 if (audio_language_counts[
i])
474 nb_audio_languages++;
476 if (nb_audio_languages > 1) {
481 if (audio_language_counts[
i]) {
483 for (
unsigned n = 0; n <
s->nb_streams; n++)
491 for (
unsigned n = 0; n <
s->nb_streams; n++) {
498 avio_wl32(pb,
s->streams[n]->codecpar->bit_rate);
501 avio_wl32(pb,
s->streams[n]->codecpar->bit_rate);
514 if (has_aspect_ratio) {
518 for (
unsigned n = 0; n <
s->nb_streams; n++) {
572 if (metadata_count) {
588 for (
unsigned n = 0; n <
s->nb_streams; n++) {
599 extra_size = 18 + wav_extra_size;
605 extra_size = 0x33 + wav_extra_size;
633 if (wavsize != extra_size) {
667 for (
unsigned n = 0; n <
s->nb_streams; n++) {
680 desc =
"Windows Media Audio V8";
717 header_size = cur_pos - header_offset;
721 avio_seek(pb, header_offset - 10 - 30, SEEK_SET);
723 avio_seek(pb, header_offset - 2 - 30, SEEK_SET);
728 header_size += 24 + 6;
729 avio_seek(pb, header_offset - 14, SEEK_SET);
753 s->max_interleave_delta = 0;
756 if (
s->nb_streams > 127) {
778 if (
s->avoid_negative_ts < 0)
779 s->avoid_negative_ts = 1;
794 unsigned sendtime,
unsigned duration,
795 int nb_payloads,
int padsize)
843 int packet_hdr_size, packet_filled_size;
857 av_assert0(packet_hdr_size <= asf->packet_size_left);
872 int64_t presentation_time,
int m_obj_size,
873 int m_obj_offset,
int payload_len,
int flags)
895 avio_wl32(pb, (uint32_t) presentation_time);
903 int64_t timestamp,
const uint8_t *buf,
904 int m_obj_size,
int flags)
907 int m_obj_offset, payload_len, frag_len1;
910 while (m_obj_offset < m_obj_size) {
911 payload_len = m_obj_size - m_obj_offset;
918 frag_len1 = multi_payload_constant - 1;
929 if (frag_len1 < payload_len &&
941 if (payload_len > frag_len1)
942 payload_len = frag_len1;
943 else if (payload_len == (frag_len1 - 1))
944 payload_len = frag_len1 - 2;
947 m_obj_size, m_obj_offset, payload_len,
flags);
960 m_obj_offset += payload_len;
974 uint32_t packet_number, uint16_t packet_count,
975 uint64_t packet_offset)
1019 uint32_t packet_number;
1051 uint16_t packet_count = asf->
nb_packets - packet_number;
1062 uint16_t
max, uint32_t count)
1067 avio_wl64(pb, 24 + 16 + 8 + 4 + 4 + (4 + 2) * count);
1072 for (uint32_t
i = 0;
i < count;
i++) {
1083 int64_t file_size, data_size;
1129 #if CONFIG_ASF_MUXER
1133 .p.mime_type =
"video/x-ms-asf",
1134 .p.extensions =
"asf,wmv,wma",
1148 #if CONFIG_ASF_STREAM_MUXER
1150 .
p.
name =
"asf_stream",
1152 .p.mime_type =
"video/x-ms-asf",
1153 .p.extensions =
"asf,wmv,wma",
@ AV_LANG_ISO639_1
3-char terminological language codes as per ISO-IEC 639-2
#define ASF_INDEXED_INTERVAL
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
#define PAYLOAD_HEADER_SIZE_SINGLE_PAYLOAD
static const AVClass asf_muxer_class
This struct describes the properties of an encoded stream.
int av_dict_count(const AVDictionary *m)
Get number of entries in dictionary.
static const AVCodecTag codec_asf_bmp_tags[]
void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, int for_asf, int ignore_extradata, int rgb_frame_is_flipped)
const char * name
Name of the codec described by this descriptor.
const ff_asf_guid ff_asf_audio_stream
const ff_asf_guid ff_asf_simple_index_header
int64_t duration
in 100ns units
static void deinit(AVFormatContext *s)
static void asf_deinit(AVFormatContext *s)
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.
void avio_wl64(AVIOContext *s, uint64_t val)
const AVCodecTag ff_codec_wav_tags[]
static void put_chunk(AVFormatContext *s, int type, int payload_length, int flags)
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t packet_buf[PACKET_SIZE_MAX]
uint64_t data_offset
beginning of the first data packet
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
uint32_t nb_index_memory_alloc
void avio_wl16(AVIOContext *s, unsigned int val)
void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType type)
Mark the written bytestream as a specific type.
static int asf_write_packet(AVFormatContext *s, AVPacket *pkt)
const char * languages[128]
ASFStream streams[128]
it's max number and it's not that big
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
#define ASF_PACKET_ERROR_CORRECTION_FLAGS
static double val(void *priv, double ch)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define ASF_PAYLOAD_REPLICATED_DATA_LENGTH
static av_always_inline float scale(float x, float s)
uint32_t next_packet_number
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
int64_t packet_timestamp_start
#define MULTI_PAYLOAD_HEADERS
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
AVDictionaryEntry * av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)
Get a dictionary entry with matching key.
This struct describes the properties of a single codec described by an AVCodecID.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
int64_t packet_timestamp_end
const ff_asf_guid ff_asf_language_guid
AVRational sample_aspect_ratio
Video only.
const ff_asf_guid ff_asf_video_stream
#define ASF_PACKET_ERROR_CORRECTION_DATA_SIZE
const ff_asf_guid ff_asf_mutex_language
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
#define ASF_PAYLOAD_FLAGS
const ff_asf_guid ff_asf_codec_comment1_header
static int asf_write_header(AVFormatContext *s)
#define ASF_PAYLOADS_PER_PACKET
static void put_str16(AVIOContext *s, AVIOContext *dyn_buf, const char *tag)
const ff_asf_guid ff_asf_extended_content_header
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags)
Write WAVEFORMAT header structure.
static int write_trailer(AVFormatContext *s1)
const AVMetadataConv ff_asf_metadata_conv[]
Rational number (pair of numerator and denominator).
const ff_asf_guid ff_asf_head1_guid
const char * av_default_item_name(void *ptr)
Return the context name.
static int put_payload_parsing_info(AVFormatContext *s, unsigned sendtime, unsigned duration, int nb_payloads, int padsize)
#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE
void avio_w8(AVIOContext *s, int b)
const ff_asf_guid ff_asf_data_header
uint64_t nb_packets
how many packets are there in the file, invalid if broadcasting
void ffio_fill(AVIOContext *s, int b, int64_t count)
const ff_asf_guid ff_asf_extended_stream_properties_object
static const AVCodecTag *const asf_codec_tags[]
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
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)
int extradata_size
Size of the extradata content in bytes.
const ff_asf_guid ff_asf_file_header
const ff_asf_guid ff_asf_video_conceal_none
void ffio_reset_dyn_buf(AVIOContext *s)
Reset a dynamic buffer.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
const char * ff_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace)
Convert a language code to a target codespace.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX
Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs.
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data_chunk_size)
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate an array through a pointer to a pointer.
void avio_wl32(AVIOContext *s, unsigned int val)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int flags
A combination of AV_PKT_FLAG values.
const ff_asf_guid ff_asf_reserved_4
#define ASF_PPI_LENGTH_TYPE_FLAGS
const ff_asf_guid ff_asf_comment_header
#define ASF_PL_FLAG_KEY_FRAME
#define i(width, name, range_min, range_max)
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
const ff_asf_guid ff_asf_my_guid
const ff_asf_guid ff_asf_codec_comment_header
int block_align
Audio only.
uint16_t stream_language_index
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
static int64_t unix_to_file_time(int64_t ti)
const ff_asf_guid ff_asf_head2_guid
static int write_packet(Muxer *mux, OutputStream *ost, AVPacket *pkt)
static int64_t put_header(AVIOContext *pb, const ff_asf_guid *g)
unsigned int packet_nb_payloads
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
const ff_asf_guid ff_asf_audio_conceal_spread
unsigned char multi_payloads_present
const ff_asf_guid ff_asf_stream_header
static const AVOption asf_options[]
static int32_t get_send_time(ASFContext *asf, int64_t pres_time, uint64_t *offset)
uint64_t next_packet_offset
static int asf_write_trailer(AVFormatContext *s)
const AVCodecTag ff_codec_bmp_tags[]
void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size)
Wrap a buffer in an AVIOContext for writing.
#define ASF_PPI_FLAG_MULTIPLE_PAYLOADS_PRESENT
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
static void flush_packet(AVFormatContext *s)
void ff_put_guid(AVIOContext *s, const ff_asf_guid *g)
#define PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS
static void asf_write_markers(AVFormatContext *s, AVIOContext *dyn_buf)
static void end_header(AVIOContext *pb, int64_t pos)
static int update_index(AVFormatContext *s, int start_sec, uint32_t packet_number, uint16_t packet_count, uint64_t packet_offset)
#define SINGLE_PAYLOAD_HEADERS
const ff_asf_guid ff_asf_marker_header
const ff_asf_guid ff_asf_group_mutual_exclusion_object
unsigned char * buffer
Start of the buffer.
static void put_frame(AVFormatContext *s, ASFStream *stream, AVStream *avst, int64_t timestamp, const uint8_t *buf, int m_obj_size, int flags)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
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 PACKET_HEADER_MIN_SIZE
const ff_asf_guid ff_asf_metadata_header
int avio_put_str16le(AVIOContext *s, const char *str)
Convert an UTF-8 string to UTF-16LE and write it.
#define flags(name, subs,...)
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
static int asf_write_stream_header(AVFormatContext *s)
#define MKTAG(a, b, c, d)
const AVCodecDescriptor * avcodec_descriptor_get(enum AVCodecID id)
const ff_asf_guid ff_asf_header
static void write_header(FFV1Context *f)
uint16_t next_packet_count
#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD
unsigned char * buf_ptr
Current position in the buffer.
const AVDictionaryEntry * av_dict_iterate(const AVDictionary *m, const AVDictionaryEntry *prev)
Iterate over a dictionary.
#define ASF_PPI_PROPERTY_FLAGS
@ AVIO_DATA_MARKER_FLUSH_POINT
A point in the output bytestream where the underlying AVIOContext might flush the buffer depending on...
static int asf_write_index(AVFormatContext *s, const ASFIndex *index, uint16_t max, uint32_t count)