chromium/third_party/ffmpeg/libavutil/opt.c

/*
 * AVOptions
 * Copyright (c) 2005 Michael Niedermayer <[email protected]>
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with FFmpeg; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

/**
 * @file
 * AVOptions
 * @author Michael Niedermayer <[email protected]>
 */

#include "avutil.h"
#include "avassert.h"
#include "avstring.h"
#include "channel_layout.h"
#include "dict.h"
#include "eval.h"
#include "log.h"
#include "mem.h"
#include "parseutils.h"
#include "pixdesc.h"
#include "mathematics.h"
#include "opt.h"
#include "samplefmt.h"
#include "bprint.h"
#include "version.h"

#include <float.h>

#define TYPE_BASE(type)

const AVOption *av_opt_next(const void *obj, const AVOption *last)
{}

static const size_t opt_elem_size[] =;

// option is plain old data
static int opt_is_pod(enum AVOptionType type)
{}

static uint8_t opt_array_sep(const AVOption *o)
{}

static void *opt_array_pelem(const AVOption *o, void *array, unsigned idx)
{}

static unsigned *opt_array_pcount(const void *parray)
{}

static void opt_free_elem(const AVOption *o, void *ptr)
{}

static void opt_free_array(const AVOption *o, void *parray, unsigned *count)
{}

static int read_number(const AVOption *o, const void *dst, double *num, int *den, int64_t *intnum)
{}

static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)
{}

static int hexchar2int(char c) {}

static int set_string_binary(void *obj, const AVOption *o, const char *val, uint8_t **dst)
{}

static int set_string(void *obj, const AVOption *o, const char *val, uint8_t **dst)
{}

#define DEFAULT_NUMVAL(opt)

static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)
{}

static int set_string_image_size(void *obj, const AVOption *o, const char *val, int *dst)
{}

static int set_string_video_rate(void *obj, const AVOption *o, const char *val, AVRational *dst)
{}

static int set_string_color(void *obj, const AVOption *o, const char *val, uint8_t *dst)
{}

static const char *get_bool_name(int val)
{}

static int set_string_bool(void *obj, const AVOption *o, const char *val, int *dst)
{}

static int set_string_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst,
                          int fmt_nb, int ((*get_fmt)(const char *)), const char *desc)
{}

static int get_pix_fmt(const char *name)
{}

static int set_string_pixel_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst)
{}

static int get_sample_fmt(const char *name)
{}

static int set_string_sample_fmt(void *obj, const AVOption *o, const char *val, uint8_t *dst)
{}

static int set_string_dict(void *obj, const AVOption *o, const char *val, uint8_t **dst)
{}

static int set_string_channel_layout(void *obj, const AVOption *o,
                                     const char *val, void *dst)
{}

static int opt_set_elem(void *obj, void *target_obj, const AVOption *o,
                        const char *val, void *dst)
{}

static int opt_set_array(void *obj, void *target_obj, const AVOption *o,
                         const char *val, void *dst)
{}

int av_opt_set(void *obj, const char *name, const char *val, int search_flags)
{}

#define OPT_EVAL_NUMBER(name, opttype, vartype)

OPT_EVAL_NUMBER(flags,  AV_OPT_TYPE_FLAGS,    int)
OPT_EVAL_NUMBER(int,    AV_OPT_TYPE_INT,      int)
OPT_EVAL_NUMBER(uint,   AV_OPT_TYPE_UINT,     unsigned)
OPT_EVAL_NUMBER()
OPT_EVAL_NUMBER(float,  AV_OPT_TYPE_FLOAT,    float)
OPT_EVAL_NUMBER(double, AV_OPT_TYPE_DOUBLE,   double)
OPT_EVAL_NUMBER()

static int set_number(void *obj, const char *name, double num, int den, int64_t intnum,
                      int search_flags)
{}

int av_opt_set_int(void *obj, const char *name, int64_t val, int search_flags)
{}

int av_opt_set_double(void *obj, const char *name, double val, int search_flags)
{}

int av_opt_set_q(void *obj, const char *name, AVRational val, int search_flags)
{}

int av_opt_set_bin(void *obj, const char *name, const uint8_t *val, int len, int search_flags)
{}

int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_flags)
{}

int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int search_flags)
{}

static int set_format(void *obj, const char *name, int fmt, int search_flags,
                      enum AVOptionType type, const char *desc, int nb_fmts)
{}

int av_opt_set_pixel_fmt(void *obj, const char *name, enum AVPixelFormat fmt, int search_flags)
{}

int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags)
{}

int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val,
                        int search_flags)
{}

int av_opt_set_chlayout(void *obj, const char *name,
                        const AVChannelLayout *channel_layout,
                        int search_flags)
{}

static void format_duration(char *buf, size_t size, int64_t d)
{}

static int opt_get_elem(const AVOption *o, uint8_t **pbuf, size_t buf_len,
                        void *dst, int search_flags)
{}

static int opt_get_array(const AVOption *o, void *dst, uint8_t **out_val)
{}

int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
{}

