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 committed 2025-02-23 01:40:12 +01:00
1 parent 77313f73a2
commit d759e26fd0
46 files changed
+56 -61

No files matched your search

+1 -1
View File
@@ -153,7 +153,7 @@ command-interface.
libmpv C API 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 the command interface. The API itself (if looked at as a component separate
from the command interface) is intended to be extremely stable. from the command interface) is intended to be extremely stable.
+2 -2
View File
@@ -2,14 +2,14 @@ EMBEDDING INTO OTHER PROGRAMS (LIBMPV)
====================================== ======================================
mpv can be embedded into other programs as video/audio playback backend. The 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 source code repository. This provides a C API. Bindings for other languages
might be available (see wiki). might be available (see wiki).
Since libmpv merely allows access to underlying mechanisms that can control Since libmpv merely allows access to underlying mechanisms that can control
mpv, further documentation is spread over a few places: 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/#options
- https://mpv.io/manual/master/#list-of-input-commands - https://mpv.io/manual/master/#list-of-input-commands
- https://mpv.io/manual/master/#properties - https://mpv.io/manual/master/#properties
+2 -2
View File
@@ -37,7 +37,7 @@ Player
* ``--keep-open`` option to stop the player from closing the window and * ``--keep-open`` option to stop the player from closing the window and
exiting after playback ends. exiting after playback ends.
* A client API, that allows embedding **mpv** into applications * A client API, that allows embedding **mpv** into applications
(see ``libmpv/client.h`` in the sources). (see ``mpv/client.h`` in the sources).
Input Input
~~~~~ ~~~~~
@@ -410,7 +410,7 @@ Slave mode
`JSON IPC`_ for more information. `JSON IPC`_ for more information.
* **mpv** also provides a client API, which can be used to embed the player * **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 It might also be possible to implement a custom slave mode-like protocol
using Lua scripting. using Lua scripting.
+1 -1
View File
@@ -93,7 +93,7 @@ player/core.h:
usually not accessed by other parts of mpv for the sake of modularization. usually not accessed by other parts of mpv for the sake of modularization.
player/client.c: 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 just calls into other parts of the player. This also manages a ringbuffer
of events from player to clients. of events from player to clients.
+1 -1
View File
@@ -35,7 +35,7 @@
#include "osdep/threads.h" #include "osdep/threads.h"
#include "osdep/timer.h" #include "osdep/timer.h"
#include "libmpv/client.h" #include "mpv/client.h"
#include "msg.h" #include "msg.h"
#include "msg_control.h" #include "msg_control.h"
+1 -1
View File
@@ -1,7 +1,7 @@
#include <stdatomic.h> #include <stdatomic.h>
#include <time.h> #include <time.h>
#include <libmpv/client.h> #include <mpv/client.h>
#include "common.h" #include "common.h"
#include "global.h" #include "global.h"
+1 -1
View File
@@ -23,7 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libmpv/client.h> #include <mpv/client.h>
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size); int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
+5 -9
View File
@@ -5,7 +5,7 @@ add_languages('cpp', native: false)
fuzzers = [] fuzzers = []
fuzzers += executable('fuzzer_loadfile_direct', 'fuzzer_loadfile_direct.c', 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'] protocols = ['edl', 'file', 'lavf', 'memory']
demuxers = ['mkv'] demuxers = ['mkv']
@@ -34,8 +34,7 @@ foreach p : protocols
'fuzzer_loadfile_direct.c', 'fuzzer_loadfile_direct.c',
link_language: 'cpp', link_language: 'cpp',
c_args: ['-DMPV_PROTO=' + p, '-DMPV_PROTO_' + p.to_upper()], c_args: ['-DMPV_PROTO=' + p, '-DMPV_PROTO_' + p.to_upper()],
include_directories: incdir, dependencies: libmpv_dep)
link_with: libmpv)
endforeach endforeach
foreach demuxer : demuxers foreach demuxer : demuxers
@@ -47,8 +46,7 @@ foreach demuxer : demuxers
link_language: 'cpp', link_language: 'cpp',
c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd_.to_upper(), c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd_.to_upper(),
'-DMPV_DEMUXER="' + demuxer + '"', '-DMPV_DEMUXER' + demuxer_.to_upper()], '-DMPV_DEMUXER="' + demuxer + '"', '-DMPV_DEMUXER' + demuxer_.to_upper()],
include_directories: incdir, dependencies: libmpv_dep)
link_with: libmpv)
endforeach endforeach
foreach f : ['MPV_FORMAT_STRING', 'MPV_FORMAT_FLAG', 'MPV_FORMAT_INT64', 'MPV_FORMAT_DOUBLE'] 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', 'fuzzer_set_property.c',
link_language: 'cpp', link_language: 'cpp',
c_args: ['-DMPV_FORMAT=' + f, '-DMPV_RUN=' + i], c_args: ['-DMPV_FORMAT=' + f, '-DMPV_RUN=' + i],
include_directories: incdir, dependencies: libmpv_dep)
link_with: libmpv)
endforeach endforeach
endforeach endforeach
@@ -67,8 +64,7 @@ foreach cmd : ['file', '-config-file', '-input-conf']
'fuzzer_load.c', 'fuzzer_load.c',
link_language: 'cpp', link_language: 'cpp',
c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd.underscorify().to_upper()], c_args: ['-DMPV_LOAD="' + cmd + '"', '-DMPV_LOAD' + cmd.underscorify().to_upper()],
include_directories: incdir, dependencies: libmpv_dep)
link_with: libmpv)
endforeach endforeach
fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c', fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c',
+1 -1
View File
@@ -27,7 +27,7 @@
#include "input.h" #include "input.h"
#include "misc/json.h" #include "misc/json.h"
#include "libmpv/client.h" #include "mpv/client.h"
static void destroy_cmd(void *ptr) static void destroy_cmd(void *ptr)
{ {
+1 -1
View File
@@ -28,7 +28,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <assert.h> #include <assert.h>
#include <libmpv/client.h> #include <mpv/client.h>
#include "osdep/io.h" #include "osdep/io.h"
#include "misc/rendezvous.h" #include "misc/rendezvous.h"
+1 -1
View File
@@ -32,7 +32,7 @@
#include "common/global.h" #include "common/global.h"
#include "common/msg.h" #include "common/msg.h"
#include "input/input.h" #include "input/input.h"
#include "libmpv/client.h" #include "mpv/client.h"
#include "options/m_config.h" #include "options/m_config.h"
#include "options/options.h" #include "options/options.h"
#include "options/path.h" #include "options/path.h"
+1 -1
View File
@@ -26,7 +26,7 @@
#include "common/global.h" #include "common/global.h"
#include "common/msg.h" #include "common/msg.h"
#include "input/input.h" #include "input/input.h"
#include "libmpv/client.h" #include "mpv/client.h"
#include "options/m_config.h" #include "options/m_config.h"
#include "options/options.h" #include "options/options.h"
#include "player/client.h" #include "player/client.h"
+1 -1
View File
@@ -15,7 +15,7 @@
* License along with mpv. If not, see <http://www.gnu.org/licenses/>. * 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 "common/msg.h"
#include "input/input.h" #include "input/input.h"
+4 -4
View File
@@ -1755,7 +1755,7 @@ if win32
endif 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('.')) include_directories: include_directories('.'))
major = client_h_define.split('|')[0].split('<<')[0].strip('() ') major = client_h_define.split('|')[0].split('<<')[0].strip('() ')
minor = client_h_define.split('|')[1].strip('() ') minor = client_h_define.split('|')[1].strip('() ')
@@ -1772,12 +1772,12 @@ if get_option('libmpv')
pkg.generate(libmpv, version: client_api_version, pkg.generate(libmpv, version: client_api_version,
description: 'mpv media player client library') description: 'mpv media player client library')
headers = ['libmpv/client.h', 'libmpv/render.h', headers = ['mpv/client.h', 'mpv/render.h',
'libmpv/render_gl.h', 'libmpv/stream_cb.h'] 'mpv/render_gl.h', 'mpv/stream_cb.h']
install_headers(headers, subdir: 'mpv') install_headers(headers, subdir: 'mpv')
# Allow projects to build with libmpv by cloning into ./subprojects/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) meson.override_dependency('mpv', libmpv_dep)
endif endif
+1 -1
View File
@@ -48,7 +48,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <assert.h> #include <assert.h>
#include <libmpv/client.h> #include <mpv/client.h>
#include "common/common.h" #include "common/common.h"
#include "misc/bstr.h" #include "misc/bstr.h"
+1 -1
View File
@@ -1,6 +1,6 @@
#include "node.h" #include "node.h"
#include <libmpv/client.h> #include <mpv/client.h>
#include "common/common.h" #include "common/common.h"
#include "bstr.h" #include "bstr.h"
View File
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
View File
@@ -24,7 +24,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "libmpv/client.h" #include "mpv/client.h"
#include "common/common.h" #include "common/common.h"
#include "common/msg_control.h" #include "common/msg_control.h"
+1 -1
View File
@@ -32,7 +32,7 @@
#include <libavutil/common.h> #include <libavutil/common.h>
#include "libmpv/client.h" #include "mpv/client.h"
#include "player/client.h" #include "player/client.h"
#include "mpv_talloc.h" #include "mpv_talloc.h"
+1 -1
View File
@@ -26,7 +26,7 @@
#include <libavutil/common.h> #include <libavutil/common.h>
#include "libmpv/client.h" #include "mpv/client.h"
#include "mpv_talloc.h" #include "mpv_talloc.h"
#include "m_option.h" #include "m_option.h"
+1 -1
View File
@@ -20,7 +20,7 @@
#include "player/client.h" #include "player/client.h"
#include "video/out/libmpv.h" #include "video/out/libmpv.h"
#include "libmpv/render_gl.h" #include "mpv/render_gl.h"
#include "options/m_config.h" #include "options/m_config.h"
#include "player/core.h" #include "player/core.h"
+1 -1
View File
@@ -4,7 +4,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "libmpv/stream_cb.h" #include "mpv/stream_cb.h"
#include "misc/bstr.h" #include "misc/bstr.h"
struct MPContext; struct MPContext;
+1 -1
View File
@@ -20,7 +20,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "libmpv/client.h" #include "mpv/client.h"
#include "osdep/compiler.h" #include "osdep/compiler.h"
struct MPContext; struct MPContext;
+1 -1
View File
@@ -42,7 +42,7 @@
#include "core.h" #include "core.h"
#include "command.h" #include "command.h"
#include "client.h" #include "client.h"
#include "libmpv/client.h" #include "mpv/client.h"
// List of builtin modules and their contents as strings. // List of builtin modules and their contents as strings.
// All these are generated from player/javascript/*.js // All these are generated from player/javascript/*.js
+1 -1
View File
@@ -47,7 +47,7 @@
#include "core.h" #include "core.h"
#include "command.h" #include "command.h"
#include "client.h" #include "client.h"
#include "libmpv/client.h" #include "mpv/client.h"
// List of builtin modules and their contents as strings. // List of builtin modules and their contents as strings.
// All these are generated from player/lua/*.lua // All these are generated from player/lua/*.lua
+3 -3
View File
@@ -35,9 +35,9 @@
#include "misc/bstr.h" #include "misc/bstr.h"
#include "core.h" #include "core.h"
#include "client.h" #include "client.h"
#include "libmpv/client.h" #include "mpv/client.h"
#include "libmpv/render.h" #include "mpv/render.h"
#include "libmpv/stream_cb.h" #include "mpv/stream_cb.h"
extern const struct mp_scripting mp_scripting_lua; extern const struct mp_scripting mp_scripting_lua;
extern const struct mp_scripting mp_scripting_cplugin; extern const struct mp_scripting mp_scripting_cplugin;
+1 -1
View File
@@ -12,7 +12,7 @@
#include "options/m_option.h" #include "options/m_option.h"
#include "options/path.h" #include "options/path.h"
#include "player/client.h" #include "player/client.h"
#include "libmpv/stream_cb.h" #include "mpv/stream_cb.h"
#include "misc/thread_tools.h" #include "misc/thread_tools.h"
struct priv { struct priv {
+1 -1
View File
@@ -1,4 +1,4 @@
#include <libmpv/client.h> #include <mpv/client.h>
#include "misc/json.h" #include "misc/json.h"
#include "misc/node.h" #include "misc/node.h"
+1 -1
View File
@@ -22,7 +22,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libmpv/client.h> #include <mpv/client.h>
// Stolen from osdep/compiler.h // Stolen from osdep/compiler.h
#ifdef __GNUC__ #ifdef __GNUC__
+1 -1
View File
@@ -28,7 +28,7 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <libmpv/client.h> #include <mpv/client.h>
// Stolen from osdep/compiler.h // Stolen from osdep/compiler.h
#ifdef __GNUC__ #ifdef __GNUC__
+1 -1
View File
@@ -3,7 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <libmpv/client.h> #include <mpv/client.h>
// detect enabled ASAN on gcc & clang // detect enabled ASAN on gcc & clang
#ifndef __SANITIZE_ADDRESS__ #ifndef __SANITIZE_ADDRESS__
+4 -5
View File
@@ -119,15 +119,15 @@ if get_option('libmpv')
file = join_paths(source_root, 'etc', 'mpv-icon-8bit-16x16.png') file = join_paths(source_root, 'etc', 'mpv-icon-8bit-16x16.png')
exe = executable('libmpv-test-file-loading', 'libmpv_test_file_loading.c', 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') test('libmpv-test-file-loading', exe, args: file, suite: 'libmpv')
exe = executable('libmpv-test-lavfi-complex', 'libmpv_test_lavfi_complex.c', 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') test('libmpv-test-lavfi-complex', exe, args: file, suite: 'libmpv')
exe = executable('libmpv-test-options', 'libmpv_test_options.c', 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') test('libmpv-test-options', exe, suite: 'libmpv')
# Old versions of ffmpeg are bugged when setting forced tracks and older # Old versions of ffmpeg are bugged when setting forced tracks and older
@@ -139,8 +139,7 @@ if get_option('libmpv')
endif endif
endif endif
exe = executable('libmpv-encode', 'libmpv_encode.c', exe = executable('libmpv-encode', 'libmpv_encode.c', dependencies: libmpv_dep)
include_directories: incdir, link_with: libmpv)
test('libmpv-encode', exe, suite: 'libmpv') test('libmpv-encode', exe, suite: 'libmpv')
mpvlib = libmpv mpvlib = libmpv
+1 -1
View File
@@ -65,7 +65,7 @@ foreach name, cmd: samples
env = name == 'locale.mkv' ? 'LANG=C' : [] env = name == 'locale.mkv' ? 'LANG=C' : []
testname = 'libmpv-test-' + name testname = 'libmpv-test-' + name
exe = executable(testname, '../libmpv_test_track_selection.c', 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()], test(testname, exe, args: [name, target.full_path()],
depends: target, env: env, suite: 'libmpv') depends: target, env: env, suite: 'libmpv')
endforeach endforeach
+1 -1
View File
@@ -1,7 +1,7 @@
#include "config.h" #include "config.h"
#include "hwdec.h" #include "hwdec.h"
#include "libmpv_gpu.h" #include "libmpv_gpu.h"
#include "libmpv/render_gl.h" #include "mpv/render_gl.h"
#include "video.h" #include "video.h"
#include "video/out/libmpv.h" #include "video/out/libmpv.h"
+1 -1
View File
@@ -28,7 +28,7 @@
#include "config.h" #include "config.h"
#include "libmpv/render_gl.h" #include "mpv/render_gl.h"
#include "options/m_config.h" #include "options/m_config.h"
#include "video/fmt-conversion.h" #include "video/fmt-conversion.h"
#include "video/out/drm_common.h" #include "video/out/drm_common.h"
+1 -1
View File
@@ -29,7 +29,7 @@
#include "video/hwdec.h" #include "video/hwdec.h"
#include "common/msg.h" #include "common/msg.h"
#include "options/m_config.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_atomic.h"
#include "video/out/drm_common.h" #include "video/out/drm_common.h"
#include "video/out/drm_prime.h" #include "video/out/drm_prime.h"
+1 -1
View File
@@ -33,7 +33,7 @@
#include "video/vaapi.h" #include "video/vaapi.h"
#if HAVE_VAAPI_DRM #if HAVE_VAAPI_DRM
#include "libmpv/render_gl.h" #include "mpv/render_gl.h"
#endif #endif
#if HAVE_VAAPI_X11 #if HAVE_VAAPI_X11
+1 -1
View File
@@ -2,7 +2,7 @@
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "libmpv/render.h" #include "mpv/render.h"
#include "vo.h" #include "vo.h"
// Helper for finding a parameter value. It returns the direct pointer to the // Helper for finding a parameter value. It returns the direct pointer to the
+1 -1
View File
@@ -1,4 +1,4 @@
#include "libmpv/render_gl.h" #include "mpv/render_gl.h"
#include "libmpv.h" #include "libmpv.h"
#include "sub/osd.h" #include "sub/osd.h"
#include "video/sws_utils.h" #include "video/sws_utils.h"
+1 -1
View File
@@ -28,7 +28,7 @@
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <drm_fourcc.h> #include <drm_fourcc.h>
#include "libmpv/render_gl.h" #include "mpv/render_gl.h"
#include "common/common.h" #include "common/common.h"
#include "osdep/timer.h" #include "osdep/timer.h"
#include "video/out/drm_atomic.h" #include "video/out/drm_atomic.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#include "context.h" #include "context.h"
#include "ra_gl.h" #include "ra_gl.h"
#include "options/m_config.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/libmpv_gpu.h"
#include "video/out/gpu/ra.h" #include "video/out/gpu/ra.h"
+1 -1
View File
@@ -26,7 +26,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include "libmpv/render_gl.h" #include "mpv/render_gl.h"
#include "video/out/drm_common.h" #include "video/out/drm_common.h"
#endif #endif
+1 -1
View File
@@ -18,7 +18,7 @@
#include <windows.h> #include <windows.h>
#include <string.h> #include <string.h>
#include "libmpv/client.h" #include "mpv/client.h"
#include "osdep/io.h" #include "osdep/io.h"
#include "mpv_talloc.h" #include "mpv_talloc.h"