Libav
Data Structures | Macros | Enumerations | Functions | Variables
avprobe.c File Reference
#include "config.h"
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/dict.h"
#include "libavutil/libm.h"
#include "libavdevice/avdevice.h"
#include "cmdutils.h"
#include "cmdutils_common_opts.h"

Go to the source code of this file.

Data Structures

struct  PrintElement
 
struct  PrintContext
 

Macros

#define AVP_INDENT()   avio_printf(probe_out, "%*c", octx.level * 2, ' ')
 
#define AVP_BUFFSIZE   4096
 

Enumerations

enum  PrintElementType { ARRAY, OBJECT }
 

Functions

static void avprobe_cleanup (int ret)
 
static void ini_print_header (void)
 
static void ini_print_footer (void)
 
static void ini_escape_print (const char *s)
 
static void ini_print_array_header (const char *name)
 
static void ini_print_object_header (const char *name)
 
static void ini_print_integer (const char *key, int64_t value)
 
static void ini_print_string (const char *key, const char *value)
 
static void json_print_header (void)
 
static void json_print_footer (void)
 
static void json_print_array_header (const char *name)
 
static void json_print_array_footer (const char *name)
 
static void json_print_object_header (const char *name)
 
static void json_print_object_footer (const char *name)
 
static void json_print_integer (const char *key, int64_t value)
 
static void json_escape_print (const char *s)
 
static void json_print_string (const char *key, const char *value)
 
static void old_print_object_header (const char *name)
 
static void old_print_object_footer (const char *name)
 
static void old_print_string (const char *key, const char *value)
 
static void show_format_entry_integer (const char *key, int64_t value)
 
static void show_format_entry_string (const char *key, const char *value)
 
static void probe_group_enter (const char *name, int type)
 
static void probe_group_leave (void)
 
static void probe_header (void)
 
static void probe_footer (void)
 
static void probe_array_header (const char *name)
 
static void probe_array_footer (const char *name)
 
static void probe_object_header (const char *name)
 
static void probe_object_footer (const char *name)
 
static void probe_int (const char *key, int64_t value)
 
static void probe_str (const char *key, const char *value)
 
static void probe_dict (AVDictionary *dict, const char *name)
 
static char * value_string (char *buf, int buf_size, double val, const char *unit)
 
static char * time_value_string (char *buf, int buf_size, int64_t val, const AVRational *time_base)
 
static char * ts_value_string (char *buf, int buf_size, int64_t ts)
 
static char * rational_string (char *buf, int buf_size, const char *sep, const AVRational *rat)
 
static char * tag_string (char *buf, int buf_size, int tag)
 
static void show_packet (AVFormatContext *fmt_ctx, AVPacket *pkt)
 
static void show_packets (AVFormatContext *fmt_ctx)
 
static void show_stream (AVFormatContext *fmt_ctx, int stream_idx)
 
static void show_format (AVFormatContext *fmt_ctx)
 
static int open_input_file (AVFormatContext **fmt_ctx_ptr, const char *filename)
 
static void close_input_file (AVFormatContext **ctx_ptr)
 
static int probe_file (const char *filename)
 
static void show_usage (void)
 
static int opt_format (void *optctx, const char *opt, const char *arg)
 
static int opt_output_format (void *optctx, const char *opt, const char *arg)
 
static int opt_show_format_entry (void *optctx, const char *opt, const char *arg)
 
static void opt_input_file (void *optctx, const char *arg)
 
void show_help_default (const char *opt, const char *arg)
 Per-avtool specific help handler. More...
 
static int opt_pretty (void *optctx, const char *opt, const char *arg)
 
static int probe_buf_write (void *opaque, uint8_t *buf, int buf_size)
 
int main (int argc, char **argv)
 

Variables

const char program_name [] = "avprobe"
 program name, defined by the program for show_version(). More...
 
const int program_birth_year = 2007
 program birth year, defined by the program for show_banner() More...
 
static int do_show_format = 0
 
static AVDictionaryfmt_entries_to_show = NULL
 
static int nb_fmt_entries_to_show
 
static int do_show_packets = 0
 
static int do_show_streams = 0
 
static int show_value_unit = 0
 
static int use_value_prefix = 0
 
static int use_byte_value_binary_prefix = 0
 
static int use_value_sexagesimal_format = 0
 
static const OptionDefoptions
 
static const char * input_filename
 
static AVInputFormatiformat = NULL
 
static const char *const binary_unit_prefixes [] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" }
 
