Commit Graph

217 Commits

Author SHA1 Message Date
Clément Bœsch 2248db946c ffprobe: move packets_and_frames work to writer context. 2012-06-01 20:52:30 +02:00
Clément Bœsch 8619362ff1 ffprobe: fix C escaping. 2012-05-30 01:07:41 +02:00
Clément Bœsch dae8505492 ffprobe: make -of an alias for -print_format.
This is for interoperability purpose with the fork.
2012-05-29 18:50:20 +02:00
Stefano Sabatini ad381ac97f ffprobe: fix chapter printing, fix JSON output
Make writer_print_chapter_header() set the internal values *before* the
private writer callback is called, otherwise the accessed internal values
will be wrong.

Fix regression introduced in fa6cb2fdff.

Found-By: Daemon404
2012-05-29 18:11:36 +02:00
Stefano Sabatini 89d49acb3b ffprobe: add INI writer
Liberally based on the work of Luca Barbato <lu_zero@gentoo.org>, done
for libav/avprobe.
2012-05-29 13:06:33 +02:00
Stefano Sabatini fa6cb2fdff ffprobe: add multiple_sections field to WriterContext
Move the field "multiple_entries" from the JSON writer private context to
WriterContext, and rename it "multiple_sections".

This allows to factorize the code with the pending INI format patch.
2012-05-29 01:02:50 +02:00
Stefano Sabatini c365cdf202 ffprobe: add support to '\b' and '\f' escaping in c_escape_str() 2012-05-29 01:02:47 +02:00
Stefano Sabatini 6994b552a6 ffprobe: make c_escape_str() documentation terser
Avoid to specify implementation details, better to check the code for
that.
2012-05-29 01:02:13 +02:00
Clément Bœsch 19c1bf1525 ffprobe: reduce the number of AVBPrint resets. 2012-05-26 22:53:13 +02:00
Christian Schmidt f7d5272456 ffprobe: display the codec profile in show_stream()
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2012-05-26 12:39:11 +02:00
Stefano Sabatini 6374ee72df ffprobe: remove ad-hoc behavior when nb_fmt_entries_to_show is 1
The special-case behavior may complicate parsing when the
-show_format_entry option is used programmatically in a script.

The option default=nk=1 achieves the same purpose, if the objective is to
skip printing the single field key.
2012-05-21 10:32:25 +02:00
Michael Niedermayer de2cfb744a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pcmenc: set correct bitrate value
  avprobe: don't print format entry name when only one was requested

Conflicts:
	ffprobe.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-17 23:45:00 +02:00
Stefano Sabatini e109e392ba ffprobe: remove unused variable i in probe_file()
Fix warning:
ffprobe.c: In function ‘probe_file’:
ffprobe.c:1576:14: warning: unused variable ‘i’ [-Wunused-variable]
2012-05-16 13:20:21 +02:00
Michael Niedermayer 1cbf7fb434 Merge remote-tracking branch 'qatar/master'
* qatar/master: (26 commits)
  fate: use diff -b in oneline comparison
  Add missing version bumps and APIchanges/Changelog entries.
  lavfi: move buffer management function to a separate file.
  lavfi: move formats-related functions from default.c to formats.c
  lavfi: move video-related functions to a separate file.
  fate: make smjpeg a demux test
  fate: separate sierra-vmd audio and video tests
  fate: separate smacker audio and video tests
  libmp3lame: set supported channel layouts.
  avconv: automatically insert asyncts when -async is used.
  avconv: add support for audio filters.
  lavfi: add asyncts filter.
  lavfi: add aformat filter
  lavfi: add an audio buffer sink.
  lavfi: add an audio buffer source.
  buffersrc: add av_buffersrc_write_frame().
  buffersrc: fix invalid read in uninit if the fifo hasn't been allocated
  lavfi: rename vsrc_buffer.c to buffersrc.c
  avfiltergraph: reindent
  lavfi: add channel layout/sample rate negotiation.
  ...

