Commit Graph

112 Commits

Author SHA1 Message Date
James Darnley 16509d3a28 log: allow color highlighting in Cygwin's mintty
Configure will detect the availability of the Windows' console functions and set
HAVE_SETCONSOLETEXTATTRIBUTE.  Meaning av_log will use those functions to
control colours.  When ffmpeg is run in Cygwin's mintty terminal emulator it
will not use colour highlighting in this case.

Mintty responds to the usual escape code colours (it even supports 256 colours).
Windows' cmd.exe does not.  Fortunately it seems that Cygwin's emulation layer
now translates the basic 16 colours into Windows' Console command functions.

That means that we can have av_log use the standard colour commands and let
ffmpeg print colours in both mintty and cmd.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-04 04:20:14 +02:00
Michael Niedermayer 609ef89703 avutil/log: remove stray ;
regression since  5a18b215f7

Reported-by: J_Darnley
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-03 22:59:39 +02:00
Michael Niedermayer 49e040e868 avutil/log: fix negative log levels
These where broken by 7763118cae

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-03 22:44:04 +02:00
Michael Niedermayer 1f8a6bef78 avutil/log: add code to test av_log()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-03 22:38:30 +02:00
Michael Niedermayer 5a18b215f7 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  log: Do not assume the TERM variable is always set

Conflicts:
	libavutil/log.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-03 22:18:26 +02:00
Michael Niedermayer 002feaf6e2 Merge commit '28b9ac4e48f3405a82e8e87ead336188215cf1e6'
* commit '28b9ac4e48f3405a82e8e87ead336188215cf1e6':
  log: Remove undefined behaviour

Conflicts:
	libavutil/log.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-03 20:53:30 +02:00
Michael Niedermayer c16e006181 Merge commit '7763118cae4eb468b032dbd29af15a011c2c233b'
* commit '7763118cae4eb468b032dbd29af15a011c2c233b':
  log: Support for 256color terminals

Conflicts:
	doc/APIchanges
	libavutil/log.c
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-03 20:44:14 +02:00
Luca Barbato 061e340c05 log: Factorize check_color_terminal() out 2014-04-03 20:04:34 +02:00
Luca Barbato 4ede1862dc log: Do not assume the TERM variable is always set 2014-04-03 18:43:25 +02:00
Luca Barbato 28b9ac4e48 log: Remove undefined behaviour 2014-04-03 18:43:24 +02:00
Luca Barbato 7763118cae log: Support for 256color terminals
And provide extended coloring capabilities for debugging.
The default colors do not change in 256 more to keep
supporting people using Black on White, White on Black and
Solarized terminals.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-04-03 15:54:49 +02:00
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