Commit Graph

101 Commits

Author SHA1 Message Date
Lukasz Marek 19b3a25048 lavu/log: add device categories
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-03-03 23:34:31 +01:00
Michael Niedermayer 74744790a3 Merge commit '25a1ba814ad80056247fd357ec4c6911324a3f66'
* commit '25a1ba814ad80056247fd357ec4c6911324a3f66':
  log: Have function parameter names match between .c and .h file

Conflicts:
	libavutil/log.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-12 14:41:24 +01:00
Diego Biurrun 25a1ba814a log: Have function parameter names match between .c and .h file
This fixes two related Doxygen warnings.
2014-02-12 12:08:02 +01:00
Michael Niedermayer a044a183a3 avutil/log: skip IO calls on empty strings
These occur when no context is set for example, thus they are common

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 23:30:34 +01:00
Michael Niedermayer d6838309fe avutil/log: skip setting color for default (AV_LOG_INFO) level
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 23:28:57 +01:00
Michael Niedermayer 2c21e2ee4c avutil/log: merge calls that set ansi color and print the string
about 1/3 or so faster

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 23:27:45 +01:00
Michael Niedermayer 808c10e728 avutil/log: check that len is within the buffer before reading it
Fixes out of array read
Fixes: asan_heap-oob_19d6979_6857_mmw_deadzy.ogg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-27 17:06:42 +01:00
Michael Niedermayer 423ae31354 avutil/log: make default av_log callback thread safe
This uses a pthread mutex

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-23 18:15:49 +02:00
Michael Niedermayer 3ed65d98c6 avutil/log: fix race between setting and using the log callback
Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-17 00:49:55 +02:00
Michael Niedermayer 148310ca16 avutil/log: Use bprint for part
This should fix the issue with strings longer than 1024

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-10 18:17:30 +02:00
Nicolas George 39bb26f91b lavu/log: do not skip overwritten lines.
If the line ends with \r, it will not flood the tty, and
the "Last message repeated" line would overwrite it.
Fix bug introduced by c25d1ba.
2013-08-07 16:01:45 +02:00
Nicolas George c25d1ba556 lavu/log: print prefix after \r.
Should fix trac ticket #2797 because of the progress line.
2013-07-20 11:06:19 +02:00
Michael Niedermayer 8fdec02fd1 Merge commit '0420c810ceb430003f9f2793c5cfa1fe84657f3d'
* commit '0420c810ceb430003f9f2793c5cfa1fe84657f3d':
  log: pass the correct parameters to missing_feature_sample

Conflicts:
	libavutil/log.c

See: 572e38a513

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-05 12:43:57 +02:00
Luca Barbato 0420c810ce log: pass the correct parameters to missing_feature_sample
CC:libav-stable@libav.org
2013-07-04 21:25:11 +02:00
Michael Niedermayer 7edb984dd0 avutil/log: Fix context pointer used for get_category()
Fixes calling a random pointer

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-30 20:06:24 +02:00
Michael Niedermayer a057552212 avutil/log: dont count&print repeats for empty strings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 23:41:29 +02:00
Michael Niedermayer 74b1c32a80 avutil/log: leave prefix printing state on empty input.
Fixes printing the prefix after an empty string was printed

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 20:31:25 +02:00
James Almer 572e38a513 log: Remove redundant va_list creation from missing_feature_sample()
avpriv_request_sample() and avpriv_report_missing_feature() were printing bogus values for the extra arguments.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-13 21:14:34 +02:00
Michael Niedermayer 905e7eb413 Merge commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8'
* commit 'f099d3d1d5466bd63f4ab36270d169ff9ea613b8':
  Add av_log_{ask_for_sample|missing_feature} replacements to libavutil
  ismindex: Check the return value of allocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-14 12:15:02 +01:00
Diego Biurrun f099d3d1d5 Add av_log_{ask_for_sample|missing_feature} replacements to libavutil
This allows reporting missing features and requesting samples from
all libraries in a standard way; with a simplified API.
2013-03-13 20:42:06 +01:00
Michael Niedermayer 99efd59626 Merge commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967'
* commit 'cb45553f577f8e0ebfe05d3287e1b6fa5859b967':
  Remove pointless #undefs of previously forbidden functions.
  fate: Add dependencies for bmp, cdxl, dfa, mp3

Conflicts:
	doc/examples/muxing.c
	libavfilter/filtfmts.c
	libavutil/des.c
	libavutil/eval.c
	libavutil/log.c
	libavutil/parseutils.c
	tests/fate/mp3.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-05 13:34:45 +01:00