Conflicts:
	Changelog
	doc/APIchanges
	doc/filters.texi
	ffmpeg.c
	ffprobe.c
	libavcodec/libmp3lame.c
	libavfilter/Makefile
	libavfilter/af_aformat.c
	libavfilter/allfilters.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/avfiltergraph.c
	libavfilter/buffersrc.c
	libavfilter/defaults.c
	libavfilter/formats.c
	libavfilter/src_buffer.c
	libavfilter/version.h
	libavfilter/vf_yadif.c
	libavfilter/vsrc_buffer.c
	libavfilter/vsrc_buffer.h
	libavutil/avutil.h
	tests/fate/audio.mak
	tests/fate/demux.mak
	tests/fate/video.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-16 02:27:31 +02:00
Michael Niedermayer c457a29ece ffprobe: add default_writer priv_size.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-15 03:53:53 +02:00
Clément Bœsch b545b947dd ffprobe: replace fast_asprintf() with bprint utils.
Also remove the unused print_fmt_opt() in the process.
2012-05-14 19:11:39 +02:00
Stefano Sabatini 3946187d60 ffprobe: add "nokey" option to default writer
Help simplifying parsing in certain cases.
2012-05-14 12:59:51 +02:00
Stefano Sabatini f48f03a400 ffprobe: add "noprint_wrappers" option to default writer
The option is useful for simplifying parsing.

Also use the new option in fate, in order to fix the regression
introduced by the previous commit.
2012-05-14 12:59:51 +02:00
Stefano Sabatini 6cd06bd22c ffprobe: simplify/fix logic for the -show_format_entry option
Do not skip chapter header/footer printing, which breaks the parsing for
most writers.
2012-05-14 12:59:51 +02:00
Stefano Sabatini a0fd322195 ffprobe: remove unused print_format_entry() function
The function was introduced in 653d117c, but is not required.
2012-05-14 12:59:51 +02:00
Michael Niedermayer b4178a3f13 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rtmp: Support 'rtmp_live', an option which specifies if the media is a live stream.
  av_samples_fill_array: Mark unmodified function argument as const.
  lagarith: add YUY2 decoding support
  Support decoding unaligned rgb24 lagarith.
  dv: Split profile handling code into a separate file.
  flvenc: use AVFormatContext, not AVCodecContext for logging.
  mov: Remove write-only variable in mov_read_chan().
  fate: Change the probe-format refs to match the final text format committed.
  fate: Add avprobe as a make dependency
  Add probe fate tests to test for regressions in detecting media types.
  fate: Add oneline comparison method
  qdm2: clip array indices returned by qdm2_get_vlc().
  avplay: properly close/reopen AVAudioResampleContext on channel layout change
  avcodec: do not needlessly set packet size to 0 in avcodec_encode_audio2()
  avcodec: for audio encoding, reset output packet when it is not valid
  avcodec: refactor avcodec_encode_audio2() to merge common branches
  avcodec: remove fallbacks for AVCodec.encode() in avcodec_encode_audio2()

Conflicts:
	ffplay.c
	libavcodec/Makefile
	libavcodec/dvdata.c
	libavcodec/dvdata.h
	libavcodec/qdm2.c
	libavcodec/utils.c
	libavformat/flvenc.c
	libavformat/mov.c
	tests/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-08 22:02:59 +02:00
Michael Niedermayer 653d117c29 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libschroedinger: Switch to function names more in line with Libav style.
  Move code shared between libdirac and libschroedinger to libschroedinger.
  lavfi: uninline avfilter_copy_buffer_ref_props().
  lavf: add missing '*' in a doxy.
  h264: Remove a commented-out function pointer typedef.
  txd: Remove write-only variable in txd_decode_frame().
  mmvideo.c: Remove unused variable in mm_decode_pal().
  build: cosmetics: Add missing end-of-line backslashes to item lists.
  build: cosmetics: Split HEADERS/OBJS/PROGS lists into one entry per line.
  libschroedinger: Move a function to avoid a forward declaration.
  pthread: warn on high thread counts
  vf_yadif: fix missing error handling for avfilter_poll_frame()
  avprobe: allow showing only one container/stream property.
  lavfi: support audio in avfilter_copy_frame_props().
  lavfi: avfilter_merge_formats: handle case where inputs are same
  lavc: add sample rate and channel layout to AVFrame.
  zerocodec: check if the previous frame is missing
  doc: clarify check for NULL pointer style