static const char *const decimal_unit_prefixes [] = { "", "K" , "M" , "G" , "T" , "P" }
 
static const char unit_second_str [] = "s"
 
static const char unit_hertz_str [] = "Hz"
 
static const char unit_byte_str [] = "byte"
 
static const char unit_bit_per_second_str [] = "bit/s"
 
static AVIOContextprobe_out = NULL
 
static PrintContext octx
 
static const OptionDef real_options []
 

Macro Definition Documentation

§ AVP_INDENT

#define AVP_INDENT ( )    avio_printf(probe_out, "%*c", octx.level * 2, ' ')

§ AVP_BUFFSIZE

#define AVP_BUFFSIZE   4096

Definition at line 912 of file avprobe.c.

Referenced by main().

Enumeration Type Documentation

§ PrintElementType

Enumerator
ARRAY 
OBJECT 

Definition at line 82 of file avprobe.c.

Function Documentation

§ avprobe_cleanup()

static void avprobe_cleanup ( int  ret)
static

Definition at line 63 of file avprobe.c.

Referenced by main().

§ ini_print_header()

static void ini_print_header ( void  )
static

Definition at line 125 of file avprobe.c.

Referenced by main(), and opt_output_format().

§ ini_print_footer()

static void ini_print_footer ( void  )
static

Definition at line 129 of file avprobe.c.

Referenced by main(), and opt_output_format().

§ ini_escape_print()

static void ini_escape_print ( const char *  s)
static

Definition at line 134 of file avprobe.c.

Referenced by ini_print_integer(), and ini_print_string().

§ ini_print_array_header()

static void ini_print_array_header ( const char *  name)
static

Definition at line 160 of file avprobe.c.

Referenced by main(), and opt_output_format().

§ ini_print_object_header()

static void ini_print_object_header ( const char *  name)
static

Definition at line 166 of file avprobe.c.

Referenced by main(), and opt_output_format().

§ ini_print_integer()

static void ini_print_integer ( const char *  key,
int64_t  value 
)
static

Definition at line 189 of file avprobe.c.

Referenced by main(), and opt_output_format().

§ ini_print_string()

static void ini_print_string ( const char *  key,
const char *  value 
)
static

Definition at line 196 of file avprobe.c.

Referenced by main(), old_print_string(), and opt_output_format().

§ json_print_header()

static void json_print_header ( void  )
static

Definition at line 208 of file avprobe.c.

Referenced by opt_output_format().

§ json_print_footer()

static void json_print_footer ( void  )
static

Definition at line 212 of file avprobe.c.

Referenced by opt_output_format().

§ json_print_array_header()

static void json_print_array_header ( const char *  name)
static

Definition at line 217 of file avprobe.c.

Referenced by opt_output_format().

§ json_print_array_footer()

static void json_print_array_footer ( const char *  name)
static

Definition at line 226 of file avprobe.c.

Referenced by opt_output_format().

§ json_print_object_header()

static void json_print_object_header ( const char *  name)
static

Definition at line 233 of file avprobe.c.

Referenced by opt_output_format().

§ json_print_object_footer()

static void json_print_object_footer ( const char *  name)
static

Definition at line 243 of file avprobe.c.

Referenced by opt_output_format().

§ json_print_integer()

static void json_print_integer ( const char *  key,
int64_t  value 
)
static

Definition at line 250 of file avprobe.c.

Referenced by opt_output_format().

§ json_escape_print()

static void json_escape_print ( const char *  s)
static

Definition at line 258 of file avprobe.c.

Referenced by json_print_string().

§ json_print_string()

static void json_print_string ( const char *  key,
const char *  value 
)
static

Definition at line 282 of file avprobe.c.

Referenced by opt_output_format().

§ old_print_object_header()

static void old_print_object_header ( const char *  name)
static

Definition at line 297 of file avprobe.c.

Referenced by opt_output_format().

§ old_print_object_footer()

static void old_print_object_footer ( const char *  name)
static

Definition at line 314 of file avprobe.c.

Referenced by opt_output_format().

§ old_print_string()

static void old_print_string ( const char *  key,
const char *  value 
)
static

Definition at line 331 of file avprobe.c.

Referenced by opt_output_format().

§ show_format_entry_integer()

static void show_format_entry_integer ( const char *  key,
int64_t  value 
)
static

Definition at line 342 of file avprobe.c.

Referenced by opt_show_format_entry().

§ show_format_entry_string()

static void show_format_entry_string ( const char *  key,
const char *  value 
)
static

