summaryrefslogtreecommitdiffstats
path: root/common/av_log.c
Commit message (Collapse)AuthorAgeFilesLines
* common: stream: don't mention Libav in errors/warningsllyyr2024-01-201-1/+1
|
* common/av_log: do not assume AVClass.item_name is always setKacper Michajłow2023-12-241-1/+6
| | | | | | After recent change in FFmpeg it is not longer safe to call item_name. Ref: https://github.com/FFmpeg/FFmpeg/commit/0c6203c97a99f69dbaa6e4011d48c331e1111f5e
* common/av_log: use bstr for log callbackKacper Michajłow2023-11-281-10/+14
| | | | | | - don't use 4KiB stack array - keep one bstr allocation for lifetime of the log - avoid dummy strlen
* ALL: use new mp_thread abstractionKacper Michajłow2023-11-051-10/+10
|
* common/av_log: move general FFmpeg version before library versionsJan Ekström2022-11-151-2/+1
| | | | | This way another library can be logged before FFmpeg without it looking weird.
* common/av_log: explicitly include version.h for required librariesLeo Izen2022-03-171-0/+6
| | | | | | | | | | | FFmpeg recently split version.h into version.h and version_major.h, and no longer automatically includes version.h in avcodec.h (and the other libraries). This should allow mpv to build against ffmpeg git master. See FFmpeg/ffmpeg@f2da2e1458b76a1d6c068673430b46cf2850bc51 These headers are not new, so their inclusion should not affect backwards compatibility.
* player: rearrange libav* library checkwm42020-03-081-8/+9
| | | | No need to be nice. Also hopefully breaks idiotic distro patches.
* Remove remains of Libav compatibilitywm42020-02-161-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Libav seems rather dead: no release for 2 years, no new git commits in master for almost a year (with one exception ~6 months ago). From what I can tell, some developers resigned themselves to the horrifying idea to post patches to ffmpeg-devel instead, while the rest of the developers went on to greener pastures. Libav was a better project than FFmpeg. Unfortunately, FFmpeg won, because it managed to keep the name and website. Libav was pushed more and more into obscurity: while there was initially a big push for Libav, FFmpeg just remained "in place" and visible for most people. FFmpeg was slowly draining all manpower and energy from Libav. A big part of this was that FFmpeg stole code from Libav (regular merges of the entire Libav git tree), making it some sort of Frankenstein mirror of Libav, think decaying zombie with additional legs ("features") nailed to it. "Stealing" surely is the wrong word; I'm just aping the language that some of the FFmpeg members used to use. All that is in the past now, I'm probably the only person left who is annoyed by this, and with this commit I'm putting this decade long problem finally to an end. I just thought I'd express my annoyance about this fucking shitshow one last time. The most intrusive change in this commit is the resample filter, which originally used libavresample. Since the FFmpeg developer refused to enable libavresample by default for drama reasons, and the API was slightly different, so the filter used some big preprocessor mess to make it compatible to libswresample. All that falls away now. The simplification to the build system is also significant.
* player: accept compatible later FFmpeg library runtime versionswm42019-10-111-1/+2
| | | | | | | | | | | | | | | | | | mpv warned if the FFmpeg runtime library version was not exactly the same as the build version. This seemed to cause frequent conflicts. At this point, most mpv code probably adheres to the FFmpeg ABI rules, and FFmpeg stopped breaking ABI "accidentally". Another source of problems were mixed FFmpeg/Libav installations, something which nobody does anymore. It's not "our" job to check and enforce ABI compatibility either. So I guess this behavior can be removed. OK, still check for incompatible libraries (according to FFmpeg versioning rules), i.e. different major versions, or if the build version is newer than the runtime version. For now. The comment about ABI problems is still true. In particular, the bytes_read field mentioned in the removed comment is still accessed, and is still an ABI violation. Have fun.
* av_log: use proper FFmpeg version extraction macroswm42019-10-111-1/+3
| | | | Though not like they will or can never change them.
* f_lavfi: use new libavfilter iteration APIwm42018-04-031-1/+0
|
* Fix recent FFmpeg deprecationswm42018-02-131-2/+0
| | | | | | | | | This includes codec/muxer/demuxer iteration (different iteration function, registration functions deprecated), and the renaming of AVFormatContext.filename to url (plus making it a malloced string). Libav doesn't have the new API yet, so it will break. I hope they will add the new APIs too.
* av_log: stop accessing private ffmpeg fieldswm42018-01-031-2/+2
| | | | MPlayer legacy added in 3c49701490aecb.
* msg: reinterpret a bunch of message levelsNiklas Haas2017-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | I've decided that MP_TRACE means “noisy spam per frame”, whereas MP_DBG just means “more verbose debugging messages than MSGL_V”. Basically, MSGL_DBG shouldn't create spam per frame like it currently does, and MSGL_V should make sense to the end-user and provide mostly additional informational output. MP_DBG is basically what I want to make the new default for --log-file, so the cut-off point for MP_DBG is if we probably want to know if for debugging purposes but the user most likely doesn't care about on the terminal. Also, the debug callbacks for libass and ffmpeg got bumped in their verbosity levels slightly, because being external components they're a bit less relevant to mpv debugging, and a bit too over-eager in what they consider to be relevant information. I exclusively used the "try it on my machine and remove messages from MSGL_* until it does what I want it to" approach of refactoring, so YMMV.
* build: make it easier to force FFmpeg upstreamwm42017-11-011-4/+2
| | | | | | | | | | | Apparently some people want this. Actually making it compile is still their problem, though, and I expect that build with FFmpeg upstream will occasionally be broken (as it is right now). This is because mpv also relies on API provided by Libav, and if FFmpeg hasn't merged that yet, it's not our problem - we provide a version of FFmpeg upstream with those changes merged, and it's called ffmpeg-mpv. Also adjust the README which still talked about FFmpeg releases.
* Bump libav* API usewm42017-10-301-4/+4
| | | | (Not tested on Windows and OSX.)
* build: add preliminary LGPL modewm42017-09-211-9/+7
| | | | | | | See "Copyright" file for caveats. This changes the remaining "almost LGPL" files to LGPL, because we think that the conditions the author set for these was finally fulfilled.
* av_log: mark as almost LGPLwm42017-05-051-0/+2
| | | | | All authors agreed. Some of the code originated from commit 3c49701490aecb by michael, thus the license change has to be delayed.
* build: explicitly check for FFmpeg vs. Libav, and their exact versionswm42017-01-271-4/+4
| | | | | | | | | | | | | | | | | | In a first pass, we check whether libavcodec is present. Then we try to compile a snippet and check for FFmpeg vs. Libav. (This could probably also be done by somehow checking the pkgconfig version. But pkg-config can't deal with that idiotic FFmpeg idea that a micro version number >= 100 identifies FFmpeg vs. Libav.) After that we check the project-specific version numbers. This means it can no longer happen that we accidentally allow older, unsupported versions of FFmpeg, just because the Libav version numbers are somehow this way. Also drop the resampler checks. We hardcode which resampler to each with each project. A user can no longer force use of libavresample with FFmpeg.
* Remove compatibility thingswm42016-12-071-2/+0
| | | | | | Possible with bumped FFmpeg/Libav. These are just the simple cases.
* player: fatal error if linked and compiled FFmpeg versions mismatchwm42016-07-011-9/+2
| | | | | | | | | We don't support this anymore. This tries to exit in a controlled way after command line options are applied in order to honor logging options and, in case of libmpv, not to kill the host. Not sure if it would be better to just vomit text to stderr and call abort().
* av_log: readd ffmpeg library runtime version mismatch warningwm42016-05-011-1/+13
| | | | It just happens far too often.
* av_log: avoid partial lineswm42016-03-011-2/+7
| | | | | | | | | | | | | We want to add a prefix to the ffmpeg log message, so we called mp_msg multiple times until now. But logging such partial lines is a race condition, because there's only one internal mp_msg buffer, and no external mp_msg locks. Avoid this by building the message on a stack buffer. I might make a mp_log-local partial line buffer, but even then av_log() can be called from multiple threads, while targetting the same mp_log. (Really, ffmpeg's log API needs to be fixed.)
* build: make libavfilter mandatorywm42016-02-051-9/+2
| | | | | | The complex filter support that will be added makes much more complex use of libavfilter, and I'm not going to bother with adding hacks to keep libavfilter optional.
* av_log: remove dumb shitwm42015-07-181-24/+1
| | | | | | | It's the user's fault if he/she/it does something that is not recommended. Fixes #2110.
* av_log: print FFmpeg versionwm42015-07-031-0/+4
| | | | | The individual library versionsd are pretty useless. This will actually tell us at least the git hash or git tag of the FFmpeg build.
* av_log: skip prefix if unknownwm42015-06-201-2/+3
| | | | | | | | This happens with av_log(NULL, ...) calls. Drop the "?: " fallback prefix, because it was confusing. (Of course FFmpeg should not do this at all, but it's a very long way to making the FFmpeg log callback sane.)
* av_log: set default av_log callback on exitwm42015-06-171-0/+1
| | | | | | | | | | | | This is slightly "dangerous", because it could overwrite a log callback another library has set, after we've set our own callback. But it's probably still slightly better than leaving our own callback, which will run the fallback code if no mpv instance is set. (Multiple mpv instances sharing the same global state will safely avoid overwriting each other's log callback.) Note that we can't do much better, because the global state in FFmpeg is obviously insane.
* Update license headersMarcin Kurczewski2015-04-131-5/+4
| | | | Signed-off-by: wm4 <wm4@nowhere>
* player: drop explicit exit() callswm42015-02-121-2/+2
| | | | | | | | | The code in main.c calls exit() explicitly, but the code is actually easier to follow by simply exiting from main() instead. The exit() call in av_log.c happens only on severely broken builds, so replace it with abort(). (Shuts up rpmlint warnings.)
* av_log: add tons of warnings against mismatched ffmpeg/libav librarieswm42014-02-101-0/+22
| | | | | | | | | | | | | Print a warning if a library has mismatched compile time and link time versions. Refuse to work if the compile time and link time versions are a mix of ffmpeg and libav. We print an error message and call exit(). Since we'd randomly crash anyway, I think this is ok. This doesn't catch the case if you e.g. use a ffmpeg libavcodec and a libav libavformat, which would of course just crash as quickly, but I think this checks enough already.
* av_log: restructure version printing codewm42014-02-101-18/+28
| | | | Makes the following commit simpler.
* msg: rename mp_msg_log -> mp_msgwm42013-12-211-7/+7
| | | | Same for companion functions.
* msg: convert defines to enumwm42013-12-211-1/+1
| | | | Also get rid of MSGL_HINT and the many MSGL_DBG* levels.
* av_log: mp_msg conversionwm42013-12-211-31/+65
| | | | | | | | This is pretty nasty, because FFmpeg/Libav is yet another library with a global message callback. We do something with mutexes trying to get it done, but of course we can't actually solve this problem. If more than one library in a process use FFmpeg/Libav, only one of them will get log messages.
* m_option, m_config: mp_msg conversionswm42013-12-211-13/+14
| | | | | | | | Always pass around mp_log contexts in the option parser code. This of course affects all users of this API as well. In stream.c, pass a mp_null_log, because we can't do it properly yet. This will be fixed later.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-0/+176