Conflicts:
	doc/APIchanges
	doc/developer.texi
	ffprobe.c
	libavcodec/Makefile
	libavcodec/avcodec.h
	libavcodec/libdirac_libschro.c
	libavcodec/libdirac_libschro.h
	libavcodec/mmvideo.c
	libavcodec/txd.c
	libavcodec/version.h
	libavcodec/zerocodec.c
	libavfilter/Makefile
	libavfilter/avfilter.c
	libavfilter/version.h
	libavformat/Makefile
	libavutil/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-07 22:51:34 +02:00
Nicolas George b27383e453 ffprobe: do not try to decode empty packets.
Fixes sporadic decode failures and trac ticket #997.
2012-04-21 14:02:08 +02:00
Stefano Sabatini f0bb1a599c ffprobe: use avbprint API
Simplify, increase robustness.
2012-04-08 00:02:21 +02:00
Michael Niedermayer 184fc600e1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo_enc: only allocate output packet when we know there will be output
  Add names for more channel layouts to the channel layout map.
  sunrast: Add a sample request for RMP_RAW colormap.
  avcodec: do not override pts or duration from the audio encoder
  Add prores regression test.
  Enable already existing rso regression test.
  Add regression test for "sox" format muxer/demuxer.
  Add dpx encoding regression test.
  swscale: K&R formatting cosmetics for PowerPC code (part I/II)
  img2: Use ff_guess_image2_codec(filename) shorthand where appropriate.
  Clarify licensing information about files borrowed from libjpeg.
  Mark mutable static data const where appropriate.
  avplay: fix -threads option
  dvbsubdec: avoid undefined signed left shift in RGBA macro
  mlpdec: use av_log_ask_for_sample()
  gif: K&R formatting cosmetics
  png: make .long_name more descriptive
  movdec: Adjust keyframe flagging in fragmented files
  rv34: change most "int stride" into "ptrdiff_t stride".

Conflicts:
	avprobe.c
	ffplay.c
	libavcodec/mlpdec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pngenc.c
	libavcodec/x86/v210-init.c
	libavfilter/vf_boxblur.c
	libavfilter/vf_crop.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_select.c
	libavfilter/vf_setpts.c
	libavfilter/vf_settb.c
	libavformat/img2.c
	libavutil/audioconvert.c
	tests/codec-regression.sh
	tests/lavf-regression.sh
	tests/ref/lavf/dpx
	tests/ref/vsynth1/prores
	tests/ref/vsynth2/prores

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-22 02:24:18 +01:00
Matthieu Bouron 278d6ab900 ffprobe: report bit rate in stream description
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2012-02-20 17:46:26 +01:00
Clément Bœsch 8688e6acba ffprobe: fix crash if the file can't be opened. 2012-02-18 21:35:09 +01:00
Matthieu Bouron 29b9aee49f ffprobe: add count_frames and count_packets options
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
2012-02-17 01:06:43 +01:00
Stefano Sabatini 1ca0812d90 ffprobe: fix typo in ESCAPE_CHECK_SIZE 2012-02-06 11:30:45 +01:00
Clément Bœsch dc386a5e3c ffprobe: use av_mpegtc_to_timecode_string(). 2012-02-02 14:31:17 +01:00
Stefano Sabatini 23934e5f41 ffprobe: increase precision for the shown float values 2012-01-20 13:27:57 +01:00
Stefano Sabatini 4601ad769d ffprobe: fix value_string() prefix printing for values with negative logarithm
The index for the binary_unit_prefixes array is expected to be positive,
so avoid to use negative indexes for accessing it.
2012-01-20 13:27:52 +01:00
Stefano Sabatini eef4b70450 ffprobe: reindent after previous commit 2012-01-20 13:27:46 +01:00
Stefano Sabatini 58b10b4c7e ffprobe: factorize common code in value_string() 2012-01-20 13:27:41 +01:00
Michael Niedermayer c130428ab5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avprobe, cmdutils: K&R formatting cosmetics
  tests: K&R formatting cosmetics for test programs
  lavf: free packets for muxers implementing interleave_packet().
  lavf: fix and extend av_interleaved_write_frame() doxy.
  mov: Remove dead stores for spherical coordinates for channel position.
  error_resilience: K&R formatting cosmetics
  RELEASE_NOTES: mention hiding private symbols in shared builds.
  RELEASE_NOTES: mention some notable API changes in 0.8

Conflicts:
	cmdutils.h
	doc/RELEASE_NOTES
	ffprobe.c
	libavcodec/error_resilience.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-19 01:19:38 +01:00
