libavcodec/options.c File Reference

Options definition for AVCodecContext. More...

#include "avcodec.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include <float.h>

Go to the source code of this file.

Defines

#define OFFSET(x)   offsetof(AVCodecContext,x)
#define DEFAULT   0
#define V   AV_OPT_FLAG_VIDEO_PARAM
#define A   AV_OPT_FLAG_AUDIO_PARAM
#define S   AV_OPT_FLAG_SUBTITLE_PARAM
#define E   AV_OPT_FLAG_ENCODING_PARAM
#define D   AV_OPT_FLAG_DECODING_PARAM
#define AV_CODEC_DEFAULT_BITRATE   200*1000
#define X264_DEFAULTS   CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_PSY|CODEC_FLAG2_MBTREE
#define LAME_DEFAULTS   CODEC_FLAG2_BIT_RESERVOIR
#define alloc_and_copy_or_fail(obj, size, pad)
#define FOFFSET(x)   offsetof(AVFrame,x)

Functions

static const char * context_to_name (void *ptr)
static void * codec_child_next (void *obj, void *prev)
static const AVClasscodec_child_class_next (const AVClass *prev)
void avcodec_get_context_defaults2 (AVCodecContext *s, enum AVMediaType codec_type)
 THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! we WILL change its arguments and name a few times!
int avcodec_get_context_defaults3 (AVCodecContext *s, AVCodec *codec)
 Set the fields of the given AVCodecContext to default values corresponding to the given codec (defaults may be codec-dependent).
AVCodecContextavcodec_alloc_context3 (AVCodec *codec)
 Allocate an AVCodecContext and set its fields to default values.
AVCodecContextavcodec_alloc_context2 (enum AVMediaType codec_type)
 THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! we WILL change its arguments and name a few times!
void avcodec_get_context_defaults (AVCodecContext *s)
 Set the fields of the given AVCodecContext to default values.
AVCodecContextavcodec_alloc_context (void)
 Allocate an AVCodecContext and set its fields to default values.
int avcodec_copy_context (AVCodecContext *dest, const AVCodecContext *src)
 Copy the settings of the source AVCodecContext into the destination AVCodecContext.
const AVClassavcodec_get_class (void)
 Get the AVClass for AVCodecContext.
const AVClassavcodec_get_frame_class (void)
 Get the AVClass for AVFrame.

Variables

static const AVOption options []
static const AVClass av_codec_context_class
static const AVOption frame_options []
static const AVClass av_frame_class


Detailed Description

Options definition for AVCodecContext.

Definition in file options.c.


Define Documentation

#define A   AV_OPT_FLAG_AUDIO_PARAM

Definition at line 70 of file options.c.

#define alloc_and_copy_or_fail ( obj,
size,
pad   ) 

Value:

if (src->obj && size > 0) { \
        dest->obj = av_malloc(size + pad); \
        if (!dest->obj) \
            goto fail; \
        memcpy(dest->obj, src->obj, size); \
        if (pad) \
            memset(((uint8_t *) dest->obj) + size, 0, pad); \
    }

Referenced by avcodec_copy_context().

#define AV_CODEC_DEFAULT_BITRATE   200*1000

Definition at line 75 of file options.c.

#define D   AV_OPT_FLAG_DECODING_PARAM

#define DEFAULT   0

Definition at line 67 of file options.c.

#define E   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 72 of file options.c.

Referenced by config_props(), evolve(), and idct().

#define FOFFSET (  )     offsetof(AVFrame,x)

Definition at line 704 of file options.c.

#define LAME_DEFAULTS   CODEC_FLAG2_BIT_RESERVOIR

#define OFFSET (  )     offsetof(AVCodecContext,x)

Definition at line 66 of file options.c.

#define S   AV_OPT_FLAG_SUBTITLE_PARAM

#define V   AV_OPT_FLAG_VIDEO_PARAM

#define X264_DEFAULTS   CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_PSY|CODEC_FLAG2_MBTREE


Function Documentation

AVCodecContext* avcodec_alloc_context ( void   ) 

Allocate an AVCodecContext and set its fields to default values.

The resulting struct can be deallocated by simply calling av_free().

Returns:
An AVCodecContext filled with default values or NULL on failure.
See also:
avcodec_get_context_defaults
Deprecated:
use avcodec_alloc_context3()

Definition at line 637 of file options.c.

Referenced by config(), and vf_open().

AVCodecContext* avcodec_alloc_context2 ( enum AVMediaType  codec_type  ) 

THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! we WILL change its arguments and name a few times!

Definition at line 623 of file options.c.

Referenced by avcodec_alloc_context().

AVCodecContext* avcodec_alloc_context3 ( AVCodec codec  ) 

