FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
ffprobe.c File Reference

simple media prober based on the FFmpeg libraries More...

#include "config.h"
#include "libavutil/ffversion.h"
#include <string.h>
#include "libavformat/avformat.h"
#include "libavcodec/avcodec.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/display.h"
#include "libavutil/hash.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/stereo3d.h"
#include "libavutil/dict.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/libm.h"
#include "libavutil/parseutils.h"
#include "libavutil/timecode.h"
#include "libavutil/timestamp.h"
#include "libavdevice/avdevice.h"
#include "libswscale/swscale.h"
#include "libswresample/swresample.h"
#include "libpostproc/postprocess.h"
#include "cmdutils.h"
#include "cmdutils_common_opts.h"

Go to the source code of this file.

Data Structures

struct  InputStream
 
struct  InputFile
 
struct  ReadInterval
 
struct  section
 
struct  unit_value
 
struct  Writer
 
struct  WriterContext
 
struct  DefaultContext
 
struct  CompactContext
 
struct  FlatContext
 
struct  INIContext
 
struct  JSONContext
 
struct  XMLContext
 

Macros

#define SECTION_MAX_NB_CHILDREN   10
 
#define SECTION_FLAG_IS_WRAPPER   1
 the section only contains other sections, but has no data at its own level More...
 
#define SECTION_FLAG_IS_ARRAY   2
 the section contains an array of elements of the same type More...
 
#define SECTION_FLAG_HAS_VARIABLE_FIELDS   4
 the section may contain a variable number of fields with variable keys. More...
 
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS   1
 
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER   2
 
#define SECTION_MAX_NB_LEVELS   10
 
#define OFFSET(x)   offsetof(WriterContext, x)
 
#define PRINT_STRING_OPT   1
 
#define PRINT_STRING_VALIDATE   2
 
#define MAX_REGISTERED_WRITERS_NB   64
 
#define DEFINE_WRITER_CLASS(name)
 
#define OFFSET(x)   offsetof(DefaultContext, x)
 
#define OFFSET(x)   offsetof(CompactContext, x)
 
#define OFFSET(x)   offsetof(CompactContext, x)
 
#define OFFSET(x)   offsetof(FlatContext, x)
 
#define OFFSET(x)   offsetof(INIContext, x)
 
#define OFFSET(x)   offsetof(JSONContext, x)
 
#define JSON_INDENT()   printf("%*c", json->indent_level * 4, ' ')
 
#define OFFSET(x)   offsetof(XMLContext, x)
 
#define CHECK_COMPLIANCE(opt, opt_name)
 
#define XML_INDENT()   printf("%*c", xml->indent_level * 4, ' ')
 
#define print_fmt(k, f,...)
 
#define print_int(k, v)   writer_print_integer(w, k, v)
 
#define print_q(k, v, s)   writer_print_rational(w, k, v, s)
 
#define print_str(k, v)   writer_print_string(w, k, v, 0)
 
#define print_str_opt(k, v)   writer_print_string(w, k, v, PRINT_STRING_OPT)
 
#define print_str_validate(k, v)   writer_print_string(w, k, v, PRINT_STRING_VALIDATE)
 
#define print_time(k, v, tb)   writer_print_time(w, k, v, tb, 0)
 
#define print_ts(k, v)   writer_print_ts(w, k, v, 0)
 
#define print_duration_time(k, v, tb)   writer_print_time(w, k, v, tb, 1)
 
#define print_duration_ts(k, v)   writer_print_ts(w, k, v, 1)
 
#define print_val(k, v, u)
 
#define print_section_header(s)   writer_print_section_header(w, s)
 
#define print_section_footer(s)   writer_print_section_footer(w, s)
 
#define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n)
 
#define PRINT_DISPOSITION(flagname, name)
 
#define CHECK_END   if (ret < 0) goto end
 
#define SHOW_LIB_VERSION(libname, LIBNAME)
 
#define PRINT_PIX_FMT_FLAG(flagname, name)
 
#define DEFINE_OPT_SHOW_SECTION(section, target_section_id)
 
#define SET_DO_SHOW(id, varname)
 

Enumerations

enum  SectionID {
  SECTION_ID_NONE = -1, SECTION_ID_CHAPTER, SECTION_ID_CHAPTER_TAGS, SECTION_ID_CHAPTERS,
  SECTION_ID_ERROR, SECTION_ID_FORMAT, SECTION_ID_FORMAT_TAGS, SECTION_ID_FRAME,
  SECTION_ID_FRAMES, SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDE_DATA_LIST, SECTION_ID_FRAME_SIDE_DATA,
  SECTION_ID_LIBRARY_VERSION, SECTION_ID_LIBRARY_VERSIONS, SECTION_ID_PACKET, SECTION_ID_PACKET_TAGS,
  SECTION_ID_PACKETS, SECTION_ID_PACKETS_AND_FRAMES, SECTION_ID_PACKET_SIDE_DATA_LIST, SECTION_ID_PACKET_SIDE_DATA,
  SECTION_ID_PIXEL_FORMAT, SECTION_ID_PIXEL_FORMAT_FLAGS, SECTION_ID_PIXEL_FORMAT_COMPONENT, SECTION_ID_PIXEL_FORMAT_COMPONENTS,
  SECTION_ID_PIXEL_FORMATS, SECTION_ID_PROGRAM_STREAM_DISPOSITION, SECTION_ID_PROGRAM_STREAM_TAGS, SECTION_ID_PROGRAM,
  SECTION_ID_PROGRAM_STREAMS, SECTION_ID_PROGRAM_STREAM, SECTION_ID_PROGRAM_TAGS, SECTION_ID_PROGRAM_VERSION,
  SECTION_ID_PROGRAMS, SECTION_ID_ROOT, SECTION_ID_STREAM, SECTION_ID_STREAM_DISPOSITION,
  SECTION_ID_STREAMS, SECTION_ID_STREAM_TAGS, SECTION_ID_STREAM_SIDE_DATA_LIST, SECTION_ID_STREAM_SIDE_DATA,
  SECTION_ID_SUBTITLE
}
 
enum  StringValidation { WRITER_STRING_VALIDATION_FAIL, WRITER_STRING_VALIDATION_REPLACE, WRITER_STRING_VALIDATION_IGNORE, WRITER_STRING_VALIDATION_NB }
 

Functions

static void ffprobe_cleanup (int ret)
 
static char * value_string (char *buf, int buf_size, struct unit_value uv)
 
static const char * writer_get_name (void *p)
 
static voidwriter_child_next (void *obj, void *prev)
 
static void writer_close (WriterContext **wctx)
 
static void bprint_bytes (AVBPrint *bp, const uint8_t *ubuf, size_t ubuf_size)
 
static int writer_open (WriterContext **wctx, const Writer *writer, const char *args, const struct section *sections, int nb_sections)
 
static void writer_print_section_header (WriterContext *wctx, int section_id)
 
static void writer_print_section_footer (WriterContext *wctx)
 
static void writer_print_integer (WriterContext *wctx, const char *key, long long int val)
 
static int validate_string (WriterContext *wctx, char **dstp, const char *src)
 
static int writer_print_string (WriterContext *wctx, const char *key, const char *val, int flags)
 
