libmpv: use correct header directory name

libmpv headers are installed to `mpv/`, so why are we pretending it is
`libmpv`?

Fixes documentation, libmpv meson dependency, tests.
This commit is contained in:
Kacper Michajłow
2024-07-06 13:32:28 +02:00
parent 77313f73a2
commit d759e26fd0
46 changed files with 56 additions and 61 deletions

View File

@@ -153,7 +153,7 @@ command-interface.
libmpv C API
------------
The libmpv client API (such as ``<libmpv/client.h>``) mostly gives access to
The libmpv client API (such as ``<mpv/client.h>``) mostly gives access to
the command interface. The API itself (if looked at as a component separate
from the command interface) is intended to be extremely stable.

View File

@@ -2,14 +2,14 @@ EMBEDDING INTO OTHER PROGRAMS (LIBMPV)
======================================
mpv can be embedded into other programs as video/audio playback backend. The
recommended way to do so is using libmpv. See ``libmpv/client.h`` in the mpv
recommended way to do so is using libmpv. See ``mpv/client.h`` in the mpv
source code repository. This provides a C API. Bindings for other languages
might be available (see wiki).
Since libmpv merely allows access to underlying mechanisms that can control
mpv, further documentation is spread over a few places:
- https://github.com/mpv-player/mpv/blob/master/libmpv/client.h
- https://github.com/mpv-player/mpv/blob/master/mpv/client.h
- https://mpv.io/manual/master/#options
- https://mpv.io/manual/master/#list-of-input-commands
- https://mpv.io/manual/master/#properties

View File

@@ -37,7 +37,7 @@ Player
* ``--keep-open`` option to stop the player from closing the window and
exiting after playback ends.
* A client API, that allows embedding **mpv** into applications
(see ``libmpv/client.h`` in the sources).
(see ``mpv/client.h`` in the sources).
Input
~~~~~
@@ -410,7 +410,7 @@ Slave mode
`JSON IPC`_ for more information.
* **mpv** also provides a client API, which can be used to embed the player
by loading it as shared library. (See ``libmpv/client.h`` in the sources.)
by loading it as shared library. (See ``mpv/client.h`` in the sources.)
It might also be possible to implement a custom slave mode-like protocol
using Lua scripting.

View File

@@ -93,7 +93,7 @@ player/core.h:
usually not accessed by other parts of mpv for the sake of modularization.
player/client.c:
This implements the client API (libmpv/client.h). For the most part, this
This implements the client API (mpv/client.h). For the most part, this
just calls into other parts of the player. This also manages a ringbuffer
of events from player to clients.

View File

@@ -35,7 +35,7 @@
#include "osdep/threads.h"
#include "osdep/timer.h"
#include "libmpv/client.h"
#include "mpv/client.h"
#include "msg.h"
#include "msg_control.h"

View File

@@ -1,7 +1,7 @@
#include <stdatomic.h>
#include <time.h>
#include <libmpv/client.h>
#include <mpv/client.h>
#include "common.h"
#include "global.h"

View File

@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <libmpv/client.h>
#include <mpv/client.h>
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);

View File

@@ -5,7 +5,7 @@ add_languages('cpp', native: false)
fuzzers = []
fuzzers += executable('fuzzer_loadfile_direct', 'fuzzer_loadfile_direct.c',
link_language: 'cpp', include_directories: incdir, link_with: libmpv)
link_language: 'cpp', dependencies: libmpv_dep)
protocols = ['edl', 'file', 'lavf', 'memory']
demuxers = ['mkv']
@@ -34,8 +34,7 @@ foreach p : protocols
'fuzzer_loadfile_direct.c',
link_language: 'cpp',
c_args: ['-DMPV_PROTO=' + p, '-DMPV_PROTO_' + p.to_upper()],
include_directories: incdir,
link_with: libmpv)
dependencies: libmpv_dep)
endforeach
foreach demuxer : demuxers
@@ -47,8 +46,7 @@ foreach demuxer : demuxers
link_language: 'cpp',
c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd_.to_upper(),
'-DMPV_DEMUXER="' + demuxer + '"', '-DMPV_DEMUXER' + demuxer_.to_upper()],
include_directories: incdir,
link_with: libmpv)
dependencies: libmpv_dep)
endforeach
foreach f : ['MPV_FORMAT_STRING', 'MPV_FORMAT_FLAG', 'MPV_FORMAT_INT64', 'MPV_FORMAT_DOUBLE']
@@ -57,8 +55,7 @@ foreach f : ['MPV_FORMAT_STRING', 'MPV_FORMAT_FLAG', 'MPV_FORMAT_INT64', 'MPV_FO
'fuzzer_set_property.c',
link_language: 'cpp',
c_args: ['-DMPV_FORMAT=' + f, '-DMPV_RUN=' + i],
include_directories: incdir,
link_with: libmpv)
dependencies: libmpv_dep)
endforeach
endforeach
@@ -67,8 +64,7 @@ foreach cmd : ['file', '-config-file', '-input-conf']
'fuzzer_load.c',
link_language: 'cpp',
c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd.underscorify().to_upper()],
include_directories: incdir,
link_with: libmpv)
dependencies: libmpv_dep)
endforeach
fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c',

