FFmpeg
Macros | Enumerations | Functions | Variables
options.c File Reference
#include "avformat.h"
#include "avio_internal.h"
#include "demux.h"
#include "internal.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/codec_par.h"
#include "libavutil/avassert.h"
#include "libavutil/internal.h"
#include "libavutil/intmath.h"
#include "libavutil/opt.h"
#include "options_table.h"

Go to the source code of this file.

Macros

#define ITER_STATE_SHIFT   16
 

Enumerations

enum  { CHILD_CLASS_ITER_AVIO = 0, CHILD_CLASS_ITER_MUX, CHILD_CLASS_ITER_DEMUX, CHILD_CLASS_ITER_DONE }
 

Functions

FF_DISABLE_DEPRECATION_WARNINGS static const FF_ENABLE_DEPRECATION_WARNINGS char * format_to_name (void *ptr)
 
static void * format_child_next (void *obj, void *prev)
 
static const AVClassformat_child_class_iterate (void **iter)
 
static AVClassCategory get_category (void *ptr)
 
static int io_open_default (AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options)
 
void ff_format_io_close_default (AVFormatContext *s, AVIOContext *pb)
 
static int io_close2_default (AVFormatContext *s, AVIOContext *pb)
 
AVFormatContextavformat_alloc_context (void)
 Allocate an AVFormatContext. More...
 
enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method (const AVFormatContext *ctx)
 Returns the method used to set ctx->duration. More...
 
const AVClassavformat_get_class (void)
 Get the AVClass for AVFormatContext. More...
 
const AVClassav_stream_get_class (void)
 Get the AVClass for AVStream. More...
 
AVStreamavformat_new_stream (AVFormatContext *s, const AVCodec *c)
 Add a new stream to a media file. More...
 
static int option_is_disposition (const AVOption *opt)
 
int av_disposition_from_string (const char *disp)
 
const char * av_disposition_to_string (int disposition)
 

Variables

static const AVClass av_format_context_class
 
static const AVOption stream_options []
 
static const AVClass stream_class
 

Detailed Description

Options definition for AVFormatContext.

Definition in file options.c.

Macro Definition Documentation

◆ ITER_STATE_SHIFT

#define ITER_STATE_SHIFT   16

Definition at line 70 of file options.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CHILD_CLASS_ITER_AVIO 
CHILD_CLASS_ITER_MUX 
CHILD_CLASS_ITER_DEMUX 
CHILD_CLASS_ITER_DONE 

Definition at line 62 of file options.c.

Function Documentation

◆ format_to_name()

FF_DISABLE_DEPRECATION_WARNINGS static const FF_ENABLE_DEPRECATION_WARNINGS char* format_to_name ( void *  ptr)
static

Definition at line 42 of file options.c.

◆ format_child_next()

static void* format_child_next ( void *  obj,
void *  prev 
)
static

Definition at line 50 of file options.c.

◆ format_child_class_iterate()

static const AVClass* format_child_class_iterate ( void **  iter)
static

Definition at line 72 of file options.c.

◆ get_category()

static AVClassCategory get_category ( void *  ptr)
static

Definition at line 118 of file options.c.

◆ io_open_default()

static int io_open_default ( AVFormatContext s,
AVIOContext **  pb,
const char *  url,
int  flags,
AVDictionary **  options 
)
static

Definition at line 136 of file options.c.

Referenced by avformat_alloc_context().

◆ ff_format_io_close_default()

void ff_format_io_close_default ( AVFormatContext s,
AVIOContext pb 
)

Definition at line 154 of file options.c.

Referenced by avformat_alloc_context(), and ff_format_io_close().

◆ io_close2_default()

static int io_close2_default ( AVFormatContext s,
AVIOContext pb 
)
static

Definition at line 159 of file options.c.

Referenced by avformat_alloc_context().

◆ 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.

Returns
AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE.

Definition at line 192 of file options.c.

◆ option_is_disposition()

static int option_is_disposition ( const AVOption opt)
static

Definition at line 320 of file options.c.

Referenced by av_disposition_from_string(), and av_disposition_to_string().

◆ av_disposition_from_string()

int av_disposition_from_string ( const char *  disp)
Returns
The AV_DISPOSITION_* flag corresponding to disp or a negative error code if disp does not correspond to a known stream disposition.

Definition at line 326 of file options.c.

◆ av_disposition_to_string()

const char* av_disposition_to_string ( int  disposition)
Parameters
dispositiona combination of AV_DISPOSITION_* values
Returns
The string description corresponding to the lowest set bit in disposition. NULL when the lowest set bit does not correspond to a known disposition or when disposition is 0.

Definition at line 334 of file options.c.

Referenced by show_dispositions().

Variable Documentation

◆ av_format_context_class

const AVClass av_format_context_class
static
Initial value:
= {
.class_name = "AVFormatContext",
.item_name = format_to_name,
.option = avformat_options,
.child_next = format_child_next,
.child_class_iterate = format_child_class_iterate,
.get_category = get_category,
}

Definition at line 125 of file options.c.

Referenced by avformat_alloc_context(), and avformat_get_class().

◆ stream_options

