Commit Graph

8181 Commits

Author SHA1 Message Date
Steve Lhomme 4c387460c9 vlc_cpu: include vlc_threads.h when using vlc_once_t 2023-04-27 19:44:35 +00:00
Steve Lhomme d56977a05a vlc_tracer: include vlc_threads.h when calling vlc_tick_now() 2023-04-27 19:44:35 +00:00
Steve Lhomme 0a10f3e4a2 include: include vlc_threads.h when vlc_mutex_t is used 2023-04-27 19:44:35 +00:00
Johannes Kauffmann 8dc0ae1205 Remove extra semicolons around vlc_module macro's 2023-04-27 06:24:26 +00:00
Steve Lhomme 2c9263067d vlc_common: don't include vlc_tick.h anymore
We don't use a vlc_tick.h in this file.
2023-04-25 09:29:52 +02:00
Steve Lhomme eb6fde31a5 include: include vlc_tick.h when using vlc_tick_t 2023-04-25 09:29:52 +02:00
Loïc Branstett 15bb301fb5 es_out: add more convenience methods 2023-04-22 14:40:13 +00:00
Steve Lhomme b437cad568 vlc_plugin: make header standalone
This can be useful for code that generates static symbols.
We don't need to include `vlc_common.h` anymore.
2023-04-20 15:55:41 +00:00
Steve Lhomme 1b834066f3 vlc_fixups: don't include system headers with forced extern "C" 2023-04-20 13:43:09 +00:00
Steve Lhomme daf9ecb7c2 vlc_picture: don't force extern C on other headers
They might define some C++ code.
2023-04-20 13:43:09 +00:00
Steve Lhomme ed2736b8e7 vlc_sout: don't force extern C on other headers
They might define some C++ code.
2023-04-20 13:43:09 +00:00
Steve Lhomme ea197ba0dd vlc_fixups: don't force __STDC_*_MACROS on mingw-w64
__STDC_FORMAT_MACROS has no effect
__STDC_CONSTANT_MACROS and __STDC_LIMIT_MACROS are already set when
compiling for C++11 since mingw-w64 4.0.1
2023-04-08 06:30:16 +00:00
Steve Lhomme d91e21aec0 compat: always use _aligned_malloc/_aligned_free on Windows
We don't need the mingw custom code. It's available in msvcrt.dll and UCRT. It's better
to use the same code between mingw and MSVC builds.
2023-04-06 17:12:47 +00:00
Tristan Matthews b710e79282 fourcc: add QOI
QOI - The “Quite OK Image Format” for fast, lossless image compression

See:
https://github.com/phoboslab/qoi
2023-04-05 09:51:06 -04:00
Rémi Denis-Courmont b98765d56c frame: add vlc_frame_New() 2023-04-04 12:03:15 +00:00
Thomas Guillem bc056eb480 core: expose vlc_preparser API 2023-04-04 07:39:58 +00:00
Thomas Guillem 9c3caa7b3e preparser: improve documentation 2023-04-04 07:39:58 +00:00
Thomas Guillem 3d526a6aa8 core: move preparser.h into vlc_preparser.h 2023-04-04 07:39:58 +00:00
Thomas Guillem d59a512740 core: rename input_preparser to vlc_preparser
and input_preparser_callbacks_t to struct vlc_metadata_cbs
2023-04-04 07:39:58 +00:00
Thomas Guillem 538fcb208b core: remove libvlc_ArtRequest() 2023-04-04 07:39:58 +00:00
Thomas Guillem 8638652ac1 preparser: notify if an art was fetched 2023-04-04 07:39:58 +00:00
Thomas Guillem 413239530a lib: move libvlc_media_ no_skip to parse_forced 2023-04-04 07:39:58 +00:00
Thomas Guillem 5a6942ebe9 input_item: move META_REQUEST_OPTION NO_SKIP to SCOPE_FORCED
SCOPE_* enums are for the preparser (not for the fetcher) and this
option only touches the preparser.
2023-04-04 07:39:58 +00:00
Thomas Guillem 5d2278c406 input_item: avoid constant use in input_item_meta_request_option_t 2023-04-04 07:39:58 +00:00
Thomas Guillem a82b097615 lib: set libvlc_media_parse_local > 0
This will allow to use the preparser to only fetch metadata.
2023-04-04 07:39:58 +00:00
Maxim Biro faf8b85ac3 plugin: add HTML help
HTML help that is shown instead of the plain help text where appropriate
and supported by the interface. The command-line help output and the Qt
GUI plugin tooltips show the plain help text, while the Qt GUI plugin
preferences page displays the HTML help, if available, falling back to
displaying the plain help otherwise.

Allows to present the help text in a more structured and expressive way.
Also useful for out-of-tree plugins, in case they want to link to
plugin's home page, bug tracker, donation page, etc.

For the supported HTML subset, see
https://doc.qt.io/qt-6/richtext-html-subset.html