static void writer_print_rational (WriterContext *wctx, const char *key, AVRational q, char sep)
 
static void writer_print_time (WriterContext *wctx, const char *key, int64_t ts, const AVRational *time_base, int is_duration)
 
static void writer_print_ts (WriterContext *wctx, const char *key, int64_t ts, int is_duration)
 
static void writer_print_data (WriterContext *wctx, const char *name, uint8_t *data, int size)
 
static void writer_print_data_hash (WriterContext *wctx, const char *name, uint8_t *data, int size)
 
static void writer_print_integers (WriterContext *wctx, const char *name, uint8_t *data, int size, const char *format, int columns, int bytes, int offset_add)
 
static int writer_register (const Writer *writer)
 
static const Writerwriter_get_by_name (const char *name)
 
 DEFINE_WRITER_CLASS (default)
 
static char * upcase_string (char *dst, size_t dst_size, const char *src)
 
static void default_print_section_header (WriterContext *wctx)
 
static void default_print_section_footer (WriterContext *wctx)
 
static void default_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void default_print_int (WriterContext *wctx, const char *key, long long int value)
 
static const char * c_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 Apply C-language-like string escaping. More...
 
static const char * csv_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 Quote fields containing special characters, check RFC4180. More...
 
static const char * none_escape_str (AVBPrint *dst, const char *src, const char sep, void *log_ctx)
 
 DEFINE_WRITER_CLASS (compact)
 
static av_cold int compact_init (WriterContext *wctx)
 
static void compact_print_section_header (WriterContext *wctx)
 
static void compact_print_section_footer (WriterContext *wctx)
 
static void compact_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void compact_print_int (WriterContext *wctx, const char *key, long long int value)
 
 DEFINE_WRITER_CLASS (csv)
 
 DEFINE_WRITER_CLASS (flat)
 
static av_cold int flat_init (WriterContext *wctx)
 
static const char * flat_escape_key_str (AVBPrint *dst, const char *src, const char sep)
 
static const char * flat_escape_value_str (AVBPrint *dst, const char *src)
 
static void flat_print_section_header (WriterContext *wctx)
 
static void flat_print_int (WriterContext *wctx, const char *key, long long int value)
 
static void flat_print_str (WriterContext *wctx, const char *key, const char *value)
 
 DEFINE_WRITER_CLASS (ini)
 
static char * ini_escape_str (AVBPrint *dst, const char *src)
 
static void ini_print_section_header (WriterContext *wctx)
 
static void ini_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void ini_print_int (WriterContext *wctx, const char *key, long long int value)
 
 DEFINE_WRITER_CLASS (json)
 
static av_cold int json_init (WriterContext *wctx)
 
static const char * json_escape_str (AVBPrint *dst, const char *src, void *log_ctx)
 
static void json_print_section_header (WriterContext *wctx)
 
static void json_print_section_footer (WriterContext *wctx)
 
static void json_print_item_str (WriterContext *wctx, const char *key, const char *value)
 
static void json_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void json_print_int (WriterContext *wctx, const char *key, long long int value)
 
 DEFINE_WRITER_CLASS (xml)
 
static av_cold int xml_init (WriterContext *wctx)
 
static const char * xml_escape_str (AVBPrint *dst, const char *src, void *log_ctx)
 
static void xml_print_section_header (WriterContext *wctx)
 
static void xml_print_section_footer (WriterContext *wctx)
 
static void xml_print_str (WriterContext *wctx, const char *key, const char *value)
 
static void xml_print_int (WriterContext *wctx, const char *key, long long int value)
 
static void writer_register_all (void)
 
static int show_tags (WriterContext *w, AVDictionary *tags, int section_id)
 
static void print_pkt_side_data (WriterContext *w, const AVPacketSideData *side_data, int nb_side_data, SectionID id_data_list, SectionID id_data)
 
static void show_packet (WriterContext *w, InputFile *ifile, AVPacket *pkt, int packet_idx)
 
static void show_subtitle (WriterContext *w, AVSubtitle *sub, AVStream *stream, AVFormatContext *fmt_ctx)
 
static void show_frame (WriterContext *w, AVFrame *frame, AVStream *stream, AVFormatContext *fmt_ctx)
 
static av_always_inline int process_frame (WriterContext *w, InputFile *ifile, AVFrame *frame, AVPacket *pkt)
 
static void log_read_interval (const ReadInterval *interval, void *log_ctx, int log_level)
 
static int read_interval_packets (WriterContext *w, InputFile *ifile, const ReadInterval *interval, int64_t *cur_ts)
 
static int read_packets (WriterContext *w, InputFile *ifile)
 
static int show_stream (WriterContext *w, AVFormatContext *fmt_ctx, int stream_idx, InputStream *ist, int in_program)
 
static int show_streams (WriterContext *w, InputFile *ifile)
 
static int show_program (WriterContext *w, InputFile *ifile, AVProgram *program)
 
static int show_programs (WriterContext *w, InputFile *ifile)
 
static int show_chapters (WriterContext *w, InputFile *ifile)
 
static int show_format (WriterContext *w, InputFile *ifile)
 
static void show_error (WriterContext *w, int err)
 
static int open_input_file (InputFile *ifile, const char *filename)
 
static void close_input_file (InputFile *ifile)
 
static int probe_file (WriterContext *wctx, const char *filename)
 
static void show_usage (void)
 
static void ffprobe_show_program_version (WriterContext *w)
 
static void ffprobe_show_library_versions (WriterContext *w)
 
static void ffprobe_show_pixel_formats (WriterContext *w)
 
static int opt_format (void *optctx, const char *opt, const char *arg)
 
static void mark_section_show_entries (SectionID section_id, int show_all_entries, AVDictionary *entries)
 
static int match_section (const char *section_name, int show_all_entries, AVDictionary *entries)
 
static int opt_show_entries (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)
 
static int opt_input_file_i (void *optctx, const char *opt, const char *arg)
 
void show_help_default (const char *opt, const char *arg)
 Per-fftool specific help handler. More...
 
static int parse_read_interval (const char *interval_spec, ReadInterval *interval)
 Parse interval specification, according to the format: INTERVAL ::= [START|+START_OFFSET][%[END|+END_OFFSET]] INTERVALS ::= INTERVAL[,INTERVALS]. More...
 
static int parse_read_intervals (const char *intervals_spec)
 
static int opt_read_intervals (void *optctx, const char *opt, const char *arg)
 
static int opt_pretty (void *optctx, const char *opt, const char *arg)
 
static void print_section (SectionID id, int level)
 
static int opt_sections (void *optctx, const char *opt, const char *arg)
 
static int opt_show_versions (const char *opt, const char *arg)
 
static int check_section_show_entries (int section_id)
 
int main (int argc, char **argv)
 

Variables

const char program_name [] = "ffprobe"
 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_bitexact = 0
 
static int do_count_frames = 0
 
static int do_count_packets = 0
 
static int do_read_frames = 0
 
static int do_read_packets = 0
 
static int do_show_chapters = 0
 
static int do_show_error = 0
 
static int do_show_format = 0
 
static int do_show_frames = 0
 
static int do_show_packets = 0
 
static int do_show_programs = 0
 