Definition at line 351 of file avprobe.c.

Referenced by opt_show_format_entry().

§ probe_group_enter()

static void probe_group_enter ( const char *  name,
int  type 
)
static

Definition at line 360 of file avprobe.c.

Referenced by probe_array_header(), probe_header(), and probe_object_header().

§ probe_group_leave()

static void probe_group_leave ( void  )
static

Definition at line 382 of file avprobe.c.

Referenced by probe_array_footer(), probe_footer(), and probe_object_footer().

§ probe_header()

static void probe_header ( void  )
static

Definition at line 387 of file avprobe.c.

Referenced by main().

§ probe_footer()

static void probe_footer ( void  )
static

Definition at line 394 of file avprobe.c.

Referenced by main().

§ probe_array_header()

static void probe_array_header ( const char *  name)
static

Definition at line 402 of file avprobe.c.

Referenced by probe_file(), and show_packets().

§ probe_array_footer()

static void probe_array_footer ( const char *  name)
static

Definition at line 410 of file avprobe.c.

Referenced by probe_file(), and show_packets().

§ probe_object_header()

static void probe_object_header ( const char *  name)
static

Definition at line 417 of file avprobe.c.

Referenced by probe_dict(), show_format(), show_packet(), and show_stream().

§ probe_object_footer()

static void probe_object_footer ( const char *  name)
static

Definition at line 425 of file avprobe.c.

Referenced by probe_dict(), show_format(), show_packet(), and show_stream().

§ probe_int()

static void probe_int ( const char *  key,
int64_t  value 
)
static

Definition at line 432 of file avprobe.c.

Referenced by show_format(), show_packet(), and show_stream().

§ probe_str()

static void probe_str ( const char *  key,
const char *  value 
)
static

Definition at line 438 of file avprobe.c.

Referenced by probe_dict(), show_format(), show_packet(), and show_stream().

§ probe_dict()

static void probe_dict ( AVDictionary dict,
const char *  name 
)
static

Definition at line 444 of file avprobe.c.

Referenced by show_format(), and show_stream().

§ value_string()

static char* value_string ( char *  buf,
int  buf_size,
double  val,
const char *  unit 
)
static

Definition at line 456 of file avprobe.c.

Referenced by show_format(), show_packet(), show_stream(), and time_value_string().

§ time_value_string()

static char* time_value_string ( char *  buf,
int  buf_size,
int64_t  val,
const AVRational time_base 
)
static

Definition at line 493 of file avprobe.c.

Referenced by show_format(), show_packet(), and show_stream().

§ ts_value_string()

static char* ts_value_string ( char *  buf,
int  buf_size,
int64_t  ts 
)
static

Definition at line 505 of file avprobe.c.

Referenced by show_packet().

§ rational_string()

static char* rational_string ( char *  buf,
int  buf_size,
const char *  sep,
const AVRational rat 
)
static

Definition at line 516 of file avprobe.c.

Referenced by show_stream().

§ tag_string()

static char* tag_string ( char *  buf,
int  buf_size,
int  tag 
)
static

Definition at line 523 of file avprobe.c.

Referenced by show_stream().

§ show_packet()

static void show_packet ( AVFormatContext fmt_ctx,
AVPacket pkt 
)
static

Definition at line 529 of file avprobe.c.

Referenced by show_packets().

§ show_packets()

static void show_packets ( AVFormatContext fmt_ctx)
static

Definition at line 555 of file avprobe.c.

Referenced by probe_file().

§ show_stream()

static void show_stream ( AVFormatContext fmt_ctx,
int  stream_idx 
)
static

Definition at line 566 of file avprobe.c.

Referenced by probe_file().

§ show_format()

static void show_format ( AVFormatContext fmt_ctx)
static

Definition at line 668 of file avprobe.c.

Referenced by probe_file().

§ open_input_file()

static int open_input_file ( AVFormatContext **  fmt_ctx_ptr,
const char *  filename 
)
static

Definition at line 697 of file avprobe.c.

Referenced by probe_file().

§ close_input_file()

static void close_input_file ( AVFormatContext **  ctx_ptr)
static

Definition at line 744 of file avprobe.c.

Referenced by probe_file().

§ probe_file()

static int probe_file ( const char *  filename)
static

Definition at line 758 of file avprobe.c.

Referenced by main().

§ show_usage()

static void show_usage ( void  )
static

Definition at line 783 of file avprobe.c.

Referenced by main(), and show_help_default().