Fixes #27798
2023-03-27 12:11:10 +00:00
Thomas Guillem 817edbb116 lib: return the same object in libvlc_media_player_list_retain() 2023-03-24 12:42:38 +00:00
Thomas Guillem 098855b2b5 lib: return the same object in libvlc_media_player_retain() 2023-03-24 12:42:38 +00:00
Thomas Guillem 2ad8ef54bb lib: return the same object in libvlc_media_list_retain() 2023-03-24 12:42:38 +00:00
Thomas Guillem d5b7878397 lib: return the same object in libvlc_media_retain() 2023-03-24 12:42:38 +00:00
Thomas Guillem e793a3247b lib: return the same object in libvlc_retain() 2023-03-24 12:42:38 +00:00
Thomas Guillem 448e8b92d2 lib: return the same object in libvlc_picture_retain() 2023-03-24 12:42:38 +00:00
Loïc Branstett f93de3ef23 stream/demux: move remaining callbacks to their respective ops struct
This commit moves the remaining callbacks of stream/demux: pf_read/
pf_block/pf_seek/pf_readdir and pf_demux into their operations table,
aiming at unifying all the callbacks under a unique place.
This is a follow-up to the introduction of typed controls callbacks
for stream and demux.

Like for the typed controls callbacks if no operation is provided
(ie, stream_t/demux_t.ops is NULL) by a module, the legacy pf_* will be
used instead as a fallback.

The commit doesn't migrate any of modules yet.
2023-03-24 10:51:36 +00:00
Alexandre Janniaux 5f000b2872 vlc_decoder.h: document vlc_input_decoder_Delete
Add documentation for the vlc_input_decoder_Delete function to enforce
usage of vlc_input_decoder_Flush or vlc_input_decoder_Drain before
destruction.
2023-03-24 06:35:39 +00:00
Thomas Guillem 90e98b012e vlc_queue: fix restrict violation
`restrict` tells the compiler that the tombstone pointer is the only way
to access the variable pointed by it. This is not case with multi-threading.

From the C11 specs:

§ 6.7.3 item 8
    An object that is accessed through a restrict-qualified pointer has
    a special association with that pointer. This association, defined
    in 6.7.3.1 below, requires that all accesses to that object use,
    directly or indirectly, the value of that particular pointer.

§ 6.7.3.1 item 4
    Every other lvalue used to access the value of X shall also have its
    address based on P.

Also set the pointer to const.

Fixes the following race condition when closing live555:

Thread 80 (Thread 28393.4880):
0  0x0000007953dbebbc in syscall () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
1  0x0000007855d2c0ec in sys_futex (addr=0x89, op=137, val=0, to=0x0, addr2=0x0, val3=-1) at ../../src/linux/thread.c:82
2  vlc_futex_wait (addr=0x89, flags=0, val=0, to=0x0) at ../../src/linux/thread.c:93
3  vlc_atomic_wait (addr=0x89, val=0) at ../../src/linux/thread.c:109
4  0x0000007855d20e9c in vlc_cond_wait (cond=cond@entry=0x7829f26ce8, mutex=mutex@entry=0x7829f26cd8) at ../../src/misc/threads.c:298
5  0x0000007855d42244 in vlc_queue_Wait (q=0x7829f26cc0) at ../../include/vlc_queue.h:122
6  vlc_queue_DequeueKillable (q=0x7829f26cc0, tombstone=0x7829f26d00) at ../../include/vlc_queue.h:248
7  vlc_stream_fifo_Block (s=<optimized out>, eof=0x78709a8838) at ../../src/input/stream_fifo.c:75
8  0x0000007855cfa160 in vlc_stream_ReadRaw (s=s@entry=0x7819411360, buf=buf@entry=0x78c4393c80, len=len@entry=188) at ../../src/input/stream.c:466
9  0x0000007855cf9fe0 in vlc_stream_ReadPartial (s=s@entry=0x7819411360, buf=buf@entry=0x78c4393c80, len=len@entry=188) at ../../src/input/stream.c:489
10 0x0000007855cfad44 in vlc_stream_Read (s=<optimized out>, buf=0x78c4393c80, len=188) at ../../src/input/stream.c:504
11 vlc_stream_Block (s=0x7819411360, size=<optimized out>) at ../../src/input/stream.c:909
12 0x0000007855f1fe5c in ReadTSPacket (p_demux=p_demux@entry=0x78c42c0ce0) at ../../modules/demux/mpeg/ts.c:1808
13 0x0000007855f1de30 in Demux (p_demux=<optimized out>) at ../../modules/demux/mpeg/ts.c:649
4 0x0000007855d41e4c in vlc_demux_chained_Thread (data=0x7829f26c70) at ../../src/input/demux_chained.c:96
15 0x0000007855d2d5b8 in joinable_thread (data=0x7823341ea0) at ../../src/android/thread.c:96
16 0x0000007953e217c4 in __pthread_start(void*) () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
17 0x0000007953dc41ac in __start_thread () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so