static int do_show_streams = 0
 
static int do_show_stream_disposition = 0
 
static int do_show_data = 0
 
static int do_show_program_version = 0
 
static int do_show_library_versions = 0
 
static int do_show_pixel_formats = 0
 
static int do_show_pixel_format_flags = 0
 
static int do_show_pixel_format_components = 0
 
static int do_show_chapter_tags = 0
 
static int do_show_format_tags = 0
 
static int do_show_frame_tags = 0
 
static int do_show_program_tags = 0
 
static int do_show_stream_tags = 0
 
static int do_show_packet_tags = 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 int show_private_data = 1
 
static char * print_format
 
static char * stream_specifier
 
static char * show_data_hash
 
static ReadIntervalread_intervals
 
static int read_intervals_nb = 0
 
static struct section sections []
 
static const OptionDefoptions
 
static const char * input_filename
 
static AVInputFormatiformat = NULL
 
static struct AVHashContexthash
 
struct {
   double   bin_val
 
   double   dec_val
 
   const char *   bin_str
 
   const char *   dec_str
 
si_prefixes []
 
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 int nb_streams
 
static uint64_t * nb_streams_packets
 
static uint64_t * nb_streams_frames
 
static int * selected_streams
 
static const AVOption writer_options []
 
static const AVClass writer_class
 
static const Writerregistered_writers [MAX_REGISTERED_WRITERS_NB+1]
 
static const AVOption default_options []
 
static const Writer default_writer
 
static const AVOption compact_options []
 
static const Writer compact_writer
 
static const AVOption csv_options []
 
static const Writer csv_writer
 
static const AVOption flat_options []
 
static const Writer flat_writer
 
static const AVOption ini_options []
 
static const Writer ini_writer
 
static const AVOption json_options []
 
static const Writer json_writer
 
static const AVOption xml_options []
 
static Writer xml_writer
 
static const OptionDef real_options []
 

Detailed Description

simple media prober based on the FFmpeg libraries

Definition in file ffprobe.c.

Macro Definition Documentation

#define SECTION_MAX_NB_CHILDREN   10

Definition at line 119 of file ffprobe.c.

#define SECTION_FLAG_IS_WRAPPER   1
#define SECTION_FLAG_IS_ARRAY   2
#define SECTION_FLAG_HAS_VARIABLE_FIELDS   4

the section may contain a variable number of fields with variable keys.

Definition at line 127 of file ffprobe.c.

Referenced by print_section(), xml_print_section_footer(), xml_print_section_header(), and xml_print_str().

#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS   1

Definition at line 328 of file ffprobe.c.

Referenced by writer_print_string().

#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER   2

Definition at line 329 of file ffprobe.c.

Referenced by probe_file().

#define SECTION_MAX_NB_LEVELS   10

Definition at line 354 of file ffprobe.c.

Referenced by writer_close(), writer_open(), and writer_print_section_header().

#define OFFSET (   x)    offsetof(WriterContext, x)

Definition at line 1534 of file ffprobe.c.

#define PRINT_STRING_OPT   1

Definition at line 642 of file ffprobe.c.

Referenced by writer_print_string(), writer_print_time(), and writer_print_ts().

#define PRINT_STRING_VALIDATE   2

Definition at line 643 of file ffprobe.c.

Referenced by writer_print_string().

#define MAX_REGISTERED_WRITERS_NB   64

Definition at line 785 of file ffprobe.c.

Referenced by writer_register().

#define DEFINE_WRITER_CLASS (   name)
Value:
static const char *name##_get_name(void *ctx) \
{ \
} \
static const AVClass name##_class = { \
.item_name = name##_get_name, \
.option = name##_options \
}
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
return
AVFormatContext * ctx
Definition: movenc.c:48
Describe the class of an AVClass context structure.
Definition: log.h:67
const char * name
Definition: opengl_enc.c:103

Definition at line 814 of file ffprobe.c.

#define OFFSET (   x)    offsetof(DefaultContext, x)

Definition at line 1534 of file ffprobe.c.

#define OFFSET (   x)    offsetof(CompactContext, x)

Definition at line 1534 of file ffprobe.c.

#define OFFSET (   x)    offsetof(CompactContext, x)

Definition at line 1534 of file ffprobe.c.

#define OFFSET (   x)    offsetof(FlatContext, x)

Definition at line 1534 of file ffprobe.c.

#define OFFSET (   x)    offsetof(INIContext, x)

Definition at line 1534 of file ffprobe.c.

#define OFFSET (   x)    offsetof(JSONContext, x)

Definition at line 1534 of file ffprobe.c.

#define JSON_INDENT ( )    printf("%*c", json->indent_level * 4, ' ')
#define OFFSET (   x)    offsetof(XMLContext, x)

Definition at line 1534 of file ffprobe.c.

#define CHECK_COMPLIANCE (   opt,
  opt_name 
)
Value:
if (opt) { \
"XSD-compliant output selected but option '%s' was selected, XML output may be non-compliant.\n" \
"You need to disable such option with '-no%s'\n", opt_name, opt_name); \
return AVERROR(EINVAL); \
}
#define av_log(a,...)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
return

Referenced by xml_init().

#define XML_INDENT ( )    printf("%*c", xml->indent_level * 4, ' ')

Definition at line 1592 of file ffprobe.c.

Referenced by xml_print_section_footer(), xml_print_section_header(), and xml_print_str().

#define print_fmt (   k,
  f,
  ... 
)
Value:
do { \
av_bprintf(&pbuf, f, __VA_ARGS__); \
writer_print_string(w, k, pbuf.str, 0); \
} while (0)
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition: bprint.c:94
void av_bprint_clear(AVBPrint *buf)
Reset the string to "" but keep internal allocated data.
Definition: bprint.c:227
static int writer_print_string(WriterContext *wctx, const char *key, const char *val, int flags)
Definition: ffprobe.c:645

Definition at line 1712 of file ffprobe.c.

Referenced by ffprobe_show_program_version(), show_frame(), show_packet(), and show_stream().

#define print_int (   k,
 
)    writer_print_integer(w, k, v)
#define print_q (   k,
  v,
  s 
)    writer_print_rational(w, k, v, s)

Definition at line 1719 of file ffprobe.c.

Referenced by show_chapters(), show_frame(), and show_stream().

#define print_str (   k,
 
)    writer_print_string(w, k, v, 0)
#define print_str_opt (   k,
 
)    writer_print_string(w, k, v, PRINT_STRING_OPT)
#define print_str_validate (   k,
 
)    writer_print_string(w, k, v, PRINT_STRING_VALIDATE)

Definition at line 1722 of file ffprobe.c.

Referenced by show_format(), and show_tags().

#define print_time (   k,
  v,
  tb 
)    writer_print_time(w, k, v, tb, 0)
#define print_ts (   k,
 
)    writer_print_ts(w, k, v, 0)

Definition at line 1724 of file ffprobe.c.

Referenced by show_frame(), show_packet(), show_program(), show_stream(), and show_subtitle().

#define print_duration_time (   k,
  v,
  tb 
)    writer_print_time(w, k, v, tb, 1)

Definition at line 1725 of file ffprobe.c.

Referenced by show_frame(), and show_packet().