const AVOption stream_options[]
static
Initial value:
= {
{ "disposition", NULL, 0x42, AV_OPT_TYPE_FLAGS, { .i64 = 0 },
.flags = AV_OPT_FLAG_ENCODING_PARAM, .unit = "disposition" },
{ "default", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEFAULT }, .unit = "disposition" },
{ "dub", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DUB }, .unit = "disposition" },
{ "original", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ORIGINAL }, .unit = "disposition" },
{ "comment", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_COMMENT }, .unit = "disposition" },
{ "lyrics", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_LYRICS }, .unit = "disposition" },
{ "karaoke", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_KARAOKE }, .unit = "disposition" },
{ "forced", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_FORCED }, .unit = "disposition" },
{ "hearing_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_HEARING_IMPAIRED }, .unit = "disposition" },
{ "visual_impaired", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_VISUAL_IMPAIRED }, .unit = "disposition" },
{ "clean_effects", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CLEAN_EFFECTS }, .unit = "disposition" },
{ "attached_pic", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_ATTACHED_PIC }, .unit = "disposition" },
{ "timed_thumbnails", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_TIMED_THUMBNAILS }, .unit = "disposition" },
{ "captions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_CAPTIONS }, .unit = "disposition" },
{ "descriptions", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DESCRIPTIONS }, .unit = "disposition" },
{ "metadata", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_METADATA }, .unit = "disposition" },
{ "dependent", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_DEPENDENT }, .unit = "disposition" },
{ "still_image", .type = AV_OPT_TYPE_CONST, { .i64 = AV_DISPOSITION_STILL_IMAGE }, .unit = "disposition" },
{ NULL }
}

Definition at line 202 of file options.c.

Referenced by av_disposition_from_string(), and av_disposition_to_string().

◆ stream_class

const AVClass stream_class
static
Initial value:
= {
.class_name = "AVStream",
.item_name = av_default_item_name,
.option = stream_options,
}

Definition at line 225 of file options.c.

Referenced by av_stream_get_class(), and avformat_new_stream().

AV_DISPOSITION_ATTACHED_PIC
#define AV_DISPOSITION_ATTACHED_PIC
The stream is stored in the file as an attached picture/"cover art" (e.g.
Definition: avformat.h:879
format_child_class_iterate
static const AVClass * format_child_class_iterate(void **iter)
Definition: options.c:72
AV_DISPOSITION_DEFAULT
#define AV_DISPOSITION_DEFAULT
The stream should be chosen by default among other streams of the same type, unless the user has expl...
Definition: avformat.h:826
AV_DISPOSITION_STILL_IMAGE
#define AV_DISPOSITION_STILL_IMAGE
The video stream contains still images.
Definition: avformat.h:918
AV_DISPOSITION_FORCED
#define AV_DISPOSITION_FORCED
Track should be used during playback by default.
Definition: avformat.h:859
AV_DISPOSITION_TIMED_THUMBNAILS
#define AV_DISPOSITION_TIMED_THUMBNAILS
The stream is sparse, and contains thumbnail images, often corresponding to chapter markers.
Definition: avformat.h:884
AV_DISPOSITION_CLEAN_EFFECTS
#define AV_DISPOSITION_CLEAN_EFFECTS
The audio stream contains music and sound effects without voice.
Definition: avformat.h:871
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:281
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
avformat_options
static const AVOption avformat_options[]
Definition: options_table.h:36
AV_DISPOSITION_COMMENT
#define AV_DISPOSITION_COMMENT
The stream is a commentary track.
Definition: avformat.h:844
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_DISPOSITION_METADATA
#define AV_DISPOSITION_METADATA
The subtitle stream contains time-aligned metadata that is not intended to be directly presented to t...
Definition: avformat.h:908
AV_DISPOSITION_ORIGINAL
#define AV_DISPOSITION_ORIGINAL
The stream is in original language.
Definition: avformat.h:840
format_to_name
FF_DISABLE_DEPRECATION_WARNINGS static const FF_ENABLE_DEPRECATION_WARNINGS char * format_to_name(void *ptr)
Definition: options.c:42
AV_DISPOSITION_CAPTIONS
#define AV_DISPOSITION_CAPTIONS
The subtitle stream contains captions, providing a transcription and possibly a translation of audio.
Definition: avformat.h:897
AVClass::category
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
Definition: log.h:114
AV_DISPOSITION_DUB
#define AV_DISPOSITION_DUB
The stream is not in original language.
Definition: avformat.h:834
AV_DISPOSITION_HEARING_IMPAIRED
#define AV_DISPOSITION_HEARING_IMPAIRED
The stream is intended for hearing impaired audiences.
Definition: avformat.h:863
get_category
static AVClassCategory get_category(void *ptr)
Definition: options.c:118
AV_DISPOSITION_KARAOKE
#define AV_DISPOSITION_KARAOKE
The stream contains karaoke audio.
Definition: avformat.h:852
AV_DISPOSITION_DEPENDENT
#define AV_DISPOSITION_DEPENDENT
The audio stream is intended to be mixed with another stream before presentation.
Definition: avformat.h:914
AV_DISPOSITION_VISUAL_IMPAIRED
#define AV_DISPOSITION_VISUAL_IMPAIRED
The stream is intended for visually impaired audiences.
Definition: avformat.h:867
AV_DISPOSITION_DESCRIPTIONS
#define AV_DISPOSITION_DESCRIPTIONS
The subtitle stream contains a textual description of the video content.
Definition: avformat.h:903
format_child_next
static void * format_child_next(void *obj, void *prev)
Definition: options.c:50
AV_CLASS_CATEGORY_MUXER
@ AV_CLASS_CATEGORY_MUXER
Definition: log.h:32
stream_options
static const AVOption stream_options[]
Definition: options.c:202
AV_OPT_TYPE_FLAGS
@ AV_OPT_TYPE_FLAGS
Definition: opt.h:224
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
AV_DISPOSITION_LYRICS
#define AV_DISPOSITION_LYRICS
The stream contains song lyrics.
Definition: avformat.h:848