View File

@@ -27,7 +27,7 @@
#include "input.h"
#include "misc/json.h"
#include "libmpv/client.h"
#include "mpv/client.h"
static void destroy_cmd(void *ptr)
{

View File

@@ -28,7 +28,7 @@
#include <fcntl.h>
#include <assert.h>
#include <libmpv/client.h>
#include <mpv/client.h>
#include "osdep/io.h"
#include "misc/rendezvous.h"

View File

@@ -32,7 +32,7 @@
#include "common/global.h"
#include "common/msg.h"
#include "input/input.h"
#include "libmpv/client.h"
#include "mpv/client.h"
#include "options/m_config.h"
#include "options/options.h"
#include "options/path.h"

View File

@@ -26,7 +26,7 @@
#include "common/global.h"
#include "common/msg.h"
#include "input/input.h"
#include "libmpv/client.h"
#include "mpv/client.h"
#include "options/m_config.h"
#include "options/options.h"
#include "player/client.h"

View File

@@ -15,7 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libmpv/client.h>
#include <mpv/client.h>
#include "common/msg.h"
#include "input/input.h"

View File

@@ -1755,7 +1755,7 @@ if win32
endif
client_h_define = cc.get_define('MPV_CLIENT_API_VERSION', prefix: '#include "libmpv/client.h"',
client_h_define = cc.get_define('MPV_CLIENT_API_VERSION', prefix: '#include "mpv/client.h"',
include_directories: include_directories('.'))
major = client_h_define.split('|')[0].split('<<')[0].strip('() ')
minor = client_h_define.split('|')[1].strip('() ')
@@ -1772,12 +1772,12 @@ if get_option('libmpv')
pkg.generate(libmpv, version: client_api_version,
description: 'mpv media player client library')
headers = ['libmpv/client.h', 'libmpv/render.h',
'libmpv/render_gl.h', 'libmpv/stream_cb.h']
headers = ['mpv/client.h', 'mpv/render.h',
'mpv/render_gl.h', 'mpv/stream_cb.h']
install_headers(headers, subdir: 'mpv')
# Allow projects to build with libmpv by cloning into ./subprojects/mpv
libmpv_dep = declare_dependency(link_with: libmpv)
libmpv_dep = declare_dependency(include_directories: '.', link_with: libmpv)
meson.override_dependency('mpv', libmpv_dep)
endif

View File

@@ -48,7 +48,7 @@
#include <inttypes.h>
#include <assert.h>
#include <libmpv/client.h>
#include <mpv/client.h>
#include "common/common.h"
#include "misc/bstr.h"

View File

@@ -1,6 +1,6 @@
#include "node.h"
#include <libmpv/client.h>
#include <mpv/client.h>
#include "common/common.h"
#include "bstr.h"

View File

View File

View File

View File

View File

@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include "libmpv/client.h"
#include "mpv/client.h"
#include "common/common.h"
#include "common/msg_control.h"

View File

@@ -32,7 +32,7 @@
#include <libavutil/common.h>
#include "libmpv/client.h"
#include "mpv/client.h"
#include "player/client.h"
#include "mpv_talloc.h"

View File

@@ -26,7 +26,7 @@
#include <libavutil/common.h>
#include "libmpv/client.h"
#include "mpv/client.h"
#include "mpv_talloc.h"
#include "m_option.h"

View File

@@ -20,7 +20,7 @@
#include "player/client.h"
#include "video/out/libmpv.h"
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "options/m_config.h"
#include "player/core.h"

View File

@@ -4,7 +4,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "libmpv/stream_cb.h"
#include "mpv/stream_cb.h"
#include "misc/bstr.h"
struct MPContext;

View File

@@ -20,7 +20,7 @@
#include <stdbool.h>
#include "libmpv/client.h"
#include "mpv/client.h"
#include "osdep/compiler.h"
struct MPContext;

View File

@@ -42,7 +42,7 @@
#include "core.h"
#include "command.h"
#include "client.h"
#include "libmpv/client.h"
#include "mpv/client.h"
// List of builtin modules and their contents as strings.
// All these are generated from player/javascript/*.js

View File

@@ -47,7 +47,7 @@
#include "core.h"
#include "command.h"
#include "client.h"
#include "libmpv/client.h"
#include "mpv/client.h"
// List of builtin modules and their contents as strings.
// All these are generated from player/lua/*.lua

View File

@@ -35,9 +35,9 @@
#include "misc/bstr.h"
#include "core.h"
#include "client.h"
#include "libmpv/client.h"
#include "libmpv/render.h"
#include "libmpv/stream_cb.h"
#include "mpv/client.h"
#include "mpv/render.h"
#include "mpv/stream_cb.h"
extern const struct mp_scripting mp_scripting_lua;
extern const struct mp_scripting mp_scripting_cplugin;

View File

@@ -12,7 +12,7 @@
#include "options/m_option.h"
#include "options/path.h"
#include "player/client.h"
#include "libmpv/stream_cb.h"
#include "mpv/stream_cb.h"
#include "misc/thread_tools.h"
struct priv {

View File

@@ -1,4 +1,4 @@
#include <libmpv/client.h>
#include <mpv/client.h>
#include "misc/json.h"
#include "misc/node.h"

View File

@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include <libmpv/client.h>
#include <mpv/client.h>
// Stolen from osdep/compiler.h
#ifdef __GNUC__

View File

@@ -28,7 +28,7 @@
#include <unistd.h>
#endif
#include <libmpv/client.h>
#include <mpv/client.h>
// Stolen from osdep/compiler.h
#ifdef __GNUC__

View File

@@ -3,7 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <libmpv/client.h>
#include <mpv/client.h>
// detect enabled ASAN on gcc & clang
#ifndef __SANITIZE_ADDRESS__

View File

@@ -119,15 +119,15 @@ if get_option('libmpv')
file = join_paths(source_root, 'etc', 'mpv-icon-8bit-16x16.png')
exe = executable('libmpv-test-file-loading', 'libmpv_test_file_loading.c',
include_directories: incdir, link_with: libmpv)
dependencies: libmpv_dep)
test('libmpv-test-file-loading', exe, args: file, suite: 'libmpv')
exe = executable('libmpv-test-lavfi-complex', 'libmpv_test_lavfi_complex.c',
include_directories: incdir, link_with: libmpv)
dependencies: libmpv_dep)
test('libmpv-test-lavfi-complex', exe, args: file, suite: 'libmpv')
exe = executable('libmpv-test-options', 'libmpv_test_options.c',
include_directories: incdir, link_with: libmpv)
dependencies: libmpv_dep)
test('libmpv-test-options', exe, suite: 'libmpv')
# Old versions of ffmpeg are bugged when setting forced tracks and older
@@ -139,8 +139,7 @@ if get_option('libmpv')
endif
endif
exe = executable('libmpv-encode', 'libmpv_encode.c',
include_directories: incdir, link_with: libmpv)
exe = executable('libmpv-encode', 'libmpv_encode.c', dependencies: libmpv_dep)
test('libmpv-encode', exe, suite: 'libmpv')
mpvlib = libmpv