Anton Khirnov cb45553f57 Remove pointless #undefs of previously forbidden functions. 2012-12-04 21:40:22 +01:00
Michael Niedermayer 5473f6258c Merge remote-tracking branch 'qatar/master'
* qatar/master:
  configure: Use headers in the check for _beginthreadex for w32threads
  avutil: Use a configure check to enable windows console functions
  avutil: Include io.h with a separate condition from windows console functions

Conflicts:
	libavutil/log.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-01 13:10:48 +01:00
Martin Storsjö 7e6a11bcf7 avutil: Use a configure check to enable windows console functions
Not all versions or API subsets of windows have these functions.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-30 16:56:57 +02:00
Martin Storsjö b70abd5b61 avutil: Include io.h with a separate condition from windows console functions
Not all versions of windows have the console color functions,
while io.h might be needed for isatty (which can be found in
unistd.h or io.h).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-11-30 16:56:54 +02:00
Michael Niedermayer c581cb4e4f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Fix even more missing includes after the common.h removal
  build: Factor out rangecoder dependencies to CONFIG_RANGECODER
  build: Factor out error resilience dependencies to CONFIG_ERROR_RESILIENCE
  x86: avcodec: Consistently name all init files
  Add more missing includes after removing the implicit common.h
  Add some more missing includes after removing the implicit common.h
  Don't include common.h from avutil.h
  rtmp: Automatically compute the hash for SWFVerification

Conflicts:
	configure
	doc/APIchanges
	doc/examples/decoding_encoding.c
	libavcodec/Makefile
	libavcodec/assdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/avpacket.c
	libavcodec/dv_profile.c
	libavcodec/dwt.c
	libavcodec/libtheoraenc.c
	libavcodec/rawdec.c
	libavcodec/rv40dsp.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/v210dec.h
	libavcodec/vc1dsp.c
	libavcodec/x86/Makefile
	libavfilter/asrc_anullsrc.c
	libavfilter/avfilter.c
	libavfilter/buffer.c
	libavfilter/formats.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_select.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/version.h
	libavutil/audioconvert.c
	libavutil/error.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-16 16:20:30 +02:00
Martin Storsjö 1d9c2dc89a Don't include common.h from avutil.h
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-15 22:32:06 +03:00
Michael Niedermayer 50bfd547b9 log: fix compilation failure on mingw due to reference to undefined set_color256
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-07 12:57:13 +02:00
Paul B Mahol 1842b27564 lavu: 256 color support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-07-07 01:41:55 +00:00
Michael Niedermayer ee7214c59a log: change color for filters from blue to bright green
The blue is difficult to read on several peoples terminals with black background.

Idea-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-28 00:36:32 +02:00
Michael Niedermayer 3b0ad040b3 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  log: Include io.h on windows
  lavr: x86: merge some branches
  x86: cpu: whitespace (mostly) cosmetics
  x86: fft: win64: fix stack alignment for memcpy() call

Conflicts:
	libavutil/log.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-26 01:13:07 +02:00
Ronald S. Bultje 246154a9af log: Include io.h on windows
This is required for isatty, which exists on MSVC and is found by
configure, but is provided by io.h instead of unistd.h.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-25 23:28:36 +03:00
Michael Niedermayer 244682dd08 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  log: Only include unistd.h if configure found it
  ape: create audio stream before reading tags.
  mov: make a length variable larger.
  image2: Add "start_number" private option to the demuxer
  image2: Add "start_number" private option to the muxer
  avconv: remove a forgotten debugging printf.
  avconv: use more descriptive names for hardcoded filters.
  avconv: remove redundant handling of async.
  doc/filters: fix typo.
  h264: use asm cabac reader under a generic condition

Conflicts:
	ffmpeg.c
	libavformat/img2dec.c
	libavformat/img2enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-24 21:34:54 +02:00
