History

include: move public headers to own directory

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.

Kacper Michajłow committed 1 year ago

Commit f1e1a0b1 parent d759e269 files · +13 −11Browse files

Unified · Split

9 files
  1. DOCS/man/libmpv.rst +2 −2
  2. fuzzers/meson.build +2 −2
  3. include/mpv/client.h +0 −0
  4. include/mpv/render.h +0 −0
  5. include/mpv/render_gl.h +0 −0
  6. include/mpv/stream_cb.h +0 −0
  7. meson.build +6 −4
  8. osdep/mac/meson.build +1 −1
  9. test/meson.build +2 −2
DOCS/man/libmpv.rst+2−2
@@ -2,14 +2,14 @@ EMBEDDING INTO OTHER PROGRAMS (LIBMPV) · 1 unmodified line
2======================================2======================================
3 3
4mpv can be embedded into other programs as video/audio playback backend. The4mpv can be embedded into other programs as video/audio playback backend. The
5recommended way to do so is using libmpv. See ``mpv/client.h`` in the mpv5recommended way to do so is using libmpv. See ``include/mpv/client.h`` in the mpv
6source code repository. This provides a C API. Bindings for other languages6source code repository. This provides a C API. Bindings for other languages
7might be available (see wiki).7might be available (see wiki).
8 8
9Since libmpv merely allows access to underlying mechanisms that can control9Since libmpv merely allows access to underlying mechanisms that can control
10mpv, further documentation is spread over a few places:10mpv, further documentation is spread over a few places:
11 11
12- https://github.com/mpv-player/mpv/blob/master/mpv/client.h12- https://github.com/mpv-player/mpv/blob/master/include/mpv/client.h
13- https://mpv.io/manual/master/#options13- https://mpv.io/manual/master/#options
14- https://mpv.io/manual/master/#list-of-input-commands14- https://mpv.io/manual/master/#list-of-input-commands
15- https://mpv.io/manual/master/#properties15- https://mpv.io/manual/master/#properties
fuzzers/meson.build+2−2
@@ -68,12 +68,12 @@ foreach cmd : ['file', '-config-file', '-input-conf'] · 67 unmodified lines
68endforeach68endforeach
69 69
70fuzzers += executable('fuzzer_options_parser', 'fuzzer_options_parser.c',70fuzzers += 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
75fuzzers += executable('fuzzer_json', 'fuzzer_json.c',75fuzzers += 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
include/mpv/client.hrenamed from mpv/client.h+0−0

File renamed without changes.

include/mpv/render.hrenamed from mpv/render.h+0−0

File renamed without changes.

include/mpv/render_gl.hrenamed from mpv/render_gl.h+0−0

File renamed without changes.

include/mpv/stream_cb.hrenamed from mpv/stream_cb.h+0−0

File renamed without changes.

meson.build+6−4
@@ -1755,13 +1755,15 @@ if win32 · 1754 unmodified lines
1755endif1755endif
1756 1756
1757 1757
1758incdir_public = include_directories('./include')
1758client_h_define = cc.get_define('MPV_CLIENT_API_VERSION', prefix: '#include "mpv/client.h"',1759client_h_define = cc.get_define('MPV_CLIENT_API_VERSION', prefix: '#include "mpv/client.h"',
1759 include_directories: include_directories('.'))1760 include_directories: incdir_public)
1760major = client_h_define.split('|')[0].split('<<')[0].strip('() ')1761major = client_h_define.split('|')[0].split('<<')[0].strip('() ')
1761minor = client_h_define.split('|')[1].strip('() ')1762minor = client_h_define.split('|')[1].strip('() ')
1762client_api_version = major + '.' + minor + '.0'1763client_api_version = major + '.' + minor + '.0'
1763 1764
1764libmpv = library('mpv', sources, dependencies: dependencies, gnu_symbol_visibility: 'hidden',1765libmpv = 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/mpv1781 # 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)
1782endif1784endif
1783 1785
osdep/mac/meson.build+1−1
@@ -29,7 +29,7 @@ swift_flags += extra_flags · 28 unmodified lines
29swift_compile = [swift_prog, swift_flags, '-module-name', 'swift',29swift_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')]
test/meson.build+2−2
@@ -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])
91test('gl-video', gl_video)91test('gl-video', gl_video)
92 92
93json = executable('json', 'json.c', include_directories: incdir, link_with: test_utils)93json = executable('json', 'json.c', include_directories: [incdir, incdir_public], link_with: test_utils)
94test('json', json)94test('json', json)
95 95
96linked_list = executable('linked-list', files('linked_list.c'), include_directories: incdir)96linked_list = executable('linked-list', files('linked_list.c'), include_directories: incdir)
@@ -150,7 +150,7 @@ if get_option('libmpv') · 53 unmodified lines
150 endif150 endif
151 if shared151 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 endif155 endif
156endif156endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t