#define print_duration_ts (   k,
 
)    writer_print_ts(w, k, v, 1)

Definition at line 1726 of file ffprobe.c.

Referenced by show_frame(), and show_packet().

#define print_val (   k,
  v,
  u 
)
Value:
do { \
struct unit_value uv; \
uv.val.i = v; \
uv.unit = u; \
writer_print_string(w, k, value_string(val_str, sizeof(val_str), uv), 0); \
} while (0)
static char * value_string(char *buf, int buf_size, struct unit_value uv)
Definition: ffprobe.c:271
union unit_value::@28 val
#define u(width,...)
static int writer_print_string(WriterContext *wctx, const char *key, const char *val, int flags)
Definition: ffprobe.c:645
long long int i
Definition: ffprobe.c:267

Definition at line 1727 of file ffprobe.c.

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

#define print_section_header (   s)    writer_print_section_header(w, s)

Definition at line 1734 of file ffprobe.c.

#define print_section_footer (   s)    writer_print_section_footer(w, s)

Definition at line 1735 of file ffprobe.c.

#define REALLOCZ_ARRAY_STREAM (   ptr,
  cur_n,
  new_n 
)
Value:
{ \
ret = av_reallocp_array(&(ptr), (new_n), sizeof(*(ptr))); \
if (ret < 0) \
goto end; \
memset( (ptr) + (cur_n), 0, ((new_n) - (cur_n)) * sizeof(*(ptr)) ); \
}
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Definition: mem.c:215
if(ret< 0)
Definition: vf_mcdeint.c:282

Definition at line 1737 of file ffprobe.c.

Referenced by probe_file(), and read_interval_packets().