Martin Storsjö 145a8096d5 log: Only include unistd.h if configure found it
MSVC has isatty (in io.h), but not unistd.h. (isatty isn't called
at all for windows, since there's a special case block for that.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-06-24 12:36:22 +03:00
Michael Niedermayer e847f41285 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libspeexenc: add supported sample rates and channel layouts.
  Replace usleep() calls with av_usleep()
  lavu: add av_usleep() function
  utvideo: mark interlaced frames as such
  utvideo: Fix interlaced prediction for RGB utvideo.
  cosmetics: do not use full path for local headers
  lavu/file: include unistd.h only when available
  configure: check for unistd.h
  log: include unistd.h only when needed
  lavf: include libavutil/time.h instead of redeclaring av_gettime()

Conflicts:
	configure
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	libavcodec/utvideo.c
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-22 22:34:02 +02:00
Wolfram Gloger 258dfff839 extend log line buffer sizes
The string passed to av_vlog() from libx264's X264_log overflows the 512
byte part_size, truncating x264 parameter output.  Double this size
and put it in a #define so it only needs to be changed in one place.

Signed-off-by: Wolfram Gloger <video06@malloc.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-22 19:16:51 +02:00
Mans Rullgard 539df61193 log: include unistd.h only when needed
The only symbol this file uses from unistd.h is isatty().  By
including the header only when this function is used, the file
can be built on systems without unistd.h (which presumably also
lack isatty).

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-21 22:53:35 +01:00
Michael Niedermayer bc210bfca6 log: flip highlight bit for codec & muxer layer
This way the encoder/muxer side is bold

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-20 17:22:18 +02:00
Michael Niedermayer e69263cd01 avutil: add get_category() for the case where one AVClass can have more than 1 category
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-19 17:22:02 +02:00
Michael Niedermayer b76f77ee0d log: swap colors for muxer and codec layer
This way the filters which are semantically closer to the codec layer
have a (subjectively to me) more similar color.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-19 17:13:45 +02:00
Michael Niedermayer eb7efc126a log: color prefixes according to their source.
The use of cyan is droped from the levels to avoid confusion
magenta/cyan/blue is used for muxer/codec/filter layer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-03 22:12:14 +02:00
Michael Niedermayer 2191aef93b log: cleanup color arrays
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-06-03 21:56:35 +02:00
Michael Niedermayer 394b692b70 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  avprobe: restore pseudo-INI old style format for compatibility.
  avprobe: fix formatting.
  log: make colored output more colorful.
  rtsp: Check for dynamic payload handlers if no static payload mapping was found

Conflicts:
	Changelog
	doc/ffprobe.texi
	ffprobe.c
	libavutil/log.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-28 00:50:23 +02:00
Anton Khirnov 780ff97fef log: make colored output more colorful.
Green for verbose, cyan for debug.
2012-05-26 21:14:17 +02:00
Michael Niedermayer 7c7c5b2415 avutil/log: allow av_log_set_callback (NULL)
Idea-by: Don Moir <donmoir@comcast.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-10 19:11:23 +02:00
Clément Bœsch 625751c47a log: use a different color for debug (green). 2012-01-09 22:35:45 +01:00
Nicolas George 26c6fec9d9 lavu: introduce av_log_format_line. 2011-12-08 18:47:47 +01:00
Michael Niedermayer 707138593a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  adpcmenc: cosmetics: pretty-printing
  ac3dec: cosmetics: pretty-printing
  yuv4mpeg: cosmetics: pretty-printing
  shorten: remove dead initialization
  roqvideodec: set AVFrame reference before reget_buffer.
  bmp: fix some 1bit samples.
  latmdec: add fate test for audio config change
  oma: PCM support
  oma: better format detection with small probe buffer
  oma: clearify ambiguous if condition
  wavpack: Properly clip samples during lossy decode
  Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c.
  Cleaned pixdesc.c file in libavutil
  zmbv.c: coding style clean-up.
  xan.c: coding style clean-up.
  mpegvideo.c: code cleanup - first 500 lines.

Conflicts:
	Changelog
	libavcodec/adpcmenc.c
	libavcodec/bmp.c
	libavcodec/zmbv.c
	libavutil/log.c
	libavutil/pixdesc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-05 00:11:57 +01:00
Yordan Makariev 425b45d4b0 Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-12-03 15:13:48 -08:00
Michael Niedermayer 988f585fcb Merge remote-tracking branch 'qatar/master'
* qatar/master: (44 commits)
  replacement Indeo 3 decoder
  gsm demuxer: do not allocate packet twice.
  flvenc: use first packet delay as global delay.
  ac3enc: doxygen update.
  imc: return error codes instead of 0 for error conditions.
  imc: return meaningful error codes instead of -1
  imc: do not set channel layout for stereo
  imc: validate channel count
  imc: check for ff_fft_init() failure
  imc: check output buffer size before decoding
  imc: use DSPContext.bswap16_buf() to byte-swap packet data
  rtsp: add allowed_media_types option
  libgsm: add flush function to reset the decoder state when seeking
  libgsm: simplify decoding by using a loop
  gsm: log error message when packet is too small
  libgsmdec: do not needlessly set *data_size to 0
  gsmdec: do not needlessly set *data_size to 0
  gsmdec: add flush function to reset the decoder state when seeking
  libgsmdec: check output buffer size before decoding
  gsmdec: log error message when output buffer is too small.
  ...

Conflicts:
	Changelog
	ffplay.c
	libavcodec/indeo3.c
	libavcodec/mjpeg_parser.c
	libavcodec/vp3.c
	libavformat/cutils.c
	libavformat/id3v2.c
	libavutil/parseutils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-03 02:16:26 +01:00