World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл avformat.h

См. исходные тексты.

Классы

struct  AVProbeData
 
struct  AVOutputFormat
 
struct  AVInputFormat
 
struct  AVIndexEntry
 
struct  AVStream
 
struct  AVProgram
 
struct  AVChapter
 
struct  AVFormatContext
 
struct  AVPacketList
 

Определения типов

typedef struct AVProbeData AVProbeData
 
typedef struct AVOutputFormat AVOutputFormat
 
typedef struct AVInputFormat AVInputFormat
 
typedef struct AVIndexEntry AVIndexEntry
 
typedef struct AVStreamInternal AVStreamInternal
 
typedef struct AVStream AVStream
 
typedef struct AVProgram AVProgram
 
typedef struct AVChapter AVChapter
 
typedef int(* av_format_control_message) (struct AVFormatContext *s, int type, void *data, size_t data_size)
 
typedef int(* AVOpenCallback) (struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)
 
typedef struct AVFormatInternal AVFormatInternal
 
typedef struct AVFormatContext AVFormatContext
 
typedef struct AVPacketList AVPacketList
 

Перечисления

enum  AVStreamParseType {
  AVSTREAM_PARSE_NONE, AVSTREAM_PARSE_FULL, AVSTREAM_PARSE_HEADERS, AVSTREAM_PARSE_TIMESTAMPS,
  AVSTREAM_PARSE_FULL_ONCE, AVSTREAM_PARSE_FULL_RAW
}
 
enum  AVDurationEstimationMethod { AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, AVFMT_DURATION_FROM_BITRATE }
 
enum  AVTimebaseSource { AVFMT_TBCF_AUTO = -1, AVFMT_TBCF_DECODER, AVFMT_TBCF_DEMUXER, AVFMT_TBCF_R_FRAMERATE }
 

Функции

int av_get_packet (AVIOContext *s, AVPacket *pkt, int size)
 
int av_append_packet (AVIOContext *s, AVPacket *pkt, int size)
 
attribute_deprecated AVRational av_stream_get_r_frame_rate (const AVStream *s)
 
attribute_deprecated void av_stream_set_r_frame_rate (AVStream *s, AVRational r)
 
attribute_deprecated char * av_stream_get_recommended_encoder_configuration (const AVStream *s)
 
attribute_deprecated void av_stream_set_recommended_encoder_configuration (AVStream *s, char *configuration)
 
struct AVCodecParserContextav_stream_get_parser (const AVStream *s)
 
int64_t av_stream_get_end_pts (const AVStream *st)
 
attribute_deprecated int av_format_get_probe_score (const AVFormatContext *s)
 