Stefano Sabatini 140a9afcf2 ffprobe: add more safe casts in value_string()
Second attempt at fixing ticket #921.
2012-01-18 00:44:28 +01:00
Stefano Sabatini 2c8d37c2fb ffprobe: use safer type for index variable in value_string()
There is no guarantee that the casted double which is assigned to the
variable will be contained in an int (also if it is almost sure for most
non-alien architectures).
2012-01-18 00:43:55 +01:00
Stefano Sabatini 54661219c1 ffprobe: fix printing of unit values which cannot be contained in an int
Use long long int to contain such values instead of an int, which is
required to contain at least 64 bits, so it is guaranteed to contain also
int64_t values, which are used by some fields.

In particular, should fix trac ticket #921.
2012-01-18 00:01:07 +01:00
Michael Niedermayer b18e17eabf Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits)
  utils: Check for extradata size overflows.
  ARM: rv34: fix asm syntax in dc transform functions
  avio: Fix the value of the deprecated URL_FLAG_NONBLOCK
  rv34: fix and optimise frame dependency checking
  rv34: NEON optimised dc only inverse transform
  avprobe: use avio_size() instead of deprecated AVFormatContext.file_size.
  ffmenc: remove references to deprecated AVFormatContext.timestamp.
  lavf: undeprecate read_seek().
  avserver: remove code using deprecated CODEC_CAP_PARSE_ONLY.
  lavc: replace some remaining FF_I_TYPE with AV_PICTURE_TYPE_I
  lavc: ifdef out parse_only AVOption
  nellymoserdec: SAMPLE_FMT -> AV_SAMPLE_FMT
  mpegvideo_enc: ifdef out/replace references to deprecated codec flags.
  riff: remove references to sonic codec ids
  indeo4: add some missing static and const qualifiers
  rv34: DC-only inverse transform
  avconv: use AVFrame.width/height/format instead of corresponding AVCodecContext fields
  lavfi: move version macros to a new installed header version.h
  vsrc_buffer: release the buffer on uninit.
  rgb2rgb: rgb12tobgr12()
  ...

Conflicts:
	avconv.c
	doc/APIchanges
	ffprobe.c
	libavfilter/Makefile
	libavfilter/avfilter.h
	libswscale/rgb2rgb.c
	libswscale/rgb2rgb.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-13 01:29:48 +01:00
Stefano Sabatini bb4c18881a ffprobe: reindent after previous commit 2012-01-12 17:35:17 +01:00
Stefano Sabatini b25c239c7a ffprobe: add support to audio frame information printing 2012-01-12 17:34:16 +01:00
Stefano Sabatini 58e1de724d ffprobe: set AV_LOG_SKIP_REPEATED log flag
Consistent with ffmpeg and ffplay.
2012-01-12 17:34:07 +01:00
Stefano Sabatini 4fd1e2e432 ffprobe: fix leak in show_packets()
Call av_free_packets() at each demuxing loop iteration, not only when
decoding.

X-ColaCount: +10l
2012-01-12 10:39:24 +01:00
Stefano Sabatini 7328c2fc21 ffprobe: replace av_destruct_packet() with av_free_packet()
av_destruct_packet() always frees the packet data even when the demuxer
is going to re-use it, thus causing crashes when decoding audio
frames (as implemented in a pending patch).

av_free_packet() is used instead, as it allows each demuxer to set the
right packet data releasing mechanism through the pkt->destruct callback.
2012-01-12 10:39:24 +01:00
Stefano Sabatini 0cc8864687 ffprobe: use av_toupper() in upcase_string() 2012-01-10 22:49:15 +01:00
Stefano Sabatini 93d49cba7f ffprobe: add compact option to JSON writer 2012-01-10 18:24:18 +01:00
Stefano Sabatini 5226be0dd5 ffprobe: add -show_program_version and -show_library_versions options 2012-01-10 18:24:07 +01:00
Stefano Sabatini d3e435164b ffprobe: make upcase_string() ignore non-ASCII characters
This is required as some section names may contain non-ASCII characters
(e.g. '_').
2012-01-10 18:19:31 +01:00
Stefano Sabatini 3b1355bb93 ffprobe: change formatting logic in the JSON writer
Print a "\n" at the end of each section, also print the section name in
the section print function, print the chapter name only in case the
chapter contains multiple entries.

