Commit Graph

70 Commits

Author SHA1 Message Date
Max Kellermann ca2439f595 filter/ffmpeg: pass "channel_layout" instead of "channels" to buffersrc
Fixes part 1 of https://github.com/MusicPlayerDaemon/MPD/issues/1235
2021-08-23 21:38:13 +02:00
Max Kellermann 5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Danilo Spinella 92bfdffa42 lib/ffmpeg/Filter: Add define required for avutil 2020-11-30 20:06:21 +01:00
Max Kellermann 38b41fc3fd filter/ffmpeg: detect the output sample format
Some FFmpeg filters change the sample format, and since MPD assumes
this never happens, this results in loud noise instead of music.  This
commit finally implements the TODO comment by sending one frame of
silence to the filter and checking the output frame's format.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1009
2020-11-16 09:39:34 +01:00
Max Kellermann 2d606fa989 decoder/ffmpeg: move code to lib/ffmpeg/Interleave.cxx
To be reused by the FFmpeg filter plugin.
2020-11-04 20:15:19 +01:00
Max Kellermann 42c9d765cf lib/ffmpeg/Buffer: add missing include 2020-11-04 20:06:41 +01:00
Max Kellermann a8a80ee689 lib/ffmpeg/Buffer: disallow copying 2020-11-04 19:51:21 +01:00
Max Kellermann f9bdb4b0b8 lib/ffmpeg/Buffer: add noexcept 2020-11-04 19:50:38 +01:00
Max Kellermann 9332527872 lib/ffmpeg/{Buffer,Time}: remove obsolete "#undef SampleFormat"
This compatibility macro has been removed from FFmpeg long ago.
2020-11-04 19:50:33 +01:00
Max Kellermann 6a4992118a lib/ffmpeg/Time: redefine AV_TIME_BASE_Q with initializer list
libavutil's macro definition is a compound literal, which is illegal
in C++.  Fixes yet another -Wpedantic warning.
2020-05-27 16:55:55 +02:00
Max Kellermann 5e93e882c9 Merge branch 'v0.21.x' 2020-05-27 16:16:30 +02:00
Max Kellermann 8e4ca23727 lib/ffmpeg/Time: replace C99 compound literal with C++ initializer list 2020-05-27 15:54:34 +02:00
Rosen Penev 97425d56e7 remove gcc_unused
[[maybe_unused]] (introduced in C++17) is standard C++.

https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev a2f5a63bbc replace stdint.h with cstdint
The former is deprecated by C++14. The standard says they are the same:

The header defines all types and macros the same as the C standard library
header<stdint.h>.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:39 -07:00
Rosen Penev 2db8bcc353 replace stddef.h with cstddef
The former is deprecated with C++14. The standard says both are the same:

The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:38 -07:00
Rosen Penev c846ee0d1b replace stdarg.h with cstdarg
The former was deprecated in C++14. The Standard says they are the same:

The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.

Also changed va_list to the std:: namespace version, which is the same.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:03:12 -07:00
Rosen Penev ab9f5d2067 replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann cd612c4eef AudioFormat: move to pcm/ 2020-01-18 20:24:59 +01:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann f909615b14 include cleanups (powered by iwyu) 2019-08-15 17:57:20 +02:00
Max Kellermann 5c550e8b33 lib/crypto/MD5: add option to use libavutil instead of libgcrypt 2019-08-14 18:56:10 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Yue Wang a7b30fcb9e add missing header.
bad_alloc depends on <new>
2019-06-07 21:59:31 -07:00
Max Kellermann e0d5d88104 Log: make LogLevel the first parameter
Prepare for templated functions.
2019-05-23 12:17:59 +02:00
Max Kellermann 054a7557fa lib/ffmpeg/Frame: add av_frame_unref() wrapper 2019-03-24 22:21:35 +01:00
Max Kellermann 1d436b3c86 lib/ffmpeg/IOContext: keep using avio_read() with old libavformat versions
avio_read_partial() was added in libavformat 57.81.100, and we keep
compatibility with version 57.40 for now.  Fixes regression from
commit bfb7b0117f

Closes https://github.com/MusicPlayerDaemon/MPD/issues/511
2019-03-20 13:15:05 +01:00
Max Kellermann e88667e01c lib/ffmpeg/Filter: add MakeAudioBuffer{Source,Sink}() 2019-03-18 11:05:13 +01:00
Max Kellermann fb96907b52 lib/ffmpeg/Filter: add missing include 2019-03-18 11:05:13 +01:00
Max Kellermann 09ece26200 lib/ffmpeg/SampleFormat: add ToFfmpegSampleFormat() 2019-03-18 11:02:17 +01:00
Max Kellermann 0c6d22fe47 decoder/ffmpeg: move code to lib/ffmpeg/SampleFormat.hxx 2019-03-18 10:58:46 +01:00
Max Kellermann c563eb81a3 lib/ffmpeg/Filter: C+++ wrapper for several libavfilter objects 2019-03-18 10:32:25 +01:00
Max Kellermann e864a0dd05 lib/ffmpeg/meson.build: detect libavfilter 2019-03-18 10:30:02 +01:00
Max Kellermann 42a05bc904 lib/ffmpeg/Frame: add more wrapper methods 2019-03-18 10:29:26 +01:00
Max Kellermann cb100f2e5c input/ffmpeg: use avio_feof(), eliminate eof attribute 2019-03-13 10:41:12 +01:00
Max Kellermann bfb7b0117f lib/ffmpeg/IOContext: allow partial reads 2019-03-13 10:39:43 +01:00
Max Kellermann f6a705c769 input/ffmpeg: add AVIOContext wrapper class 2019-03-13 10:01:17 +01:00
Max Kellermann 0009d53b3f decoder/ffmpeg: add AVCodecContext wrapper class 2019-03-13 09:41:52 +01:00
Max Kellermann 05f7a6d1ff decoder/ffmpeg: add AVFormatContext wrapper class 2019-03-13 00:27:21 +01:00
Max Kellermann 38a0844cdf decoder/ffmpeg: add AVFrame wrapper class 2019-03-12 23:51:46 +01:00
Max Kellermann 24cde31328 lib/ffmpeg/Time: remove redundant inline keywords from constexpr functions 2019-03-08 10:28:02 +01:00
Max Kellermann ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann 08272cdee2 decoder/ffmpeg: require FFmpeg 3.1 or later
Drop some compatibility code.
2018-11-04 21:55:06 +01:00
Max Kellermann 2a926063b2 src/lib/ffmpeg/meson.build: copy dependencies into ffmpeg_dep
Apparently, Meson propagates the linker flags but not the compiler
flags from a `static_library`'s dependencies list.

Closes #392
2018-11-01 19:14:00 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann 94592c1406 build with Meson instead of autotools
So long, autotools!  This is my last MPD related project to migrate
away from it.  It has its strengths, but also very obvious weaknesses
and weirdnesses.  Today, many of its quirks are not needed anymore,
and are cumbersome and slow.  Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann 90f4e97751 decoder/Client: use std::chrono::duration<double> instead of raw double 2018-09-21 20:42:34 +02:00
Max Kellermann ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann 69f4178bff decoder/ffmpeg: require at least version 11.12
This is the version in Debian Jessie (oldstable).
2018-08-02 20:18:19 +02:00
Max Kellermann 43a43c1e2b Merge tag 'v0.20.19'
release v0.20.19
2018-04-26 20:06:41 +02:00