Thread 79 (Thread 28393.4875):
0  0x0000007953dbebbc in syscall () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
1  0x0000007953e21d98 in pthread_join () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
2  0x0000007855d2d204 in vlc_join (handle=0x7823341ea0, result=0x0) at ../../src/android/thread.c:147
3  0x0000007855d4202c in vlc_demux_chained_Delete (dc=0x7829f26c70) at ../../src/input/demux_chained.c:167
4  0x0000007855d3d92c in Close (p_this=<optimized out>) at ../../modules/access/live555.cpp:505
5  0x0000007855cb49dc in module_unneed (obj=obj@entry=0x78194110c0, module=0x78c83b0520) at ../../src/modules/modules.c:305
6  0x0000007855ceae78 in vlc_access_Destroy (access=0x78194110c0) at ../../src/input/access.c:54
7  0x0000007855cf958c in vlc_stream_Delete (s=0x78194110c0) at ../../src/input/stream.c:150
8  0x0000007855ce4954 in demux_Delete (demux=0x78709a8d60) at ../../include/vlc_demux.h:291
9  InputSourceDestroy (in=0x781a3aa780) at ../../src/input/input.c:2852
10 0x0000007855ce39f0 in End (p_input=p_input@entry=0x7863073c00) at ../../src/input/input.c:1413
11 0x0000007855ce0620 in Run (data=0x7863073c00) at ../../src/input/input.c:431
12 0x0000007855d2d5b8 in joinable_thread (data=0x78231b02c0) at ../../src/android/thread.c:96
13 0x0000007953e217c4 in __pthread_start(void*) () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
14 0x0000007953dc41ac in __start_thread () from /home/tom/work/git/libvlcjni/libvlc/.gdb/obj/local/arm64-v8a/system/lib64/libc.so
2023-03-17 08:10:38 +00:00
Loïc bdc6edb1e0 demux: add more helper methods
This commit adds more helper methods for demux_t.
2023-03-16 14:20:37 +00:00
Loïc 2a4957c0f8 demux: introduce typed operations for demux
This commit introduce a typed virtual table for operations on demux,
aiming at replacing the legacy pf_control() callback which is using
va_list. As a counterpart to the typed virtual table, typed methods
are also introduce.

The operations can be implemented by the modules directly right now
and will be used when possible. This is done to provide type safety
at every level.

When no operation is provided (ie, demux_t.ops is NULL) by a module
implementation, the legacy pf_control will be used instead as a
fallback.

The commit doesn't migrate any of modules yet.
2023-03-16 14:20:37 +00:00
Loïc 6baee5a410 stream: move get_title typed control to stream specific section 2023-03-16 14:20:37 +00:00
Loïc 21f9f3818c stream: move get_seekpoint typed control to specific stream section
This is done because the type is different from stream and demux.
2023-03-16 14:20:37 +00:00
Steve Lhomme 586e1cbafe libvlc: use the local includes in vlc.h
Do not allow messing with the include path and end up using other
includes.

Any C compiler should respect the "" meaning including local files
before looking in other pathes.
2023-03-14 09:53:54 +00:00
Loïc f77921f427 stream: introduce typed operations for stream
This commit introduce a typed virtual table for operations on stream,
aiming at replacing the legacy pf_control() callback which is using
va_list. As a counterpart to the typed virtual table, typed methods
are also introduce.

The operations can be implemented by the modules directly right now
and will be used when possible. This is done to provide type safety
at every level.

When no operation is provided (ie, stream_t.ops is NULL) by a module
implementation, the legacy pf_control will be used instead as a
fallback.

The commit doesn't migrate any of access/stream_filter/… modules yet.
The commit also doesn't introduce the demux specific callbacks yet.
2023-03-11 18:01:48 +00:00
KO Myung-Hun c4a656a7b0 vlc_fixups: define IN6ADDR_ANY_INIT on OS/2 2023-03-09 07:11:12 +00:00
KO Myung-Hun 3fb02c602d vlc_fixups: define static_assert on OS/2 2023-03-09 07:11:12 +00:00
KO Myung-Hun 4baa00c9d7 vlc_fixups: include sys/socket.h on OS/2 LIBCn
LIBCn is a fork of kLIBC, and it has socklen_t in sys/socket.h.
2023-03-09 07:11:12 +00:00
Thomas Guillem e46dcf5b35 window: android: specify the surface id
This will allow to use EGL on the subtitle surface.

No functional changes.
2023-03-07 10:27:37 +00:00
Steve Lhomme 0afcc30adb vlc_plugin: add a macro to declare module entries
This is the same type as vlc_plugin_cb but declaring a variable with a function
type and declaring and actual function is not the same.
2023-03-07 08:23:15 +00:00
Steve Lhomme b7340959b4 vlc_plugin: add macros to define custom entry points
This is usually the way tests with modules do it.
2023-03-07 08:23:15 +00:00
Thomas Guillem 9155b08930 opengl: add an alpha config to the activate cb 2023-03-05 14:48:33 +00:00
Thomas Guillem 09d8638e7f opengl: ensure the activate cb use the correct type 2023-03-05 14:48:33 +00:00
Thomas Guillem 2c1b88a8ca opengl: expose the activate function 2023-03-05 14:48:33 +00:00