Increase textual output readability - different sections can be
distinguished more easily.
2012-01-09 13:41:35 +01:00
Stefano Sabatini 48f37b1d21 ffprobe: implement generic reindent logic in the JSON writer
Clarify/generalize indent logic.
2012-01-09 13:36:10 +01:00
Stefano Sabatini 5ccdb907c1 ffprobe: use more meaningful names for writer chapter/section header/footer function
The passed argument is supposed to be the chapter/section name, rather
than the header/footer. Less confusing.
2012-01-08 11:20:31 +01:00
Stefano Sabatini ec624d7c5c ffprobe: use "%*" printf syntax in XML_INDENT() in place of a loop
Possibly faster/cleaner.

Suggested-By: Clément Bœsch <ubitux@gmail.com>
2012-01-08 11:19:27 +01:00
Stefano Sabatini 9997d41672 ffprobe: add support to video frame information printing
Add -show_frames option to ffprobe.

Partially based on the work of Thomas Kuehnel <kuehnelth@googlemail.com>
for SOCIS 2011.

The wicked idea of creating a special "packets_and_frames" container for
structured formats (JSON and XML) comes from Clément.
2012-01-07 22:26:46 +01:00
Stefano Sabatini 9ecccd6e5a ffprobe: move header and trailer print from probe_file() to main()
Simplify printing from the main() context, in case probe_file() is not
called, as required by the pending -show_version option.
2012-01-07 11:08:00 +01:00
Stefano Sabatini fa7d1c39fd ffprobe: move writer context registration and initialization in main()
Simplify pending changes, as the writer context will be used in the
main() routine.
2012-01-07 11:02:13 +01:00
Stefano Sabatini ceef1ee767 cmdutils: make show_usage() use av_log()
Avoid printing on stdout when show_usage is used in an error message.
2012-01-07 11:02:13 +01:00
Stefano Sabatini c5f4abf698 ffprobe: exit in case generic options are incompatible with strict XML output 2012-01-06 10:43:34 +01:00
Stefano Sabatini 49c207b820 ffprobe: fix NULL pointer dereference in writer_close()
Fix crash.
2012-01-06 10:43:34 +01:00
Stefano Sabatini d6da16dca5 ffprobe: add support to option -show_error 2012-01-04 01:06:28 +01:00
Stefano Sabatini 55ed19bf3b ffprobe: remove unused variable in show_format() 2012-01-04 01:06:11 +01:00
Stefano Sabatini 4c5c0609c1 ffprobe: reindent after the last commit 2012-01-04 01:06:03 +01:00
Stefano Sabatini 90347dabc8 ffprobe: change order of operations in probe_file()
This is required by a pending patch, also fixes a memleak due to the
writer context not being closed in case of open_input_file() failure.
2012-01-04 01:05:56 +01:00
Stefano Sabatini c972f91d5b ffprobe: prefer av_log to fprintf(stderr) 2012-01-04 01:05:51 +01:00
Stefano Sabatini 20ac5849f8 ffprobe: add XML writer 2011-12-27 12:58:24 +01:00
Stefano Sabatini f1a4182e8e ffprobe: add show_private_data option 2011-12-27 12:58:08 +01:00
Stefano Sabatini 93613338fe ff* tools: move descriptions from copyright header to @file doxy 2011-12-27 12:58:08 +01:00
Michael Niedermayer 452406bd5b ff*: Fix duplicatedly printed version info with -version
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-20 22:23:12 +01:00
Michael Niedermayer 8bc7fe4daf Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doxygen: misc consistency, spelling and wording fixes
  vcr1: drop unnecessary emms_c() calls without MMX code
  Replace all uses of av_close_input_file() with avformat_close_input().
  lavf: add avformat_close_input().
  lavf: deprecate av_close_input_stream().
  lavf doxy: add some basic demuxing documentation.
  lavf doxy: add some general lavf information.
  lavf doxy: add misc utility functions to a group.
  lavf doxy: add av_guess_codec/format to the encoding group.
  lavf doxy: add core functions to a doxy group.
  Add basic libavdevice documentation.
  lavc: convert error_recognition to err_recognition.
  avconv: update -map option help text
  x86: Require 7 registers for the cabac asm
  x86: bswap: remove test for bswap instruction
  bswap: make generic implementation more compiler-friendly
  h264: remove useless cast
  proresdec: fix decode_slice() prototype

