Clément Bœsch
fbe6e29646
ffprobe: print codec timecode if available.
13 years ago
Stefano Sabatini
65f24858ed
ffprobe: always print int values with print_val()
...
In particular, make the json writer write size values, fix regression
introduced with the addition of the print_val() macro.
13 years ago
Stefano Sabatini
a7e5679054
ffprobe: make writer_print_integer support long long int values
...
This makes possible to use writer_print_integer for printing int64_t
values.
13 years ago
Clément Bœsch
69a501e6a1
ffprobe: small align cosmetic in json writer struct init.
13 years ago
Clément Bœsch
9813af259a
ffprobe: make Writers constant.
13 years ago
Stefano Sabatini
f0db05008d
ffprobe: apply misc cosmetics to compact writer definition
13 years ago
Stefano Sabatini
1f0d937f77
ffprobe: add csv writer
13 years ago
Stefano Sabatini
1c43713e57
ffprobe: add compact writer
13 years ago
Stefano Sabatini
0491a2a07a
ffprobe: force display of missing fields, depending on writer.flags
...
Add flags field to Writer, and define the
WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS flag which forces the display of
optional fields, for example non-available or invalid fields.
Also set the flag in the default writer.
This change is required as for some writers it is preferable to show all
fields (for example for avoiding a variable number of fields in CSV
output), while for other formats (e.g. JSON, XML) it is better to leave
invalid/unavailable fields unspecified and thus simplify the parsing
stage on the deserializer side.
13 years ago
Michael Niedermayer
985e768024
ffprobe: use av_noreturn
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Stefano Sabatini
13665c8767
ffprobe: refactor value_string() to accept an unit_value struct
...
The new design allows to specialize the format for continuos time values
and discrete values. In particular, allows to print integer values like
"12" rather than "12.000".
Prettify, simplify parsing for integer values.
13 years ago
Stefano Sabatini
80abfbea9d
ffprobe: introduce print_val() macro, ease readability
13 years ago
Stefano Sabatini
d2d6bade5c
ffprobe: implement and use print_time and print_ts macros
...
Help readability.
13 years ago
Clément Bœsch
434db5719e
ffprobe: use avio_size() instead of deprecated file_size attribute.
13 years ago
Clément Bœsch
1e4027747a
ffprobe: fix const compiler warning.
13 years ago
Michael Niedermayer
16f793571d
ffprobe: Print format specific variables of codecs.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Clément Bœsch
2f468826ee
ffprobe: prefer av_freep() over av_free() for global print_format option.
...
It could be re-used for instance in case ffprobe would support multiple
input files.
13 years ago
Stefano Sabatini
f4eeb000bf
ffprobe: fix weird align
13 years ago
Stefano Sabatini
b874e2d0a0
ffprobe: prefer av_strtok() over av_get_token() for parsing print_format string
...
Simplify, and avoid the need for multiple escaping levels.
13 years ago
Stefano Sabatini
88bdf7471f
ffprobe: move up ESCAPE_CHECK_SIZE and ESCAPE_REALLOC_BUF macros
...
So they can be used by other escaping routines.
13 years ago
Stefano Sabatini
2f3b028c71
ffprobe: redesign json_escape_str(), to make use of a global buffer
...
The new code avoids to call av_malloc/av_free when escaping is needed
(possibly faster), avoids an integer overflow in case of a huge
string, and provides feedback when a string cannot be escaped.
When a string cannot be escaped, a special string is printed instead.
13 years ago
Stefano Sabatini
1d0afec8fc
ffprobe: add AVClass to writers
...
It is useful for logging messages from a writer context.
13 years ago
Stefano Sabatini
4edcdf5c44
ffprobe: show sample_fmt in the stream section
13 years ago
Stefano Sabatini
fbb8468f20
ffprobe: prefer lowercase section names over uppercase ones
...
This is consistent with chapter names. The default writer section names
are converted to uppercase for keeping backward compatibility.
13 years ago
Stefano Sabatini
cb50ada4f8
ffprobe: parse arguments for -print_format writer
...
This allows -print_format to accept string of the form WRITER=OPTIONS,
as required by the pending compact writer patch.
13 years ago
Stefano Sabatini
eff7684b50
ffprobe: extend writers API, and move the writers up in the file
...
The new provided API is more flexible and is decoupled from the
application level code, so it is easier to maintain.
13 years ago
Clément Bœsch
f9d8a3423f
ffprobe: fix trailing '=' in stream id.
13 years ago
Clément Bœsch
00320ac0dd
ffprobe: remove misplaced and pointless comment.
13 years ago
Clément Bœsch
b70fd6fa8b
ffprobe: use av_get_pix_fmt_name() instead of accessing av_pix_fmt_descriptors.
13 years ago
Clément Bœsch
03d0ea0cf0
ffprobe: remove media_type_string() by inlining av_x_if_null().
13 years ago
Clément Bœsch
8af64e1a67
ffprobe: fix crash with -h.
13 years ago
Clément Bœsch
5ad01decef
ffprobe: rename print_{int,str}_f callbacks to print_{integer,string}.
...
Renamed for consistency. Also, since print_int() and print_str() are
already defined as macros, the long name version is preferred.
13 years ago
Clément Bœsch
3fdf519e4b
ffprobe: add JSON output printing format.
13 years ago
Clément Bœsch
afbeb49456
ffprobe: replace fmt callback with str callback.
...
Having a string callback is much more simpler than a variable args
one for writers to deal with, especially when dealing with escaping.
This patch also introduces a local fast_asprintf() function which is
similar to av_asprintf() but avoids reallocating at each print (leading
to a performance issue).
13 years ago
Clément Bœsch
88fddd0bcc
ffprobe: replace specific ## GNU cpp extension with __VA_ARGS__.
13 years ago
Clément Bœsch
5241bc2773
ffprobe: replace simple string printing with the appropriate helper.
13 years ago
Clément Bœsch
d5d7de7671
ffprobe: directly use va args in print fmt callbacks.
14 years ago
Clément Bœsch
0629b1ff35
ffprobe: introduce output format writers.
14 years ago
Clément Bœsch
8af9366e2f
ffprobe: fix deprecated call to av_find_stream_info.
14 years ago
Stefano Sabatini
9a15146768
ffprobe: use av_get_media_type_string() in media_type_string(), simplify
14 years ago
Stefano Sabatini
7c94740b84
ffprobe: in value_string(), do not print trailing space in case of no suffix
14 years ago
Anton Khirnov
9e12f0bf5f
Rename ffprobe to avprobe.
14 years ago
Thierry Foucu
364d64275c
ffprobe: display bitstream level.
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
0b950fe240
lavc: introduce avcodec_open2() as a replacement for avcodec_open().
...
Adds support for decoder-private options and makes setting other options
simpler.
14 years ago
Gavin Kinsey
c558122e4e
Fix segmentation fault in ffprobe
14 years ago
Nicolas George
25119a7f08
ffprobe: flush stdout after each group.
14 years ago
Stefano Sabatini
46edd3a01b
ffprobe: fix opt_pretty() signature
...
This is required after the OPT_FUNC2 removal.
14 years ago
Jeff Downs
a09918335f
Make all option parsing functions match the function pointer type through which they are called.
...
All option parsing functions now match the function pointer signature through
which they are called (int f(const char *, const char *), thereby working
reliably on all platforms.
Prefix all option processing functions with opt_
14 years ago
Michael Niedermayer
06724c5f5d
ffprobe: remove duplicate avformat_alloc_context()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Gavin Kinsey
df1768d0a2
Fix segmentation fault in ffprobe
14 years ago