Allocate an AVCodecContext and set its fields to default values.

The resulting struct can be deallocated by simply calling av_free().

Parameters:
codec if non-NULL, allocate private data and initialize defaults for the given codec. It is illegal to then call avcodec_open2() with a different codec.
Returns:
An AVCodecContext filled with default values or NULL on failure.
See also:
avcodec_get_context_defaults

Definition at line 609 of file options.c.

Referenced by add_av_stream1(), add_codec(), audio_decode_example(), audio_encode_example(), avformat_new_stream(), config_props(), estimate_best_b_count(), ff_mov_init_hinting(), main(), mov_create_chapter_track(), video_decode_example(), and video_encode_example().

int avcodec_copy_context ( AVCodecContext dest,
const AVCodecContext src 
)

Copy the settings of the source AVCodecContext into the destination AVCodecContext.

The resulting destination codec context will be unopened, i.e. you are required to call avcodec_open2() before you can use this AVCodecContext to decode/encode video/audio data.

Parameters:
dest target codec context, should be initialized with avcodec_alloc_context3(), but otherwise uninitialized
src source codec context
Returns:
AVERROR() on error (e.g. memory allocation error), 0 on success

Definition at line 642 of file options.c.

Referenced by applehttp_read_header(), ff_rtp_chain_mux_open(), http_receive_data(), read_ffserver_streams(), sap_fetch_packet(), and sap_read_header().

const AVClass* avcodec_get_class ( void   ) 

Get the AVClass for AVCodecContext.

It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.

See also:
av_opt_find().

Definition at line 699 of file options.c.

Referenced by filter_codec_opts(), opt_default(), opt_help(), and show_codec_opts().

void avcodec_get_context_defaults ( AVCodecContext s  ) 

Set the fields of the given AVCodecContext to default values.

Parameters:
s The AVCodecContext of which the fields should be set to default values.
Deprecated:
use avcodec_get_context_defaults3

Definition at line 633 of file options.c.

void avcodec_get_context_defaults2 ( AVCodecContext s,
enum AVMediaType  codec_type 
)

THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! we WILL change its arguments and name a few times!

Definition at line 550 of file options.c.

Referenced by avcodec_alloc_context2(), avcodec_get_context_defaults(), and parse_ffconfig().

int avcodec_get_context_defaults3 ( AVCodecContext s,
AVCodec codec 
)

Set the fields of the given AVCodecContext to default values corresponding to the given codec (defaults may be codec-dependent).

Do not call this function if a non-NULL codec has been passed to avcodec_alloc_context3() that allocated this AVCodecContext. If codec is non-NULL, it is illegal to call avcodec_open2() with a different codec on this AVCodecContext.

Definition at line 557 of file options.c.

Referenced by add_video_stream(), avcodec_alloc_context3(), avcodec_get_context_defaults2(), and new_output_stream().

const AVClass* avcodec_get_frame_class ( void   ) 

Get the AVClass for AVFrame.

It can be used in combination with AV_OPT_SEARCH_FAKE_OBJ for examining options.

See also:
av_opt_find().

Definition at line 723 of file options.c.

Referenced by get_video_frame(), and transcode_video().

static const AVClass* codec_child_class_next ( const AVClass prev  )  [static]

Definition at line 50 of file options.c.

static void* codec_child_next ( void *  obj,
void *  prev 
) [static]

Definition at line 42 of file options.c.

static const char* context_to_name ( void *  ptr  )  [static]

Definition at line 33 of file options.c.


Variable Documentation

Initial value:

 {
    .class_name              = "AVCodecContext",
    .item_name               = context_to_name,
    .option                  = options,
    .version                 = LIBAVUTIL_VERSION_INT,
    .log_level_offset_offset = OFFSET(log_level_offset),
    .child_next              = codec_child_next,
    .child_class_next        = codec_child_class_next,
}

Definition at line 539 of file options.c.

const AVClass av_frame_class [static]

Initial value:

 {
    .class_name              = "AVFrame",
    .item_name               = NULL,
    .option                  = frame_options,
    .version                 = LIBAVUTIL_VERSION_INT,
}

Definition at line 716 of file options.c.

const AVOption frame_options[] [static]

Initial value:

{
{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.dbl = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},
{"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.dbl = -1 }, INT64_MIN, INT64_MAX, 0},
{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
{"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
{"format", "", FOFFSET(format), AV_OPT_TYPE_INT, {.dbl = -1 }, 0, INT_MAX, 0},
{NULL},
}

Definition at line 706 of file options.c.

const AVOption options[] [static]

Definition at line 77 of file options.c.


Generated on Fri Oct 26 02:43:49 2012 for FFmpeg by  doxygen 1.5.8