#define PRINT_DISPOSITION (   flagname,
  name 
)
Value:
do { \
print_int(name, !!(stream->disposition & AV_DISPOSITION_##flagname)); \
} while (0)
#define print_int(k, v)
Definition: ffprobe.c:1718
const char * name
Definition: opengl_enc.c:103

Referenced by show_stream().

#define CHECK_END   if (ret < 0) goto end

Referenced by probe_file().

#define SHOW_LIB_VERSION (   libname,
  LIBNAME 
)
Value:
do { \
if (CONFIG_##LIBNAME) { \
unsigned int version = libname##_version(); \
print_str("name", "lib" #libname); \
print_int("major", LIB##LIBNAME##_VERSION_MAJOR); \
print_int("minor", LIB##LIBNAME##_VERSION_MINOR); \
print_int("micro", LIB##LIBNAME##_VERSION_MICRO); \
print_int("version", version); \
print_str("ident", LIB##LIBNAME##_IDENT); \
} \
} while (0)
int version
Definition: avisynth_c.h:629
static void writer_print_section_header(WriterContext *wctx, int section_id)
Definition: ffprobe.c:535
#define print_int(k, v)
Definition: ffprobe.c:1718
if(ret< 0)
Definition: vf_mcdeint.c:282
#define print_str(k, v)
Definition: ffprobe.c:1720
static void writer_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:559

Definition at line 2753 of file ffprobe.c.

Referenced by ffprobe_show_library_versions().

#define PRINT_PIX_FMT_FLAG (   flagname,
  name 
)
Value:
do { \
print_int(name, !!(pixdesc->flags & AV_PIX_FMT_FLAG_##flagname)); \
} while (0)
#define print_int(k, v)
Definition: ffprobe.c:1718
const char * name
Definition: opengl_enc.c:103

Definition at line 2782 of file ffprobe.c.

Referenced by ffprobe_show_pixel_formats().

#define DEFINE_OPT_SHOW_SECTION (   section,
  target_section_id 
)
Value:
static int opt_show_##section(const char *opt, const char *arg) \
{ \
mark_section_show_entries(SECTION_ID_##target_section_id, 1, NULL); \
return 0; \
}
#define NULL
Definition: coverity.c:32
static void mark_section_show_entries(SectionID section_id, int show_all_entries, AVDictionary *entries)
Definition: ffprobe.c:2844
const char * arg
Definition: jacosubdec.c:66
return

Definition at line 3157 of file ffprobe.c.

#define SET_DO_SHOW (   id,
  varname 
)
Value:
do { \
if (check_section_show_entries(SECTION_ID_##id)) \
do_show_##varname = 1; \
} while (0)
static int check_section_show_entries(int section_id)
Definition: ffprobe.c:3219
if(ret< 0)
Definition: vf_mcdeint.c:282

Definition at line 3231 of file ffprobe.c.

Referenced by main().

Enumeration Type Documentation

enum SectionID
Enumerator
SECTION_ID_NONE 
SECTION_ID_CHAPTER 
SECTION_ID_CHAPTER_TAGS 
SECTION_ID_CHAPTERS 
SECTION_ID_ERROR 
SECTION_ID_FORMAT 
SECTION_ID_FORMAT_TAGS 
SECTION_ID_FRAME 
SECTION_ID_FRAMES 
SECTION_ID_FRAME_TAGS 
SECTION_ID_FRAME_SIDE_DATA_LIST 
SECTION_ID_FRAME_SIDE_DATA 
SECTION_ID_LIBRARY_VERSION 
SECTION_ID_LIBRARY_VERSIONS 
SECTION_ID_PACKET 
SECTION_ID_PACKET_TAGS 
SECTION_ID_PACKETS 
SECTION_ID_PACKETS_AND_FRAMES 
SECTION_ID_PACKET_SIDE_DATA_LIST 
SECTION_ID_PACKET_SIDE_DATA 
SECTION_ID_PIXEL_FORMAT 
SECTION_ID_PIXEL_FORMAT_FLAGS 
SECTION_ID_PIXEL_FORMAT_COMPONENT 
SECTION_ID_PIXEL_FORMAT_COMPONENTS 
SECTION_ID_PIXEL_FORMATS 
SECTION_ID_PROGRAM_STREAM_DISPOSITION 
SECTION_ID_PROGRAM_STREAM_TAGS 
SECTION_ID_PROGRAM 
SECTION_ID_PROGRAM_STREAMS 
SECTION_ID_PROGRAM_STREAM 
SECTION_ID_PROGRAM_TAGS 
SECTION_ID_PROGRAM_VERSION 
SECTION_ID_PROGRAMS 
SECTION_ID_ROOT 
SECTION_ID_STREAM 
SECTION_ID_STREAM_DISPOSITION 
SECTION_ID_STREAMS 
SECTION_ID_STREAM_TAGS 
SECTION_ID_STREAM_SIDE_DATA_LIST 
SECTION_ID_STREAM_SIDE_DATA 
SECTION_ID_SUBTITLE 

Definition at line 137 of file ffprobe.c.

Enumerator
WRITER_STRING_VALIDATION_FAIL 
WRITER_STRING_VALIDATION_REPLACE 
WRITER_STRING_VALIDATION_IGNORE 
WRITER_STRING_VALIDATION_NB 

Definition at line 331 of file ffprobe.c.

Function Documentation

static void ffprobe_cleanup ( int  ret)
static

Definition at line 259 of file ffprobe.c.

Referenced by main().

static char* value_string ( char *  buf,
int  buf_size,
struct unit_value  uv 
)
static

Definition at line 271 of file ffprobe.c.

Referenced by writer_print_time().

static const char* writer_get_name ( void p)
static

Definition at line 384 of file ffprobe.c.

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

Definition at line 405 of file ffprobe.c.

static void writer_close ( WriterContext **  wctx)
static

Definition at line 421 of file ffprobe.c.

Referenced by main(), and writer_open().

static void bprint_bytes ( AVBPrint *  bp,
const uint8_t ubuf,
size_t  ubuf_size 
)
static

Definition at line 439 of file ffprobe.c.

Referenced by validate_string(), and writer_open().

static int writer_open ( WriterContext **  wctx,
const Writer writer,
const char *  args,
const struct section sections,
int  nb_sections 
)
static

Definition at line 448 of file ffprobe.c.

Referenced by main().

static void writer_print_section_header ( WriterContext wctx,
int  section_id 
)
inlinestatic
static void writer_print_section_footer ( WriterContext wctx)
inlinestatic
static void writer_print_integer ( WriterContext wctx,
const char *  key,
long long int  val 
)
inlinestatic

Definition at line 576 of file ffprobe.c.

Referenced by writer_print_ts().

static int validate_string ( WriterContext wctx,
char **  dstp,
const char *  src 
)
inlinestatic

Definition at line 587 of file ffprobe.c.

Referenced by writer_print_string().

static int writer_print_string ( WriterContext wctx,
const char *  key,
const char *  val,
int  flags 
)
inlinestatic
static void writer_print_rational ( WriterContext wctx,
const char *  key,
AVRational  q,
char  sep 
)
inlinestatic

Definition at line 681 of file ffprobe.c.

static void writer_print_time ( WriterContext wctx,
const char *  key,
int64_t  ts,
const AVRational time_base,
int  is_duration 
)
static

Definition at line 690 of file ffprobe.c.

static void writer_print_ts ( WriterContext wctx,
const char *  key,
int64_t  ts,
int  is_duration 
)
static

Definition at line 707 of file ffprobe.c.

static void writer_print_data ( WriterContext wctx,
const char *  name,
uint8_t data,
int  size 
)
static

Definition at line 716 of file ffprobe.c.

Referenced by show_packet(), and show_stream().

static void writer_print_data_hash ( WriterContext wctx,
const char *  name,
uint8_t data,
int  size 
)
static

Definition at line 744 of file ffprobe.c.

Referenced by show_packet(), and show_stream().

static void writer_print_integers ( WriterContext wctx,
const char *  name,
uint8_t data,
int  size,
const char *  format,
int  columns,
int  bytes,
int  offset_add 
)
static

Definition at line 759 of file ffprobe.c.

Referenced by print_pkt_side_data(), and show_frame().

static int writer_register ( const Writer writer)
static

Definition at line 789 of file ffprobe.c.

Referenced by writer_register_all().

static const Writer* writer_get_by_name ( const char *  name)
static

Definition at line 800 of file ffprobe.c.

Referenced by main().

DEFINE_WRITER_CLASS ( default  )
static char* upcase_string ( char *  dst,
size_t  dst_size,
const char *  src 
)
inlinestatic

Definition at line 848 of file ffprobe.c.

Referenced by default_print_section_footer(), and default_print_section_header().

static void default_print_section_header ( WriterContext wctx)
static

Definition at line 857 of file ffprobe.c.

static void default_print_section_footer ( WriterContext wctx)
static

Definition at line 882 of file ffprobe.c.

static void default_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 895 of file ffprobe.c.

static void default_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 904 of file ffprobe.c.

static const char* c_escape_str ( AVBPrint *  dst,
const char *  src,
const char  sep,
void log_ctx 
)
static

Apply C-language-like string escaping.

Definition at line 929 of file ffprobe.c.

Referenced by compact_init().

static const char* csv_escape_str ( AVBPrint *  dst,
const char *  src,
const char  sep,
void log_ctx 
)
static

Quote fields containing special characters, check RFC4180.

Definition at line 952 of file ffprobe.c.

Referenced by compact_init().

static const char* none_escape_str ( AVBPrint *  dst,
const char *  src,
const char  sep,
void log_ctx 
)
static

Definition at line 970 of file ffprobe.c.

Referenced by compact_init().

DEFINE_WRITER_CLASS ( compact  )
static av_cold int compact_init ( WriterContext wctx)
static

Definition at line 1005 of file ffprobe.c.

static void compact_print_section_header ( WriterContext wctx)
static

Definition at line 1027 of file ffprobe.c.

static void compact_print_section_footer ( WriterContext wctx)
static

Definition at line 1057 of file ffprobe.c.

static void compact_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1067 of file ffprobe.c.

static void compact_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1080 of file ffprobe.c.

DEFINE_WRITER_CLASS ( csv  )
DEFINE_WRITER_CLASS ( flat  )
static av_cold int flat_init ( WriterContext wctx)
static

Definition at line 1155 of file ffprobe.c.

static const char* flat_escape_key_str ( AVBPrint *  dst,
const char *  src,
const char  sep 
)
static

Definition at line 1169 of file ffprobe.c.

Referenced by flat_print_str().

static const char* flat_escape_value_str ( AVBPrint *  dst,
const char *  src 
)
static

Definition at line 1184 of file ffprobe.c.

Referenced by flat_print_str().

static void flat_print_section_header ( WriterContext wctx)
static

Definition at line 1202 of file ffprobe.c.

static void flat_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1228 of file ffprobe.c.

static void flat_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1233 of file ffprobe.c.

DEFINE_WRITER_CLASS ( ini  )
static char* ini_escape_str ( AVBPrint *  dst,
const char *  src 
)
static

Definition at line 1275 of file ffprobe.c.

Referenced by ini_print_str().

static void ini_print_section_header ( WriterContext wctx)
static

Definition at line 1302 of file ffprobe.c.

static void ini_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1335 of file ffprobe.c.

static void ini_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1346 of file ffprobe.c.

DEFINE_WRITER_CLASS ( json  )
static av_cold int json_init ( WriterContext wctx)
static

Definition at line 1381 of file ffprobe.c.

static const char* json_escape_str ( AVBPrint *  dst,
const char *  src,
void log_ctx 
)
static

Definition at line 1391 of file ffprobe.c.

Referenced by json_print_int(), json_print_item_str(), and json_print_section_header().

static void json_print_section_header ( WriterContext wctx)
static

Definition at line 1413 of file ffprobe.c.

static void json_print_section_footer ( WriterContext wctx)
static

Definition at line 1451 of file ffprobe.c.

static void json_print_item_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
inlinestatic

Definition at line 1473 of file ffprobe.c.

Referenced by json_print_str().

static void json_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1485 of file ffprobe.c.

static void json_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1496 of file ffprobe.c.

DEFINE_WRITER_CLASS ( xml  )
static av_cold int xml_init ( WriterContext wctx)
static

Definition at line 1546 of file ffprobe.c.

static const char* xml_escape_str ( AVBPrint *  dst,
const char *  src,
void log_ctx 
)
static

Definition at line 1574 of file ffprobe.c.

Referenced by xml_print_str().

static void xml_print_section_header ( WriterContext wctx)
static

Definition at line 1594 of file ffprobe.c.

static void xml_print_section_footer ( WriterContext wctx)
static

Definition at line 1634 of file ffprobe.c.

static void xml_print_str ( WriterContext wctx,
const char *  key,
const char *  value 
)
static

Definition at line 1653 of file ffprobe.c.

static void xml_print_int ( WriterContext wctx,
const char *  key,
long long int  value 
)
static

Definition at line 1676 of file ffprobe.c.

static void writer_register_all ( void  )
static

Definition at line 1695 of file ffprobe.c.

Referenced by main().

static int show_tags ( WriterContext w,
AVDictionary tags,
int  section_id 
)
inlinestatic
static void print_pkt_side_data ( WriterContext w,
const AVPacketSideData side_data,
int  nb_side_data,
SectionID  id_data_list,
SectionID  id_data 
)
static

Definition at line 1763 of file ffprobe.c.

Referenced by show_packet(), and show_stream().

static void show_packet ( WriterContext w,
InputFile ifile,
AVPacket pkt,
int  packet_idx 
)
static

Definition at line 1792 of file ffprobe.c.

Referenced by read_interval_packets().

static void show_subtitle ( WriterContext w,
AVSubtitle sub,
AVStream stream,
AVFormatContext fmt_ctx 
)
static

Definition at line 1846 of file ffprobe.c.

Referenced by process_frame().

static void show_frame ( WriterContext w,
AVFrame frame,
AVStream stream,
AVFormatContext fmt_ctx 
)
static

Definition at line 1869 of file ffprobe.c.

Referenced by process_frame().

static av_always_inline int process_frame ( WriterContext w,
InputFile ifile,
AVFrame frame,
AVPacket pkt 
)
static

Definition at line 1968 of file ffprobe.c.

Referenced by read_interval_packets().

static void log_read_interval ( const ReadInterval interval,
void log_ctx,
int  log_level 
)
static

Definition at line 2013 of file ffprobe.c.

Referenced by parse_read_intervals(), and read_interval_packets().

static int read_interval_packets ( WriterContext w,
InputFile ifile,
const ReadInterval interval,
int64_t *  cur_ts 
)
static

Definition at line 2037 of file ffprobe.c.

Referenced by read_packets().

static int read_packets ( WriterContext w,
InputFile ifile 
)
static

Definition at line 2143 of file ffprobe.c.

Referenced by probe_file().

static int show_stream ( WriterContext w,
AVFormatContext fmt_ctx,
int  stream_idx,
InputStream ist,
int  in_program 
)
static

Definition at line 2163 of file ffprobe.c.

Referenced by show_program(), and show_streams().

static int show_streams ( WriterContext w,
InputFile ifile 
)
static

Definition at line 2391 of file ffprobe.c.

Referenced by probe_file().

static int show_program ( WriterContext w,
InputFile ifile,
AVProgram program 
)
static

Definition at line 2408 of file ffprobe.c.

Referenced by show_programs().

static int show_programs ( WriterContext w,
InputFile ifile 
)
static

Definition at line 2443 of file ffprobe.c.

Referenced by probe_file().

static int show_chapters ( WriterContext w,
InputFile ifile 
)
static

Definition at line 2461 of file ffprobe.c.

Referenced by probe_file().

static int show_format ( WriterContext w,
InputFile ifile 
)
static

Definition at line 2486 of file ffprobe.c.

Referenced by probe_file().

static void show_error ( WriterContext w,
int  err 
)
static

Definition at line 2517 of file ffprobe.c.

Referenced by main().

static int open_input_file ( InputFile ifile,
const char *  filename 
)
static

Definition at line 2531 of file ffprobe.c.

Referenced by probe_file().

static void close_input_file ( InputFile ifile)
static

Definition at line 2637 of file ffprobe.c.

Referenced by probe_file().

static int probe_file ( WriterContext wctx,
const char *  filename 
)
static

Definition at line 2652 of file ffprobe.c.

Referenced by main().

static void show_usage ( void  )
static

Definition at line 2730 of file ffprobe.c.

Referenced by main(), and show_help_default().

static void ffprobe_show_program_version ( WriterContext w)
static

Definition at line 2737 of file ffprobe.c.

Referenced by main().

static void ffprobe_show_library_versions ( WriterContext w)
static

Definition at line 2768 of file ffprobe.c.

Referenced by main().

static void ffprobe_show_pixel_formats ( WriterContext w)
static

Definition at line 2787 of file ffprobe.c.

Referenced by main().

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

Definition at line 2834 of file ffprobe.c.

static void mark_section_show_entries ( SectionID  section_id,
int  show_all_entries,
AVDictionary entries 
)
inlinestatic

Definition at line 2844 of file ffprobe.c.

Referenced by match_section(), and opt_show_versions().

static int match_section ( const char *  section_name,
int  show_all_entries,
AVDictionary entries 
)
static

Definition at line 2859 of file ffprobe.c.

Referenced by opt_show_entries().

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

Definition at line 2878 of file ffprobe.c.

Referenced by opt_show_format_entry().

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

Definition at line 2928 of file ffprobe.c.

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

Definition at line 2944 of file ffprobe.c.

Referenced by main(), and opt_input_file_i().

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

Definition at line 2957 of file ffprobe.c.

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

Per-fftool specific help handler.

Implemented in each fftool, called by show_help().

Definition at line 2963 of file ffprobe.c.

static int parse_read_interval ( const char *  interval_spec,
ReadInterval interval 
)
static

Parse interval specification, according to the format: INTERVAL ::= [START|+START_OFFSET][%[END|+END_OFFSET]] INTERVALS ::= INTERVAL[,INTERVALS].

Definition at line 2978 of file ffprobe.c.

Referenced by parse_read_intervals().

static int parse_read_intervals ( const char *  intervals_spec)
static

Definition at line 3059 of file ffprobe.c.

Referenced by opt_read_intervals().

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

Definition at line 3107 of file ffprobe.c.

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

Definition at line 3112 of file ffprobe.c.

static void print_section ( SectionID  id,
int  level 
)
static

Definition at line 3121 of file ffprobe.c.

Referenced by opt_sections().

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

Definition at line 3138 of file ffprobe.c.

static int opt_show_versions ( const char *  opt,
const char *  arg 
)
static

Definition at line 3150 of file ffprobe.c.

static int check_section_show_entries ( int  section_id)
inlinestatic

Definition at line 3219 of file ffprobe.c.

int main ( int  argc,
char **  argv 
)

Definition at line 3236 of file ffprobe.c.

Variable Documentation

const char program_name[] = "ffprobe"

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

Definition at line 66 of file ffprobe.c.

Referenced by main(), and show_usage().

const int program_birth_year = 2007

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

Definition at line 67 of file ffprobe.c.

Referenced by ffprobe_show_program_version().

int do_bitexact = 0
static

Definition at line 69 of file ffprobe.c.

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

int do_count_frames = 0
static

Definition at line 70 of file ffprobe.c.

Referenced by probe_file().

int do_count_packets = 0
static

Definition at line 71 of file ffprobe.c.

Referenced by probe_file().

int do_read_frames = 0
static

Definition at line 72 of file ffprobe.c.

Referenced by probe_file(), and read_interval_packets().

int do_read_packets = 0
static

Definition at line 73 of file ffprobe.c.

Referenced by probe_file(), and read_interval_packets().

int do_show_chapters = 0
static

Definition at line 74 of file ffprobe.c.

Referenced by main(), and probe_file().

int do_show_error = 0
static

Definition at line 75 of file ffprobe.c.

Referenced by main().

int do_show_format = 0
static

Definition at line 76 of file ffprobe.c.

Referenced by main(), and probe_file().

int do_show_frames = 0
static

Definition at line 77 of file ffprobe.c.

Referenced by probe_file(), process_frame(), and xml_init().

int do_show_packets = 0
static

Definition at line 78 of file ffprobe.c.

Referenced by main(), probe_file(), read_interval_packets(), and xml_init().

int do_show_programs = 0
static

Definition at line 79 of file ffprobe.c.

Referenced by main(), and probe_file().

int do_show_streams = 0
static

Definition at line 80 of file ffprobe.c.

Referenced by main(), and probe_file().

int do_show_stream_disposition = 0
static

Definition at line 81 of file ffprobe.c.

Referenced by show_stream().

int do_show_data = 0
static

Definition at line 82 of file ffprobe.c.

Referenced by show_packet(), and show_stream().

int do_show_program_version = 0
static

Definition at line 83 of file ffprobe.c.

Referenced by main().

int do_show_library_versions = 0
static

Definition at line 84 of file ffprobe.c.

Referenced by main().

int do_show_pixel_formats = 0
static

Definition at line 85 of file ffprobe.c.

Referenced by main().

int do_show_pixel_format_flags = 0
static

Definition at line 86 of file ffprobe.c.

Referenced by ffprobe_show_pixel_formats().

int do_show_pixel_format_components = 0
static

Definition at line 87 of file ffprobe.c.

Referenced by ffprobe_show_pixel_formats().

int do_show_chapter_tags = 0
static

Definition at line 89 of file ffprobe.c.

Referenced by show_chapters().

int do_show_format_tags = 0
static

Definition at line 90 of file ffprobe.c.

Referenced by show_format().

int do_show_frame_tags = 0
static

Definition at line 91 of file ffprobe.c.

Referenced by show_frame().

int do_show_program_tags = 0
static

Definition at line 92 of file ffprobe.c.

Referenced by show_program().

int do_show_stream_tags = 0
static

Definition at line 93 of file ffprobe.c.

Referenced by show_stream().

int do_show_packet_tags = 0
static

Definition at line 94 of file ffprobe.c.

Referenced by show_packet().

int show_value_unit = 0
static

Definition at line 96 of file ffprobe.c.

Referenced by opt_pretty(), value_string(), and xml_init().

int use_value_prefix = 0
static

Definition at line 97 of file ffprobe.c.

Referenced by opt_pretty(), value_string(), and xml_init().

int use_byte_value_binary_prefix = 0
static

Definition at line 98 of file ffprobe.c.

Referenced by opt_pretty(), and value_string().

int use_value_sexagesimal_format = 0
static

Definition at line 99 of file ffprobe.c.

Referenced by opt_pretty(), and value_string().

int show_private_data = 1
static

Definition at line 100 of file ffprobe.c.

Referenced by show_stream(), and xml_init().

char* print_format
static

Definition at line 102 of file ffprobe.c.

Referenced by main().

char* stream_specifier
static

Definition at line 103 of file ffprobe.c.

Referenced by probe_file().

char* show_data_hash
static

Definition at line 104 of file ffprobe.c.

Referenced by main().

ReadInterval* read_intervals
static

Definition at line 114 of file ffprobe.c.

int read_intervals_nb = 0
static

Definition at line 115 of file ffprobe.c.

Referenced by parse_read_intervals(), and read_packets().

struct section sections[]
static

Definition at line 181 of file ffprobe.c.

Referenced by writer_open().

const OptionDef* options
static

Definition at line 227 of file ffprobe.c.

const char* input_filename
static

Definition at line 230 of file ffprobe.c.

Referenced by main(), and opt_input_file().

AVInputFormat* iformat = NULL
static
struct AVHashContext* hash
static

Definition at line 233 of file ffprobe.c.

double bin_val

Definition at line 236 of file ffprobe.c.

double dec_val

Definition at line 237 of file ffprobe.c.

const char* bin_str

Definition at line 238 of file ffprobe.c.

const char* dec_str

Definition at line 239 of file ffprobe.c.

const { ... } si_prefixes[]
Initial value:
= {
{ 1.0, 1.0, "", "" },
{ 1.024e3, 1e3, "Ki", "K" },
{ 1.048576e6, 1e6, "Mi", "M" },
{ 1.073741824e9, 1e9, "Gi", "G" },
{ 1.099511627776e12, 1e12, "Ti", "T" },
{ 1.125899906842624e15, 1e15, "Pi", "P" },
}

Referenced by value_string().

const char unit_second_str[] = "s"
static

Definition at line 249 of file ffprobe.c.

Referenced by value_string(), and writer_print_time().

const char unit_hertz_str[] = "Hz"
static

Definition at line 250 of file ffprobe.c.

Referenced by show_stream().

const char unit_byte_str[] = "byte"
static

Definition at line 251 of file ffprobe.c.

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

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

Definition at line 252 of file ffprobe.c.

Referenced by show_format(), and show_stream().

int nb_streams
static
uint64_t* nb_streams_packets
static

Definition at line 255 of file ffprobe.c.

Referenced by probe_file(), read_interval_packets(), and show_stream().

uint64_t* nb_streams_frames
static

Definition at line 256 of file ffprobe.c.

Referenced by probe_file(), process_frame(), read_interval_packets(), and show_stream().

int* selected_streams
static

Definition at line 257 of file ffprobe.c.

Referenced by probe_file(), read_interval_packets(), show_program(), and show_streams().

const AVOption writer_options[]
static
Initial value:
= {
{ "string_validation", "set string validation mode",
OFFSET(string_validation), AV_OPT_TYPE_INT, {.i64=WRITER_STRING_VALIDATION_REPLACE}, 0, WRITER_STRING_VALIDATION_NB-1, .unit = "sv" },
{ "sv", "set string validation mode",
OFFSET(string_validation), AV_OPT_TYPE_INT, {.i64=WRITER_STRING_VALIDATION_REPLACE}, 0, WRITER_STRING_VALIDATION_NB-1, .unit = "sv" },
{ "ignore", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_IGNORE}, .unit = "sv" },
{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_REPLACE}, .unit = "sv" },
{ "fail", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_FAIL}, .unit = "sv" },
{ "string_validation_replacement", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str="\xEF\xBF\xBD"}},
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534

Definition at line 392 of file ffprobe.c.

const AVClass writer_class
static
Initial value:
= {
.class_name = "Writer",
.item_name = writer_get_name,
.option = writer_options,
.child_next = writer_child_next,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:70
static const AVOption writer_options[]
Definition: ffprobe.c:392
static void * writer_child_next(void *obj, void *prev)
Definition: ffprobe.c:405
static const char * writer_get_name(void *p)
Definition: ffprobe.c:384

Definition at line 413 of file ffprobe.c.

Referenced by writer_open().

const Writer* registered_writers[MAX_REGISTERED_WRITERS_NB+1]
static

Definition at line 787 of file ffprobe.c.

const AVOption default_options[]
static
Initial value:
= {
{ "noprint_wrappers", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ "nw", "do not print headers and footers", OFFSET(noprint_wrappers), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ "nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ "nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{NULL},
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534

Definition at line 837 of file ffprobe.c.

const Writer default_writer
static
Initial value:
= {
.name = "default",
.priv_size = sizeof(DefaultContext),
.print_integer = default_print_int,
.print_string = default_print_str,
.priv_class = &default_class,
}
static void default_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:857
static void default_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:904
#define print_section_footer(s)
Definition: ffprobe.c:1735
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:328
static int flags
Definition: cpu.c:47
static void default_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:895
static void default_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:882
#define print_section_header(s)
Definition: ffprobe.c:1734

Definition at line 913 of file ffprobe.c.

const AVOption compact_options[]
static
Initial value:
= {
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str="|"}, CHAR_MIN, CHAR_MAX },
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="c"}, CHAR_MIN, CHAR_MAX },
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534
static void print_section(SectionID id, int level)
Definition: ffprobe.c:3121

Definition at line 991 of file ffprobe.c.

const Writer compact_writer
static
Initial value:
= {
.name = "compact",
.priv_size = sizeof(CompactContext),
.print_integer = compact_print_int,
.print_string = compact_print_str,
.priv_class = &compact_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void compact_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:1057
static av_cold int compact_init(WriterContext *wctx)
Definition: ffprobe.c:1005
static void compact_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1027
#define print_section_footer(s)
Definition: ffprobe.c:1735
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:328
static void compact_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1067
static void compact_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1080
static int flags
Definition: cpu.c:47
#define print_section_header(s)
Definition: ffprobe.c:1734

Definition at line 1090 of file ffprobe.c.

const AVOption csv_options[]
static
Initial value:
= {
{"item_sep", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
{"s", "set item separator", OFFSET(item_sep_str), AV_OPT_TYPE_STRING, {.str=","}, CHAR_MIN, CHAR_MAX },
{"nokey", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"nk", "force no key printing", OFFSET(nokey), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"escape", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
{"e", "set escape mode", OFFSET(escape_mode_str), AV_OPT_TYPE_STRING, {.str="csv"}, CHAR_MIN, CHAR_MAX },
{"print_section", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"p", "print section name", OFFSET(print_section), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534
static void print_section(SectionID id, int level)
Definition: ffprobe.c:3121

Definition at line 1107 of file ffprobe.c.

const Writer csv_writer
static
Initial value:
= {
.name = "csv",
.priv_size = sizeof(CompactContext),
.print_integer = compact_print_int,
.print_string = compact_print_str,
.priv_class = &csv_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void compact_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:1057
static av_cold int compact_init(WriterContext *wctx)
Definition: ffprobe.c:1005
static void compact_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1027
#define print_section_footer(s)
Definition: ffprobe.c:1735
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:328
static void compact_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1067
static void compact_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1080
static int flags
Definition: cpu.c:47
#define print_section_header(s)
Definition: ffprobe.c:1734

Definition at line 1121 of file ffprobe.c.

const AVOption flat_options[]
static
Initial value:
= {
{"sep_char", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
{"s", "set separator", OFFSET(sep_str), AV_OPT_TYPE_STRING, {.str="."}, CHAR_MIN, CHAR_MAX },
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534

Definition at line 1145 of file ffprobe.c.

const Writer flat_writer
static
Initial value:
= {
.name = "flat",
.priv_size = sizeof(FlatContext),
.print_integer = flat_print_int,
.print_string = flat_print_str,
.priv_class = &flat_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void flat_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1233
static void flat_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1228
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:328
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:329
static int flags
Definition: cpu.c:47
static void flat_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1202
static av_cold int flat_init(WriterContext *wctx)
Definition: ffprobe.c:1155
#define print_section_header(s)
Definition: ffprobe.c:1734

Definition at line 1246 of file ffprobe.c.

const AVOption ini_options[]
static
Initial value:
= {
{"hierarchical", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{"h", "specify if the section specification should be hierarchical", OFFSET(hierarchical), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1 },
{NULL},
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534

Definition at line 1267 of file ffprobe.c.

const Writer ini_writer
static
Initial value:
= {
.name = "ini",
.priv_size = sizeof(INIContext),
.print_integer = ini_print_int,
.print_string = ini_print_str,
.priv_class = &ini_class,
}
static void ini_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1302
#define WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS
Definition: ffprobe.c:328
static void ini_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1335
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:329
static int flags
Definition: cpu.c:47
static void ini_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1346
#define print_section_header(s)
Definition: ffprobe.c:1734

Definition at line 1351 of file ffprobe.c.

const AVOption json_options[]
static
Initial value:
= {
{ "compact", "enable compact output", OFFSET(compact), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ "c", "enable compact output", OFFSET(compact), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534

Definition at line 1373 of file ffprobe.c.

const Writer json_writer
static
Initial value:
= {
.name = "json",
.priv_size = sizeof(JSONContext),
.print_integer = json_print_int,
.print_string = json_print_str,
.priv_class = &json_class,
}
static void json_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1496
static void json_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:1451
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void json_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1413
static av_cold int json_init(WriterContext *wctx)
Definition: ffprobe.c:1381
#define print_section_footer(s)
Definition: ffprobe.c:1735
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:329
static int flags
Definition: cpu.c:47
static void json_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1485
#define print_section_header(s)
Definition: ffprobe.c:1734

Definition at line 1511 of file ffprobe.c.

const AVOption xml_options[]
static
Initial value:
= {
{"fully_qualified", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{"q", "specify if the output should be fully qualified", OFFSET(fully_qualified), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{"xsd_strict", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{"x", "ensure that the output is XSD compliant", OFFSET(xsd_strict), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1 },
{NULL},
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: ffprobe.c:1534

Definition at line 1536 of file ffprobe.c.

Writer xml_writer
static
Initial value:
= {
.name = "xml",
.priv_size = sizeof(XMLContext),
.print_integer = xml_print_int,
.print_string = xml_print_str,
.priv_class = &xml_class,
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static void xml_print_section_footer(WriterContext *wctx)
Definition: ffprobe.c:1634
static void xml_print_str(WriterContext *wctx, const char *key, const char *value)
Definition: ffprobe.c:1653
#define print_section_footer(s)
Definition: ffprobe.c:1735
static av_cold int xml_init(WriterContext *wctx)
Definition: ffprobe.c:1546
static void xml_print_int(WriterContext *wctx, const char *key, long long int value)
Definition: ffprobe.c:1676
#define WRITER_FLAG_PUT_PACKETS_AND_FRAMES_IN_SAME_CHAPTER
Definition: ffprobe.c:329
static int flags
Definition: cpu.c:47
static void xml_print_section_header(WriterContext *wctx)
Definition: ffprobe.c:1594
#define print_section_header(s)
Definition: ffprobe.c:1734

Definition at line 1683 of file ffprobe.c.

const OptionDef real_options[]
static

Definition at line 3175 of file ffprobe.c.

Referenced by main().