Conflicts:
	configure
	doc/APIchanges
	ffprobe.c
	libavcodec/avcodec.h
	libavcodec/celp_math.h
	libavcodec/h264.c
	libavfilter/src_movie.c
	libavformat/anm.c
	libavformat/avformat.h
	libavformat/version.h
	libavutil/avstring.h
	libavutil/bswap.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-13 00:39:48 +01:00
Clément Bœsch fbe6e29646 ffprobe: print codec timecode if available. 2011-11-28 14:06:02 +01:00
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.
2011-11-25 13:25:56 +01:00
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.
2011-11-18 10:09:26 +01:00
Clément Bœsch 69a501e6a1 ffprobe: small align cosmetic in json writer struct init. 2011-11-16 19:37:11 +01:00
Clément Bœsch 9813af259a ffprobe: make Writers constant. 2011-11-16 19:35:23 +01:00
Stefano Sabatini f0db05008d ffprobe: apply misc cosmetics to compact writer definition 2011-11-16 18:40:09 +01:00
Stefano Sabatini 1f0d937f77 ffprobe: add csv writer 2011-11-16 18:40:03 +01:00
Stefano Sabatini 1c43713e57 ffprobe: add compact writer 2011-11-16 00:32:08 +01:00
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.
2011-11-16 00:30:35 +01:00
Michael Niedermayer 985e768024 ffprobe: use av_noreturn
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-11 04:26:07 +01:00
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.
2011-11-07 14:53:36 +01:00
Stefano Sabatini 80abfbea9d ffprobe: introduce print_val() macro, ease readability 2011-11-07 14:53:29 +01:00
Stefano Sabatini d2d6bade5c ffprobe: implement and use print_time and print_ts macros
Help readability.
2011-11-07 14:53:22 +01:00
Michael Niedermayer 13b7781ec8 Merge remote-tracking branch 'qatar/master'
* qatar/master: (23 commits)
  x86inc: use sse versions of common macros instead of sse2 when applicable
  doc/APIchanges: add missing dates and hashes
  lavf: don't return from void av_update_cur_dts()
  Changelog: add more entries.
  Changelog: update ffmpeg/avconv incompatibility list.
  avconv: remove some redundant temporary variables.
  avconv: fix broken indentation
  avconv: move copy_initial_nonkeyframes to the options context.
  avconv: use file:stream instead of file.stream in log messages.
  doc/avconv: elaborate on basic functionality.
  doc/avconv: -sample_fmts, not -help sample_fmts prints the sample formats
  openssl: Only use CRYPTO_set_id_callback on OpenSSL < 1.0.0
  Call avformat_network_init/deinit in the programs
  Remove leftover includes of strings.h
  avutil: Don't allow using strcasecmp/strncasecmp
  Replace all usage of strcasecmp/strncasecmp
  avstring: Add locale independent implementations of strcasecmp/strncasecmp
  avstring: Add locale independent implementations of toupper/tolower
  cosmetics: insert some spaces in explicit enum value assignments
  move 8SVX audio codecs to the audio codec list part on the next bump
  ...

