This ensures a clear separation between public and private headers. It also makes it clear in Meson and prevents the accidental use of private headers.
Unified · Split
| @@ -2,14 +2,14 @@ EMBEDDING INTO OTHER PROGRAMS (LIBMPV) · 1 unmodified line | |||
| 2 | ====================================== | 2 | ====================================== |
| 3 | 3 | ||
| 4 | mpv can be embedded into other programs as video/audio playback backend. The | 4 | mpv can be embedded into other programs as video/audio playback backend. The |
| 5 | recommended way to do so is using libmpv. See ``mpv/client.h`` in the mpv | 5 | recommended way to do so is using libmpv. See ``include/mpv/client.h`` in the mpv |
| 6 | source code repository. This provides a C API. Bindings for other languages | 6 | source code repository. This provides a C API. Bindings for other languages |
| 7 | might be available (see wiki). | 7 | might be available (see wiki). |
| 8 | 8 | ||
| 9 | Since libmpv merely allows access to underlying mechanisms that can control | 9 | Since libmpv merely allows access to underlying mechanisms that can control |
| 10 | mpv, further documentation is spread over a few places: | 10 | mpv, further documentation is spread over a few places: |
| 11 | 11 | ||
| 12 | - https://github.com/mpv-player/mpv/blob/master/mpv/client.h | 12 | - https://github.com/mpv-player/mpv/blob/master/include/mpv/client.h |
| 13 | - https://mpv.io/manual/master/#options | 13 | - https://mpv.io/manual/master/#options |
| 14 | - https://mpv.io/manual/master/#list-of-input-commands | 14 | - https://mpv.io/manual/master/#list-of-input-commands |
| 15 | - https://mpv.io/manual/master/#properties | 15 | - https://mpv.io/manual/master/#properties |
| @@ -68,12 +68,12 @@ foreach cmd : ['file', '-config-file', '-input-conf'] · 67 unmodified lines | |||
| 68 | endforeach | 68 | endforeach |
| 69 | 69 | ||
| 70 | fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c', | 70 | fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c', |
| 71 | link_language: 'cpp', include_directories: incdir, | 71 | link_language: 'cpp', include_directories: incdir_public, |
| 72 | objects: libmpv.extract_all_objects(recursive: true), | 72 | objects: libmpv.extract_all_objects(recursive: true), |
| 73 | dependencies: dependencies) | 73 | dependencies: dependencies) |
| 74 | 74 | ||
| 75 | fuzzers += executable('fuzzer_json', 'fuzzer_json.c', | 75 | fuzzers += executable('fuzzer_json', 'fuzzer_json.c', |
| 76 | link_language: 'cpp', include_directories: incdir, | 76 | link_language: 'cpp', include_directories: [incdir, incdir_public], |
| 77 | objects: libmpv.extract_all_objects(recursive: true), | 77 | objects: libmpv.extract_all_objects(recursive: true), |
| 78 | dependencies: dependencies) | 78 | dependencies: dependencies) |
| 79 | 79 | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -1755,13 +1755,15 @@ if win32 · 1754 unmodified lines | |||
| 1755 | endif | 1755 | endif |
| 1756 | 1756 | ||
| 1757 | 1757 | ||
| 1758 | incdir_public = include_directories('./include') | ||
| 1758 | client_h_define = cc.get_define('MPV_CLIENT_API_VERSION', prefix: '#include "mpv/client.h"', | 1759 | client_h_define = cc.get_define('MPV_CLIENT_API_VERSION', prefix: '#include "mpv/client.h"', |
| 1759 | include_directories: include_directories('.')) | 1760 | include_directories: incdir_public) |
| 1760 | major = client_h_define.split('|')[0].split('<<')[0].strip('() ') | 1761 | major = client_h_define.split('|')[0].split('<<')[0].strip('() ') |
| 1761 | minor = client_h_define.split('|')[1].strip('() ') | 1762 | minor = client_h_define.split('|')[1].strip('() ') |
| 1762 | client_api_version = major + '.' + minor + '.0' | 1763 | client_api_version = major + '.' + minor + '.0' |
| 1763 | 1764 | ||
| 1764 | libmpv = library('mpv', sources, dependencies: dependencies, gnu_symbol_visibility: 'hidden', | 1765 | libmpv = library('mpv', sources, dependencies: dependencies, gnu_symbol_visibility: 'hidden', |
| 1766 | include_directories: incdir_public, | ||
| 1765 | link_args: cc.get_supported_link_arguments(['-Wl,-Bsymbolic']), | 1767 | link_args: cc.get_supported_link_arguments(['-Wl,-Bsymbolic']), |
| 1766 | version: client_api_version, install: get_option('libmpv'), | 1768 | version: client_api_version, install: get_option('libmpv'), |
| 1767 | build_by_default: get_option('libmpv')) | 1769 | build_by_default: get_option('libmpv')) |
| @@ -1772,12 +1774,12 @@ if get_option('libmpv') · 4 unmodified lines | |||
| 1772 | pkg.generate(libmpv, version: client_api_version, | 1774 | pkg.generate(libmpv, version: client_api_version, |
| 1773 | description: 'mpv media player client library') | 1775 | description: 'mpv media player client library') |
| 1774 | 1776 | ||
| 1775 | headers = ['mpv/client.h', 'mpv/render.h', | 1777 | headers = ['include/mpv/client.h', 'include/mpv/render.h', |
| 1776 | 'mpv/render_gl.h', 'mpv/stream_cb.h'] | 1778 | 'include/mpv/render_gl.h', 'include/mpv/stream_cb.h'] |
| 1777 | install_headers(headers, subdir: 'mpv') | 1779 | install_headers(headers, subdir: 'mpv') |
| 1778 | 1780 | ||
| 1779 | # Allow projects to build with libmpv by cloning into ./subprojects/mpv | 1781 | # Allow projects to build with libmpv by cloning into ./subprojects/mpv |
| 1780 | libmpv_dep = declare_dependency(include_directories: '.', link_with: libmpv) | 1782 | libmpv_dep = declare_dependency(include_directories: incdir_public, link_with: libmpv) |
| 1781 | meson.override_dependency('mpv', libmpv_dep) | 1783 | meson.override_dependency('mpv', libmpv_dep) |
| 1782 | endif | 1784 | endif |
| 1783 | 1785 | ||
| @@ -29,7 +29,7 @@ swift_flags += extra_flags · 28 unmodified lines | |||
| 29 | swift_compile = [swift_prog, swift_flags, '-module-name', 'swift', | 29 | swift_compile = [swift_prog, swift_flags, '-module-name', 'swift', |
| 30 | '-emit-module-path', '@OUTPUT0@', '-import-objc-header', bridge, | 30 | '-emit-module-path', '@OUTPUT0@', '-import-objc-header', bridge, |
| 31 | '-emit-objc-header-path', '@OUTPUT1@', '-o', '@OUTPUT2@', | 31 | '-emit-objc-header-path', '@OUTPUT1@', '-o', '@OUTPUT2@', |
| 32 | '@INPUT@', '-I.', '-I' + source_root, | 32 | '@INPUT@', '-I.', '-I' + source_root, '-I' + source_root / 'include', |
| 33 | '-I' + libplacebo.get_variable('includedir', | 33 | '-I' + libplacebo.get_variable('includedir', |
| 34 | default_value: source_root / 'subprojects' / 'libplacebo' / 'src' / 'include'), | 34 | default_value: source_root / 'subprojects' / 'libplacebo' / 'src' / 'include'), |
| 35 | '-I' + libavutil.get_variable('includedir')] | 35 | '-I' + libavutil.get_variable('includedir')] |
| @@ -90,7 +90,7 @@ gl_video = executable('gl-video', 'gl_video.c', objects: gl_video_objects, · 89 unmodified lines | |||
| 90 | link_with: [img_utils, test_utils]) | 90 | link_with: [img_utils, test_utils]) |
| 91 | test('gl-video', gl_video) | 91 | test('gl-video', gl_video) |
| 92 | 92 | ||
| 93 | json = executable('json', 'json.c', include_directories: incdir, link_with: test_utils) | 93 | json = executable('json', 'json.c', include_directories: [incdir, incdir_public], link_with: test_utils) |
| 94 | test('json', json) | 94 | test('json', json) |
| 95 | 95 | ||
| 96 | linked_list = executable('linked-list', files('linked_list.c'), include_directories: incdir) | 96 | linked_list = executable('linked-list', files('linked_list.c'), include_directories: incdir) |
| @@ -150,7 +150,7 @@ if get_option('libmpv') · 53 unmodified lines | |||
| 150 | endif | 150 | endif |
| 151 | if shared | 151 | if shared |
| 152 | exe = executable('libmpv-lifetime', sources: 'libmpv_lifetime.c', | 152 | exe = executable('libmpv-lifetime', sources: 'libmpv_lifetime.c', |
| 153 | include_directories: incdir) | 153 | include_directories: incdir_public) |
| 154 | test('libmpv-lifetime', exe, depends: mpvlib, suite: 'libmpv') | 154 | test('libmpv-lifetime', exe, depends: mpvlib, suite: 'libmpv') |
| 155 | endif | 155 | endif |
| 156 | endif | 156 | endif |