§ opt_format()

static int opt_format ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 790 of file avprobe.c.

§ opt_output_format()

static int opt_output_format ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 800 of file avprobe.c.

§ opt_show_format_entry()

static int opt_show_format_entry ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 834 of file avprobe.c.

§ opt_input_file()

static void opt_input_file ( void optctx,
const char *  arg 
)
static

Definition at line 851 of file avprobe.c.

Referenced by main().

§ show_help_default()

void show_help_default ( const char *  opt,
const char *  arg 
)

Per-avtool specific help handler.

Implemented in each avtool, called by show_help().

Definition at line 864 of file avprobe.c.

§ opt_pretty()

static int opt_pretty ( void optctx,
const char *  opt,
const char *  arg 
)
static

Definition at line 873 of file avprobe.c.

§ probe_buf_write()

static int probe_buf_write ( void opaque,
uint8_t buf,
int  buf_size 
)
static

Definition at line 906 of file avprobe.c.

Referenced by main().

§ main()

int main ( int  argc,
char **  argv 
)

Definition at line 914 of file avprobe.c.

Variable Documentation

§ program_name

const char program_name[] = "avprobe"

program name, defined by the program for show_version().

Definition at line 34 of file avprobe.c.

Referenced by main(), and show_usage().

§ program_birth_year

const int program_birth_year = 2007

program birth year, defined by the program for show_banner()

Definition at line 35 of file avprobe.c.

§ do_show_format

int do_show_format = 0
static

Definition at line 37 of file avprobe.c.

Referenced by opt_show_format_entry(), and probe_file().

§ fmt_entries_to_show

AVDictionary* fmt_entries_to_show = NULL
static

Definition at line 38 of file avprobe.c.

§ nb_fmt_entries_to_show

int nb_fmt_entries_to_show
static

§ do_show_packets

int do_show_packets = 0
static

Definition at line 40 of file avprobe.c.

Referenced by probe_file().

§ do_show_streams

int do_show_streams = 0
static

Definition at line 41 of file avprobe.c.

Referenced by probe_file().

§ show_value_unit

int show_value_unit = 0
static

Definition at line 43 of file avprobe.c.

Referenced by opt_pretty(), and value_string().

§ use_value_prefix

int use_value_prefix = 0
static

Definition at line 44 of file avprobe.c.

Referenced by opt_pretty(), and value_string().

§ use_byte_value_binary_prefix

int use_byte_value_binary_prefix = 0
static

Definition at line 45 of file avprobe.c.

Referenced by opt_pretty(), and value_string().

§ use_value_sexagesimal_format

int use_value_sexagesimal_format = 0
static

Definition at line 46 of file avprobe.c.

Referenced by opt_pretty(), and value_string().

§ options

const OptionDef* options
static

Definition at line 49 of file avprobe.c.

§ input_filename

const char* input_filename
static

Definition at line 52 of file avprobe.c.

Referenced by main(), and opt_input_file().

§ iformat

AVInputFormat* iformat = NULL
static

Definition at line 53 of file avprobe.c.

Referenced by movie_init(), and stream_open().

§ binary_unit_prefixes

const char* const binary_unit_prefixes[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi" }
static

Definition at line 55 of file avprobe.c.

Referenced by value_string().

§ decimal_unit_prefixes

const char* const decimal_unit_prefixes[] = { "", "K" , "M" , "G" , "T" , "P" }
static

Definition at line 56 of file avprobe.c.

Referenced by value_string().

§ unit_second_str

const char unit_second_str[] = "s"
static

Definition at line 58 of file avprobe.c.

Referenced by time_value_string(), and value_string().

§ unit_hertz_str

const char unit_hertz_str[] = "Hz"
static

Definition at line 59 of file avprobe.c.

Referenced by show_stream().

§ unit_byte_str

const char unit_byte_str[] = "byte"
static

Definition at line 60 of file avprobe.c.

Referenced by show_format(), show_packet(), and value_string().

§ unit_bit_per_second_str

const char unit_bit_per_second_str[] = "bit/s"
static

Definition at line 61 of file avprobe.c.

Referenced by show_format(), and show_stream().

§ probe_out

AVIOContext* probe_out = NULL
static

Definition at line 109 of file avprobe.c.

§ octx

PrintContext octx
static

Definition at line 110 of file avprobe.c.

Referenced by avconv_parse_options().

§ real_options

const OptionDef real_options[]
static

Definition at line 882 of file avprobe.c.

Referenced by main().