Conflicts:
	avprobe.c
	doc/APIchanges
	ffplay.c
	ffserver.c
	libavcodec/avcodec.h
	libavdevice/bktr.c
	libavdevice/v4l.c
	libavdevice/v4l2.c
	libavformat/matroskaenc.c
	libavformat/wtv.c
	libavutil/avstring.c
	libavutil/avstring.h
	libavutil/avutil.h
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-07 03:01:43 +01:00
Clément Bœsch 434db5719e ffprobe: use avio_size() instead of deprecated file_size attribute. 2011-11-05 15:07:19 +01:00
Clément Bœsch 1e4027747a ffprobe: fix const compiler warning. 2011-11-05 15:07:19 +01:00
Michael Niedermayer 16f793571d ffprobe: Print format specific variables of codecs.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-04 17:25:28 +01:00
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.
2011-10-18 19:11:05 +02:00
Stefano Sabatini f4eeb000bf ffprobe: fix weird align 2011-10-18 18:58:32 +02:00
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.
2011-10-18 18:21:03 +02:00
Stefano Sabatini 88bdf7471f ffprobe: move up ESCAPE_CHECK_SIZE and ESCAPE_REALLOC_BUF macros
So they can be used by other escaping routines.
2011-10-18 18:21:03 +02:00
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.
2011-10-18 18:21:03 +02:00
Stefano Sabatini 1d0afec8fc ffprobe: add AVClass to writers
It is useful for logging messages from a writer context.
2011-10-15 00:54:22 +02:00
Michael Niedermayer f884ef00de Merge remote-tracking branch 'qatar/master'
* qatar/master: (31 commits)
  tiffenc: initialize forgotten avctx.
  avplay: free the active audio packet at exit.
  avplay: free rdft data used for spectrogram analysis.
  log.h: make AVClass a named struct
  fix ac3 encoder documentation
  vc1: more prettyprinting cosmetics
  vc1: prettyprint some tables
  vc1: K&R formatting cosmetics
  AVOptions: bump minor and add APIchanges entry.
  cmdutils/avtools: simplify show_help() by using av_opt_child_class_next()
  AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*
  Remove all uses of deprecated AVOptions API.
  AVOptions: add av_opt_next, deprecate av_next_option.
  AVOptions: add functions for evaluating option strings.
  AVOptions: split get_number().
  AVOptions: add av_opt_get*, deprecate av_get*.
  AVOptions: add av_opt_set*().
  AVOptions: add new API for enumerating children.
  rv34: move inverse transform functions to DSP context
  flvenc: Write the right metadata entry count
  ...

Conflicts:
	avconv.c
	cmdutils.c
	doc/APIchanges
	ffplay.c
	ffprobe.c
	libavcodec/ac3dec.c
	libavcodec/h264.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/mpeg12enc.c
	libavcodec/options.c
	libavdevice/libdc1394.c
	libavdevice/v4l2.c
	libavfilter/vf_drawtext.c
	libavformat/flvdec.c
	libavformat/mpegtsenc.c
	libavformat/options.c
	libavutil/avutil.h
	libavutil/opt.c
	libswscale/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-13 06:00:03 +02:00
Stefano Sabatini 4edcdf5c44 ffprobe: show sample_fmt in the stream section 2011-10-12 14:55:28 +02:00
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.
2011-10-11 00:24:27 +02:00
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.
2011-10-09 16:03:13 +02:00
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.
2011-10-09 16:02:52 +02:00
Clément Bœsch f9d8a3423f ffprobe: fix trailing '=' in stream id. 2011-09-28 17:57:22 +02:00
Michael Niedermayer 7c1aba4f01 Merge remote-tracking branch 'qatar/master'
* qatar/master: (21 commits)
  fate: allow testing with libavfilter disabled
  x86: XOP/FMA4 CPU detection support
  ws_snd: misc cosmetic clean-ups
  ws_snd: remove the 2-bit ADPCM table and just subtract 2 instead.
  ws_snd: use memcpy() and memset() instead of loops
  ws_snd: use samples pointer for loop termination instead of a separate iterator variable.
  ws_snd: make sure number of channels is 1
  ws_snd: add some checks to prevent buffer overread or overwrite.
  ws_snd: decode to AV_SAMPLE_FMT_U8 instead of S16.
  flacdec: fix buffer size checking in get_metadata_size()
  rtp: Simplify ff_rtp_get_payload_type
  rtpenc: Add a payload type private option
  rtp: Correct ff_rtp_get_payload_type documentation
  avconv: replace all fprintf() by av_log().
  avconv: change av_log verbosity from ERROR to FATAL for fatal errors.
  cmdutils: replace fprintf() by av_log()
  avtools: parse loglevel before all the other options.
  oggdec: add support for Xiph's CELT codec
  sol: return error if av_get_packet() fails.
  cosmetics: reindent and pretty-print
  ...

Conflicts:
	avconv.c
	cmdutils.c
	libavcodec/avcodec.h
	libavcodec/version.h
	libavformat/oggparsecelt.c
	libavformat/utils.c
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-27 02:14:37 +02:00
Clément Bœsch 00320ac0dd ffprobe: remove misplaced and pointless comment. 2011-09-22 00:22:53 +02:00
Clément Bœsch b70fd6fa8b ffprobe: use av_get_pix_fmt_name() instead of accessing av_pix_fmt_descriptors. 2011-09-22 00:22:53 +02:00