attribute_deprecated AVCodecav_format_get_video_codec (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_video_codec (AVFormatContext *s, AVCodec *c)
 
attribute_deprecated AVCodecav_format_get_audio_codec (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_audio_codec (AVFormatContext *s, AVCodec *c)
 
attribute_deprecated AVCodecav_format_get_subtitle_codec (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_subtitle_codec (AVFormatContext *s, AVCodec *c)
 
attribute_deprecated AVCodecav_format_get_data_codec (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_data_codec (AVFormatContext *s, AVCodec *c)
 
attribute_deprecated int av_format_get_metadata_header_padding (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_metadata_header_padding (AVFormatContext *s, int c)
 
attribute_deprecated voidav_format_get_opaque (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_opaque (AVFormatContext *s, void *opaque)
 
attribute_deprecated av_format_control_message av_format_get_control_message_cb (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_control_message_cb (AVFormatContext *s, av_format_control_message callback)
 
attribute_deprecated AVOpenCallback av_format_get_open_cb (const AVFormatContext *s)
 
attribute_deprecated void av_format_set_open_cb (AVFormatContext *s, AVOpenCallback callback)
 
void av_format_inject_global_side_data (AVFormatContext *s)
 
enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method (const AVFormatContext *ctx)
 
unsigned avformat_version (void)
 
const char * avformat_configuration (void)
 
const char * avformat_license (void)
 
attribute_deprecated void av_register_all (void)
 
attribute_deprecated void av_register_input_format (AVInputFormat *format)
 
attribute_deprecated void av_register_output_format (AVOutputFormat *format)
 
int avformat_network_init (void)
 
int avformat_network_deinit (void)
 
attribute_deprecated AVInputFormatav_iformat_next (const AVInputFormat *f)
 
attribute_deprecated AVOutputFormatav_oformat_next (const AVOutputFormat *f)
 
const AVOutputFormatav_muxer_iterate (void **opaque)
 
const AVInputFormatav_demuxer_iterate (void **opaque)
 
AVFormatContextavformat_alloc_context (void)
 
void avformat_free_context (AVFormatContext *s)
 
const AVClassavformat_get_class (void)
 
AVStreamavformat_new_stream (AVFormatContext *s, const AVCodec *c)
 
int av_stream_add_side_data (AVStream *st, enum AVPacketSideDataType type, uint8_t *data, size_t size)
 
uint8_tav_stream_new_side_data (AVStream *stream, enum AVPacketSideDataType type, int size)
 
uint8_tav_stream_get_side_data (const AVStream *stream, enum AVPacketSideDataType type, int *size)
 
AVProgramav_new_program (AVFormatContext *s, int id)
 
int avformat_alloc_output_context2 (AVFormatContext **ctx, ff_const59 AVOutputFormat *oformat, const char *format_name, const char *filename)
 
ff_const59 AVInputFormatav_find_input_format (const char *short_name)
 
ff_const59 AVInputFormatav_probe_input_format (ff_const59 AVProbeData *pd, int is_opened)
 
ff_const59 AVInputFormatav_probe_input_format2 (ff_const59 AVProbeData *pd, int is_opened, int *score_max)
 
ff_const59 AVInputFormatav_probe_input_format3 (ff_const59 AVProbeData *pd, int is_opened, int *score_ret)
 
int av_probe_input_buffer2 (AVIOContext *pb, ff_const59 AVInputFormat **fmt, const char *url, void *logctx, unsigned int offset, unsigned int max_probe_size)
 
int av_probe_input_buffer (AVIOContext *pb, ff_const59 AVInputFormat **fmt, const char *url, void *logctx, unsigned int offset, unsigned int max_probe_size)
 
int avformat_open_input (AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options)
 
attribute_deprecated int av_demuxer_open (AVFormatContext *ic)
 
int avformat_find_stream_info (AVFormatContext *ic, AVDictionary **options)
 
AVProgramav_find_program_from_stream (AVFormatContext *ic, AVProgram *last, int s)
 
void av_program_add_stream_index (AVFormatContext *ac, int progid, unsigned int idx)
 
int av_find_best_stream (AVFormatContext *ic, enum AVMediaType type, int wanted_stream_nb, int related_stream, AVCodec **decoder_ret, int flags)
 
int av_read_frame (AVFormatContext *s, AVPacket *pkt)
 
int av_seek_frame (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 
int avformat_seek_file (AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
 
int avformat_flush (AVFormatContext *s)
 
int av_read_play (AVFormatContext *s)
 
int av_read_pause (AVFormatContext *s)
 
void avformat_close_input (AVFormatContext **s)
 
av_warn_unused_result int avformat_write_header (AVFormatContext *s, AVDictionary **options)
 
av_warn_unused_result int avformat_init_output (AVFormatContext *s, AVDictionary **options)
 
int av_write_frame (AVFormatContext *s, AVPacket *pkt)
 
int av_interleaved_write_frame (AVFormatContext *s, AVPacket *pkt)
 
int av_write_uncoded_frame (AVFormatContext *s, int stream_index, AVFrame *frame)
 
int av_interleaved_write_uncoded_frame (AVFormatContext *s, int stream_index, AVFrame *frame)
 
int av_write_uncoded_frame_query (AVFormatContext *s, int stream_index)
 
int av_write_trailer (AVFormatContext *s)
 
ff_const59 AVOutputFormatav_guess_format (const char *short_name, const char *filename, const char *mime_type)
 
enum AVCodecID av_guess_codec (ff_const59 AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, enum AVMediaType type)
 
int av_get_output_timestamp (struct AVFormatContext *s, int stream, int64_t *dts, int64_t *wall)
 
void av_hex_dump (FILE *f, const uint8_t *buf, int size)
 
void av_hex_dump_log (void *avcl, int level, const uint8_t *buf, int size)
 
void av_pkt_dump2 (FILE *f, const AVPacket *pkt, int dump_payload, const AVStream *st)
 
void av_pkt_dump_log2 (void *avcl, int level, const AVPacket *pkt, int dump_payload, const AVStream *st)
 
enum AVCodecID av_codec_get_id (const struct AVCodecTag *const *tags, unsigned int tag)
 
unsigned int av_codec_get_tag (const struct AVCodecTag *const *tags, enum AVCodecID id)
 
int av_codec_get_tag2 (const struct AVCodecTag *const *tags, enum AVCodecID id, unsigned int *tag)
 
int av_find_default_stream_index (AVFormatContext *s)
 
int av_index_search_timestamp (AVStream *st, int64_t timestamp, int flags)
 
int av_add_index_entry (AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
 
void av_url_split (char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
 
void av_dump_format (AVFormatContext *ic, int index, const char *url, int is_output)
 
int av_get_frame_filename2 (char *buf, int buf_size, const char *path, int number, int flags)
 
int av_get_frame_filename (char *buf, int buf_size, const char *path, int number)
 
int av_filename_number_test (const char *filename)
 
int av_sdp_create (AVFormatContext *ac[], int n_files, char *buf, int size)
 
int av_match_ext (const char *filename, const char *extensions)
 
int avformat_query_codec (const AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance)
 
const struct AVCodecTag * avformat_get_riff_video_tags (void)
 
const struct AVCodecTag * avformat_get_riff_audio_tags (void)
 
const struct AVCodecTag * avformat_get_mov_video_tags (void)
 
const struct AVCodecTag * avformat_get_mov_audio_tags (void)
 
AVRational av_guess_sample_aspect_ratio (AVFormatContext *format, AVStream *stream, AVFrame *frame)
 
AVRational av_guess_frame_rate (AVFormatContext *ctx, AVStream *stream, AVFrame *frame)
 
int avformat_match_stream_specifier (AVFormatContext *s, AVStream *st, const char *spec)
 
int avformat_queue_attached_pictures (AVFormatContext *s)
 
attribute_deprecated int av_apply_bitstream_filters (AVCodecContext *codec, AVPacket *pkt, AVBitStreamFilterContext *bsfc)
 
int avformat_transfer_internal_stream_timing_info (const AVOutputFormat *ofmt, AVStream *ost, const AVStream *ist, enum AVTimebaseSource copy_tb)
 
AVRational av_stream_get_codec_timebase (const AVStream *st)
 

Подробное описание

Main libavformat public API header

См. определение в файле avformat.h

Типы

◆ AVProbeData

typedef struct AVProbeData AVProbeData

This structure contains the data a format has to probe a file.

◆ AVIndexEntry

typedef struct AVIndexEntry AVIndexEntry

◆ AVStreamInternal

См. определение в файле avformat.h строка 847

◆ AVStream

typedef struct AVStream AVStream

Stream structure. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVStream) must not be used outside libav*.

◆ AVProgram

typedef struct AVProgram AVProgram

New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVProgram) must not be used outside libav*.

◆ AVChapter

typedef struct AVChapter AVChapter

◆ av_format_control_message

typedef int(* av_format_control_message) (struct AVFormatContext *s, int type, void *data, size_t data_size)

Callback used by devices to communicate with application.

См. определение в файле avformat.h строка 1312

◆ AVOpenCallback

typedef int(* AVOpenCallback) (struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options)

См. определение в файле avformat.h строка 1315

◆ AVFormatInternal

См. определение в файле avformat.h строка 1328

◆ AVFormatContext

Format I/O context. New fields can be added to the end with minor version bumps. Removal, reordering and changes to existing fields require a major version bump. sizeof(AVFormatContext) must not be used outside libav*, use avformat_alloc_context() to create an AVFormatContext.

Fields can be accessed through AVOptions (av_opt*), the name string used matches the associated command line parameter name and can be found in libavformat/options_table.h. The AVOption/command line parameter names differ in some cases from the C structure field names for historic reasons or brevity.

◆ AVPacketList

typedef struct AVPacketList AVPacketList

Перечисления

◆ AVStreamParseType

Элементы перечислений
AVSTREAM_PARSE_NONE 
AVSTREAM_PARSE_FULL 

full parsing and repack

AVSTREAM_PARSE_HEADERS 

Only parse headers, do not repack.

AVSTREAM_PARSE_TIMESTAMPS 

full parsing and interpolation of timestamps for frames not starting on a packet boundary

AVSTREAM_PARSE_FULL_ONCE 

full parsing and repack of the first frame only, only implemented for H.264 currently

AVSTREAM_PARSE_FULL_RAW 

full parsing and repack with timestamp and position generation by parser for raw this assumes that each packet in the file contains no demuxer level headers and just codec level data, otherwise position generation would fail

См. определение в файле avformat.h строка 789

◆ AVDurationEstimationMethod

The duration of a video can be estimated through various ways, and this enum can be used to know how the duration was estimated.

Элементы перечислений
AVFMT_DURATION_FROM_PTS 

Duration accurately estimated from PTSes.

AVFMT_DURATION_FROM_STREAM 

Duration estimated from a stream with a known duration.

AVFMT_DURATION_FROM_BITRATE 

Duration estimated from bitrate (less accurate)

См. определение в файле avformat.h строка 1322

Функции

◆ av_get_packet()

int av_get_packet ( AVIOContext s,
AVPacket pkt,
int  size 
)

Allocate and read the payload of a packet and initialize its fields with default values.

Аргументы
sassociated IO context
pktpacket
sizedesired payload size
Возвращает
>0 (read size) if OK, AVERROR_xxx otherwise

◆ av_append_packet()

int av_append_packet ( AVIOContext s,
AVPacket pkt,
int  size 
)

Read data and append it to the current content of the AVPacket. If pkt->size is 0 this is identical to av_get_packet. Note that this uses av_grow_packet and thus involves a realloc which is inefficient. Thus this function should only be used when there is no reasonable way to know (an upper bound of) the final size.

Аргументы
sassociated IO context
pktpacket
sizeamount of data to read
Возвращает
>0 (read size) if OK, AVERROR_xxx otherwise, previous data will not be lost even if an error occurs.

◆ av_stream_get_r_frame_rate()

attribute_deprecated AVRational av_stream_get_r_frame_rate ( const AVStream s)

Accessors for some AVStream fields. These used to be provided for ABI compatibility, and do not need to be used anymore.

◆ av_stream_set_r_frame_rate()

attribute_deprecated void av_stream_set_r_frame_rate ( AVStream s,
AVRational  r 
)

◆ av_stream_get_recommended_encoder_configuration()

attribute_deprecated char* av_stream_get_recommended_encoder_configuration ( const AVStream s)

◆ av_stream_set_recommended_encoder_configuration()

attribute_deprecated void av_stream_set_recommended_encoder_configuration ( AVStream s,
char *  configuration 
)

◆ av_stream_get_parser()

struct AVCodecParserContext* av_stream_get_parser ( const AVStream s)

◆ av_stream_get_end_pts()

int64_t av_stream_get_end_pts ( const AVStream st)

Returns the pts of the last muxed packet + its duration

the retuned value is undefined when used with a demuxer.

◆ av_format_get_probe_score()

attribute_deprecated int av_format_get_probe_score ( const AVFormatContext s)

Accessors for some AVFormatContext fields. These used to be provided for ABI compatibility, and do not need to be used anymore.

◆ av_format_get_video_codec()

attribute_deprecated AVCodec* av_format_get_video_codec ( const AVFormatContext s)

◆ av_format_set_video_codec()

attribute_deprecated void av_format_set_video_codec ( AVFormatContext s,
AVCodec c 
)

◆ av_format_get_audio_codec()

attribute_deprecated AVCodec* av_format_get_audio_codec ( const AVFormatContext s)

◆ av_format_set_audio_codec()

attribute_deprecated void av_format_set_audio_codec ( AVFormatContext s,
AVCodec c 
)

◆ av_format_get_subtitle_codec()

attribute_deprecated AVCodec* av_format_get_subtitle_codec ( const AVFormatContext s)

◆ av_format_set_subtitle_codec()

attribute_deprecated void av_format_set_subtitle_codec ( AVFormatContext s,
AVCodec c 
)

◆ av_format_get_data_codec()

attribute_deprecated AVCodec* av_format_get_data_codec ( const AVFormatContext s)

◆ av_format_set_data_codec()

attribute_deprecated void av_format_set_data_codec ( AVFormatContext s,
AVCodec c 
)

◆ av_format_get_metadata_header_padding()

attribute_deprecated int av_format_get_metadata_header_padding ( const AVFormatContext s)

◆ av_format_set_metadata_header_padding()

attribute_deprecated void av_format_set_metadata_header_padding ( AVFormatContext s,
int  c 
)

◆ av_format_get_opaque()

attribute_deprecated void* av_format_get_opaque ( const AVFormatContext s)

◆ av_format_set_opaque()

attribute_deprecated void av_format_set_opaque ( AVFormatContext s,
void opaque 
)

◆ av_format_get_control_message_cb()

attribute_deprecated av_format_control_message av_format_get_control_message_cb ( const AVFormatContext s)

◆ av_format_set_control_message_cb()

attribute_deprecated void av_format_set_control_message_cb ( AVFormatContext s,
av_format_control_message  callback 
)

◆ av_format_get_open_cb()

attribute_deprecated AVOpenCallback av_format_get_open_cb ( const AVFormatContext s)

◆ av_format_set_open_cb()

attribute_deprecated void av_format_set_open_cb ( AVFormatContext s,
AVOpenCallback  callback 
)

◆ av_format_inject_global_side_data()

void av_format_inject_global_side_data ( AVFormatContext s)

This function will cause global side data to be injected in the next packet of each stream as well as after any subsequent seek.

◆ av_fmt_ctx_get_duration_estimation_method()

enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method ( const AVFormatContext ctx)

Returns the method used to set ctx->duration.

Возвращает
AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE.

◆ avformat_alloc_output_context2()

int avformat_alloc_output_context2 ( AVFormatContext **  ctx,
ff_const59 AVOutputFormat oformat,
const char *  format_name,
const char *  filename 
)

Allocate an AVFormatContext for an output format. avformat_free_context() can be used to free the context and everything allocated by the framework within it.

Аргументы
*ctxis set to the created format context, or to NULL in case of failure
oformatformat to use for allocating the context, if NULL format_name and filename are used instead
format_namethe name of output format to use for allocating the context, if NULL filename is used instead
filenamethe name of the filename to use for allocating the context, may be NULL
Возвращает
>= 0 in case of success, a negative AVERROR code in case of failure
AVFMT_DURATION_FROM_BITRATE
@ AVFMT_DURATION_FROM_BITRATE
Duration estimated from bitrate (less accurate)
Definition: avformat.h:1325
AVSTREAM_PARSE_FULL_ONCE
@ AVSTREAM_PARSE_FULL_ONCE
Definition: avformat.h:794
AVFMT_DURATION_FROM_PTS
@ AVFMT_DURATION_FROM_PTS
Duration accurately estimated from PTSes.
Definition: avformat.h:1323
AVFMT_DURATION_FROM_STREAM
@ AVFMT_DURATION_FROM_STREAM
Duration estimated from a stream with a known duration.
Definition: avformat.h:1324
AVSTREAM_PARSE_NONE
@ AVSTREAM_PARSE_NONE
Definition: avformat.h:790
AVSTREAM_PARSE_HEADERS
@ AVSTREAM_PARSE_HEADERS
Definition: avformat.h:792
AVSTREAM_PARSE_FULL_RAW
@ AVSTREAM_PARSE_FULL_RAW
Definition: avformat.h:795
AVSTREAM_PARSE_FULL
@ AVSTREAM_PARSE_FULL
Definition: avformat.h:791
AVSTREAM_PARSE_TIMESTAMPS
@ AVSTREAM_PARSE_TIMESTAMPS
Definition: avformat.h:793