View File

@@ -65,7 +65,7 @@ foreach name, cmd: samples
env = name == 'locale.mkv' ? 'LANG=C' : []
testname = 'libmpv-test-' + name
exe = executable(testname, '../libmpv_test_track_selection.c',
include_directories: incdir, link_with: libmpv)
dependencies: libmpv_dep)
test(testname, exe, args: [name, target.full_path()],
depends: target, env: env, suite: 'libmpv')
endforeach

View File

@@ -1,7 +1,7 @@
#include "config.h"
#include "hwdec.h"
#include "libmpv_gpu.h"
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "video.h"
#include "video/out/libmpv.h"

View File

@@ -28,7 +28,7 @@
#include "config.h"
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "options/m_config.h"
#include "video/fmt-conversion.h"
#include "video/out/drm_common.h"

View File

@@ -29,7 +29,7 @@
#include "video/hwdec.h"
#include "common/msg.h"
#include "options/m_config.h"
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "video/out/drm_atomic.h"
#include "video/out/drm_common.h"
#include "video/out/drm_prime.h"

View File

@@ -33,7 +33,7 @@
#include "video/vaapi.h"
#if HAVE_VAAPI_DRM
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#endif
#if HAVE_VAAPI_X11

View File

@@ -2,7 +2,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "libmpv/render.h"
#include "mpv/render.h"
#include "vo.h"
// Helper for finding a parameter value. It returns the direct pointer to the

View File

@@ -1,4 +1,4 @@
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "libmpv.h"
#include "sub/osd.h"
#include "video/sws_utils.h"

View File

@@ -28,7 +28,7 @@
#include <EGL/eglext.h>
#include <drm_fourcc.h>
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "common/common.h"
#include "osdep/timer.h"
#include "video/out/drm_atomic.h"

View File

@@ -2,7 +2,7 @@
#include "context.h"
#include "ra_gl.h"
#include "options/m_config.h"
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "video/out/gpu/libmpv_gpu.h"
#include "video/out/gpu/ra.h"

View File

@@ -26,7 +26,7 @@
#include <fcntl.h>
#include <unistd.h>
#include "libmpv/render_gl.h"
#include "mpv/render_gl.h"
#include "video/out/drm_common.h"
#endif

View File

@@ -18,7 +18,7 @@
#include <windows.h>
#include <string.h>
#include "libmpv/client.h"
#include "mpv/client.h"
#include "osdep/io.h"
#include "mpv_talloc.h"