static int get_number(void *obj, const char *name, double *num, int *den, int64_t *intnum,
                      int search_flags)
{}

int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
{}

int av_opt_get_double(void *obj, const char *name, int search_flags, double *out_val)
{}

int av_opt_get_q(void *obj, const char *name, int search_flags, AVRational *out_val)
{}

int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_out, int *h_out)
{}

int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val)
{}

static int get_format(void *obj, const char *name, int search_flags, int *out_fmt,
                      enum AVOptionType type, const char *desc)
{}

int av_opt_get_pixel_fmt(void *obj, const char *name, int search_flags, enum AVPixelFormat *out_fmt)
{}

int av_opt_get_sample_fmt(void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt)
{}

int av_opt_get_chlayout(void *obj, const char *name, int search_flags, AVChannelLayout *cl)
{}

int av_opt_get_dict_val(void *obj, const char *name, int search_flags, AVDictionary **out_val)
{}

int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
{}

static void log_int_value(void *av_log_obj, int level, int64_t i)
{}

static void log_value(void *av_log_obj, int level, double d)
{}

static const char *get_opt_const_name(void *obj, const char *unit, int64_t value)
{}

static char *get_opt_flags_string(void *obj, const char *unit, int64_t value)
{}

static void log_type(void *av_log_obj, const AVOption *o,
                     enum AVOptionType parent_type)
{}

static void log_default(void *obj, void *av_log_obj, const AVOption *opt)
{}

static void opt_list(void *obj, void *av_log_obj, const char *unit,
                     int req_flags, int rej_flags, enum AVOptionType parent_type)
{}

int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags)
{}

void av_opt_set_defaults(void *s)
{}

void av_opt_set_defaults2(void *s, int mask, int flags)
{}

/**
 * Store the value in the field in ctx that is named like key.
 * ctx must be an AVClass context, storing is done using AVOptions.
 *
 * @param buf the string to parse, buf will be updated to point at the
 * separator just after the parsed key/value pair
 * @param key_val_sep a 0-terminated list of characters used to
 * separate key from value
 * @param pairs_sep a 0-terminated list of characters used to separate
 * two pairs from each other
 * @return 0 if the key/value pair has been successfully parsed and
 * set, or a negative value corresponding to an AVERROR code in case
 * of error:
 * AVERROR(EINVAL) if the key/value pair cannot be parsed,
 * the error code issued by av_opt_set() if the key/value pair
 * cannot be set
 */
static int parse_key_value_pair(void *ctx, const char **buf,
                                const char *key_val_sep, const char *pairs_sep)
{}

int av_set_options_string(void *ctx, const char *opts,
                          const char *key_val_sep, const char *pairs_sep)
{}

#define WHITESPACES

static int is_key_char(char c)
{}

/**
 * Read a key from a string.
 *
 * The key consists of is_key_char characters and must be terminated by a
 * character from the delim string; spaces are ignored.
 *
 * @return  0 for success (even with ellipsis), <0 for failure
 */
static int get_key(const char **ropts, const char *delim, char **rkey)
{}

int av_opt_get_key_value(const char **ropts,
                         const char *key_val_sep, const char *pairs_sep,
                         unsigned flags,
                         char **rkey, char **rval)
{}

int av_opt_set_from_string(void *ctx, const char *opts,
                           const char *const *shorthand,
                           const char *key_val_sep, const char *pairs_sep)
{}

void av_opt_free(void *obj)
{}

int av_opt_set_dict2(void *obj, AVDictionary **options, int search_flags)
{}

int av_opt_set_dict(void *obj, AVDictionary **options)
{}

const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
                            int opt_flags, int search_flags)
{}

const AVOption *av_opt_find2(void *obj, const char *name, const char *unit,
                             int opt_flags, int search_flags, void **target_obj)
{}

void *av_opt_child_next(void *obj, void *prev)
{}

const AVClass *av_opt_child_class_iterate(const AVClass *parent, void **iter)
{}

void *av_opt_ptr(const AVClass *class, void *obj, const char *name)
{}

static int opt_copy_elem(void *logctx, enum AVOptionType type,
                         void *dst, const void *src)
{}

static int opt_copy_array(void *logctx, const AVOption *o,
                          void **pdst, const void * const *psrc)
{}

int av_opt_copy(void *dst, const void *src)
{}

int av_opt_query_ranges(AVOptionRanges **ranges_arg, void *obj, const char *key, int flags)
{}

int av_opt_query_ranges_default(AVOptionRanges **ranges_arg, void *obj, const char *key, int flags)
{}

void av_opt_freep_ranges(AVOptionRanges **rangesp)
{}

int av_opt_is_set_to_default(void *obj, const AVOption *o)
{}

int av_opt_is_set_to_default_by_name(void *obj, const char *name, int search_flags)
{}

static int opt_serialize(void *obj, int opt_flags, int flags, int *cnt,
                         AVBPrint *bprint, const char key_val_sep, const char pairs_sep)
{}

int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
                     const char key_val_sep, const char pairs_sep)
{}