1
mirror of https://code.videolan.org/videolan/vlc synced 2024-09-12 13:44:56 +02:00
Commit Graph

498 Commits

Author SHA1 Message Date
Filip Roséen
a1963944d4 lib/media_discoverer: libvlc_media_discoverer_release: simplify
Instead of getting all the dictionary keys, and iterating over them to
get the associated values, only to free/release the associated data;
use vlc_dictionary_clear together with a callback to handle the work
for us.

These changes also fixes a potential null-pointer dereference if the
previous usage of vlc_dictionary_all_keys failed.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2017-05-18 19:05:59 +03:00
Rémi Denis-Courmont
ada216c148 lib: use sub-item tree event rather than item event 2017-05-18 18:19:51 +03:00
Rémi Denis-Courmont
b50d5f3131 lib: event: remove new/release functions 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
7741bf6dec lib: vlm: pass a non-NULL pointer as event object
(It is a useless value though.)
2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
a7de129d41 lib: vlm: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
72b3f02398 lib: vlm: privatize libvlc_vlm_t 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
5ede6b918f lib: vlm: do not allocate inside the instance 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
9f7f67434b lib: vlm: inline one function 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
8f67aeff0f lib: renderer_discoverer: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
65321da121 lib: media_player: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
7395282cd8 lib: media_list_player: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
3b31041cb7 lib: media_list: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
91e8335efc lib: media_library: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
f5ae20095a lib: media_discoverer: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
db28adc700 lib: media: allocate event manager in-place 2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
d241be435f lib: add libvlc_event_manager_(init|destroy) functions
They permit in-place event managers, simplifying the code.
2017-05-15 21:33:39 +03:00
Rémi Denis-Courmont
c91959027c rd: simplify events handling
Use fixed owner structure instead of deprecated VLC events.
2017-05-15 21:33:36 +03:00
Rémi Denis-Courmont
0303cb6b28 rd: remove reference counting
Like SD, and in fact most VLC object types, RD is not meant for objects
shared by multiple threads (input, vout, aout...). Using a custom
release makes no sense here.
2017-05-15 19:43:47 +03:00
Rémi Denis-Courmont
a995ddeef7 sd: add proper item tree support
This adds explicit tree support to the SD callback and the
corresponding playlist back-end.
2017-05-14 18:44:13 +03:00
Rémi Denis-Courmont
f4bb458815 Replace vlc_gc_decref() with input_item_Release() 2017-04-09 17:28:19 +03:00
Rémi Denis-Courmont
763cea5e20 Replace vlc_gc_incref() with input_item_Hold() 2017-04-09 17:28:19 +03:00
Thomas Guillem
4eda9aa084 libvlc: fix MediaPlayerESSelected events not sent
This event was sent only when an ES was changed by libvlc. It was not sent when
an ES was changed by the input thread. To fix this issue, listen to the
INPUT_EVENT_ES input event (that is sent when an ES is added/deleted/selected)
to detect an ES selection change.

We don't want to trigger callbacks for "video-es"/"audio-es"/"spu-es" variables
from the input_thread since it's also listening to these callbacks and we want
to avoid a selecting busy loop.
2017-04-03 12:02:07 +02:00
Thomas Guillem
72a00334d7 Revert "lib/video: set "video" prop to true when changing video tracks"
This reverts commit 3add837059.

This commit was incomplete (missing audio/spu support) and is now done in vlc
core. See 8bc1b9ff8747be1b87730bea14a1b3778aed0bd6.
2017-03-28 14:24:33 +02:00
Thomas Guillem
76c74ca0cf libvlc: libvlc_video_set_teletext(0) to disable teletext
Since 0 is an invalid page for the zvbi plugin.

libvlc_video_get_teletext() will now return 0 if teletext is disabled. The
teletext was already disabled by default, and libvlc_video_get_teletext() could
be misleading since it returned 100 by default.
2017-03-27 14:43:35 +02:00
Thomas Guillem
0ee22e970d libvlc: libvlc_video_set_teletext can send keys 2017-03-27 14:41:44 +02:00
Filip Roséen
37205f4443 lib/media_player: libvlc_get_track_description: simplify allocations
There is no need for the explicit cast, nor do we need to state the
name of the object's type for which we are allocating memory. These
changes should make it easier to read, and maintain, the function.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2017-03-17 09:07:22 +01:00
Filip Roséen
59bc6a45d6 lib/media_player: libvlc_get_track_description: fix return-value on error
p_track_description is returned when goto end is executed, meaning
that we would return a non-NULL value that has already been released
by the call to libvlc_track_description_list_release.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2017-03-17 09:07:14 +01:00
Thomas Guillem
8714fccc49 lib/video: toggle teletext from libvlc_video_set_teletext
If the page is in the range [0; 1000[ the teletext spu will be enabled. If the
page is -1, the teletext spu will be disabled. Otherwise do nothing and print
an error.
2017-03-14 17:29:48 +01:00
Thomas Guillem
d05d123fc9 lib/video: refactor teletext activation 2017-03-14 16:49:08 +01:00
Thomas Guillem
15dc321efb lib/video: fix video filters not set when there is no vout
Set the video filter variable to the media_player, the vout will inherit from
it.

Fix #17761
2017-03-14 15:10:23 +01:00
Thomas Guillem
39ed50a2e1 lib/video: use a vlc_object_t to enable vout filters
Ref #17761
2017-03-14 14:38:25 +01:00
Thomas Guillem
78018b3602 lib/video: remove unused variable
configs are generally not written from libvlc.

Ref #17761
2017-03-14 14:38:25 +01:00
Thomas Guillem
30a61d4fff vout: move and hide vout_EnableFilter()
Since it's only used by lib/video.c.

Ref #17761
2017-03-14 14:38:20 +01:00
Thomas Guillem
bf9ef35ea1 lib/video: fix invalid id in input_GetEsObjects
This fixes a SEGFAULT when calling libvlc_video_set_teletext when there is no
teletext-es.

Fixes #11854
2017-03-14 10:56:44 +01:00
Marvin Scholz
2b5baef57f macOS buildsystem: Adjust rpath and install_name 2017-02-27 17:15:36 +01:00
Rémi Denis-Courmont
21a746d43c lib: remove redundant test
If index < 0, then (size_t) index > SSIZE_MAX.
2017-02-23 21:10:17 +02:00
Thomas Guillem
10d5d4f28a lib/media_list: fix sign warnings 2017-02-23 19:55:04 +01:00
Rémi Denis-Courmont
7ecd9271af array: fix up types in vlc_array_*()
- use size_t, ssize_t,
 - handle const types where applicable.
2017-02-19 22:58:43 +02:00
Thomas Guillem
49c6f6f416 lib/media_player: use default deinterlace values
Inherit "deinterlace" and "deinterlace-mode" values from libvlc (values are set
from libvlc-module.c).

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-02-08 15:12:12 +01:00
Hugo Beauzée-Luyssen
49fe7a9f2c lib: Remove outdated comment
Fix #2602
2017-02-05 14:57:25 +01:00
Hugo Beauzée-Luyssen
791c620e85 lib: media: Fix memory leak on error case.
Always initialize ppp_slaves and always free it, to avoid leaking
pp_slaves when the first p_slave allocation fails
Fix CID #1372940
2017-01-18 16:01:20 +01:00
Thomas Guillem
5172aa6620 libvlc: video: fix viewpoint update when there is no input thread 2016-12-01 17:56:07 +01:00
Thomas Guillem
38aca24fb0 libvlc: media: add projection in libvlc_video_track_t 2016-11-28 16:36:44 +01:00
Thomas Guillem
08670a3de2 libvlc: media: add orientation in libvlc_video_track_t 2016-11-28 16:36:44 +01:00
Adrien Maglo
24dddc303d core: remove the 360 video viewpoint zoom
The functionality is provided by the fov parameter.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2016-11-25 10:55:29 +01:00
Thomas Guillem
f4ea7434d2 libvlc: add f_zoom in libvlc_video_viewpoint_t 2016-11-17 09:47:45 +01:00
Rémi Denis-Courmont
747a44649f sd: remove services_discovery_GetLocalizedName() 2016-11-15 20:01:58 +02:00
Steve Lhomme
e23cb34d2c libvlc: add the API needed to update the viewpoint in 360° videos
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2016-11-15 18:13:46 +01:00
Rémi Denis-Courmont
6d37075224 sd: merge Create and Start, and Stop and Destroy
Without the legacy event handler, the distinction is superfluous.
2016-11-14 22:01:27 +02:00
Rémi Denis-Courmont
f7ff969d3b sd: use owner structure instead of legacy event manager
Since there are always exactly one callback per event (the owner´s),
this is much simpler. This also removes unhandled error cases, and
provides more straightforward callback prototypes.
2016-11-14 21:50:40 +02:00
Rémi Denis-Courmont
74acdbca75 sd: remove RemoveAll events
This was never triggered.
2016-11-14 20:35:57 +02:00
Rémi Denis-Courmont
05105392b3 lib: leave the "crop" variable choices as they are
There is no longer a need to override it, since unlisted values are now
permitted for variables.
2016-10-22 17:54:45 +03:00
Filip Roséen
f56e56f70a lib/vlm: narrow scope of variables used in loop
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
5fb90b6f9a lib/vlm.c: remove trailing whitespace
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
f81f796695 lib/media_list_path: remove trailing whitespace
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
6e9fba8cfc lib/media_list_path: narrow scope of iteration variables
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
66f9791007 lib/media_list: narrow scope of variable used in loop
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
6727d54819 lib/media_list: simplify libvlc_media_list_index_of_item
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
ec1bc03c41 lib/media_list: narrow scope of iteration variable
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
3e36a9d045 lib/media_list: narrow scope of iteration variables
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Filip Roséen
2c557116ca lib/media_discovery: narrower scope of iteration variable
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-13 11:09:29 +02:00
Thomas Guillem
8a449a61c5 libvlc: add libvlc_media_parse_stop 2016-10-12 14:10:31 +02:00
Thomas Guillem
5be7804abb libvlc/media_player: don't truncate buffering decimals 2016-10-06 14:50:18 +02:00
Thomas Guillem
365a0496d9 libvlc/media_player: fix warnings 2016-10-06 14:22:49 +02:00
Thomas Guillem
e1ef49765d libvlc: renderer_discoverer: remove usage of ssize_t
It's in POSIX but not in C standard.
2016-09-27 13:47:24 +02:00
Thomas Guillem
4bcaa27319 libvlc: media_discoverer: remove usage of ssize_t
It's in POSIX but not in C standard.
2016-09-27 13:47:24 +02:00
Thomas Guillem
b5cb4dadf8 libvlc: fix leaks if init fails 2016-09-20 17:10:17 +02:00
Thomas Guillem
08943f4214 libvlc: add libvlc_media_player_set_renderer 2016-09-20 11:06:51 +02:00
Thomas Guillem
5f3abe14ea libvlc: add renderer_discoverer external API 2016-09-20 11:06:51 +02:00
Rémi Denis-Courmont
0c3f29264f video_filters: drop version number from capability
(This fixes the transcode module video filter option in preferences, as
the two was forgotten.)
2016-08-29 17:20:15 +03:00
Thomas Guillem
a19fe33c97 libvlc_media_list_player: fix invalid use of path
The path variable (or current_playing_item_path) can be modified or freed from
an other thread.

Fixes #17312
2016-08-22 17:23:40 +02:00
Thomas Guillem
b0984a632f libvlc: add missing "_t" in media_discoverer structs/enums
For the sake of coherence.
2016-07-20 13:44:12 +02:00
Thomas Guillem
74f3deabb4 libvlc: use ssize_t/size_t for the count of the media discoverer list 2016-07-20 13:23:55 +02:00
Rémi Denis-Courmont
c240692f0b Common structure for VLC common object members, document 2016-06-18 18:01:32 +03:00
Hugo Beauzée-Luyssen
cc072d468b libvlc: media: Fix inverted parameters 2016-06-17 14:18:20 +02:00
Thomas Guillem
d32fd68422 lib: media_discoverer: release list after stop
since stop() can use the list to send events.
2016-06-13 13:25:43 +02:00
Thomas Guillem
94a2193589 lib: media_discoverer: stop after sending events 2016-06-13 13:25:00 +02:00
Thomas Guillem
42f6419ab0 lib: media_discoverer: don't listen to Started/Ended events
These events are useless and are only triggered when calling vlc_sd_Start() and
vlc_sd_Stop().
2016-06-10 14:39:06 +02:00
Thomas Guillem
b33cc0bb2b lib: media: fix item leak from libvlc_media_new_as_node 2016-06-10 14:39:06 +02:00
Thomas Guillem
463b4aa9b2 lib: media_discoverer: fix media leak 2016-06-10 14:39:06 +02:00
Thomas Guillem
09f8d87f47 media_discoverer: fix memory corruption when listing services 2016-06-10 11:58:22 +02:00
Thomas Guillem
440fcfd7b1 libvlc: libvlc_media_discoverer_stop returns nothing 2016-06-09 11:02:19 +02:00
Thomas Guillem
f81b16e5ad libvlc: change libvlc_media_player_add_slave arguments
The last boolean argument is used to force the selection of a slave.
2016-06-07 18:25:53 +02:00
Hugo Beauzée-Luyssen
ad0de42d3a libvlc.sym: Add missing libvlc_media_player_add_slave entry 2016-06-06 19:28:08 +02:00
Thomas Guillem
99c8288760 libvlc: add a timeout in libvlc_media_parse_with_options() 2016-06-05 12:58:32 +02:00
Thomas Guillem
6cf2720eb9 libvlc: media: cancel preparsing when releasing a media 2016-06-05 12:57:58 +02:00
Thomas Guillem
ed11de7b82 core: extend libvlc_MetaRequest and rename it
This function can now pass a timeout and an unique id that can be used to
cancel requests pushed with this id.

Rename it because Meta is too meta.
2016-06-05 12:57:17 +02:00
Rémi Denis-Courmont
c659faff1d lib: add libvlc_media_player_(get|set)_role 2016-06-05 12:26:30 +03:00
Thomas Guillem
a968323afa libvlc: fix libvlc_media_player_get_fps leak
And fix a possible use of a released media.
2016-05-31 16:23:09 +02:00
Thomas Guillem
26cde75f29 libvlc: fix libvlc_media_slaves_release with a count of 0
Since pp_slaves is not initialised when libvlc_media_slaves_get() returns 0.
2016-05-31 16:23:09 +02:00
Thomas Guillem
bfbeee7e5c libvlc: add libvlc_media_player_add_slave
In order to add a slave when the media player is playing.
2016-05-31 16:23:09 +02:00
Thomas Guillem
13534e688a libvlc: media: add missing break 2016-05-25 15:10:39 +02:00
Thomas Guillem
45bc333491 libvlc: media: remove flexible array member
Because ISO C++ has no notation of flexible arrays and this a public header.
2016-05-24 11:38:08 +02:00
Thomas Guillem
9126e33f77 libvlc: merge libvlc_MediaParsedStatus and libvlc_MediaParsedCharged events
Because having two differents events for the same objective is way too
confusing (libvlc_MediaParsedStatus was recently added by me).

libvlc_MediaParsedCharged is now always sent after a call to
libvlc_media_parse_*() (this was not the case if the pre-parsing was skipped).

The core vlc_InputItemPreparsedChanged event is now only attached from the
media player. This allows the libvlc_MediaParsedCharged event to be sent when a
media is parsed from a media player.

/!\ Behavior change in libvlc API /!\

The libvlc_event_t.u.media_parsed_changed.new_status value changed, this is now
a libvlc_media_parsed_status_t. Before this patch, this value was always set to
true, even in case of parse failure/skipped. Now this value can be skipped (1),
failed (2) or done (3). There should be no changes for users that were checking
if new_status was true, since this events was called for these 3 cases (that
are all > 0).
2016-05-24 11:34:31 +02:00
Thomas Guillem
1a18ae33fe input/item: slaves must have a valid priority 2016-05-19 18:41:54 +02:00
Thomas Guillem
b7ea52605b libvlc: media: add slaves API 2016-05-19 15:55:27 +02:00
Rafaël Carré
56b8d4831c win32: Use -static rather than undocumented --static when linking
Also remove -static-libgcc which is redundant with -static
2016-05-03 13:46:12 +02:00
Thomas Guillem
c2d3294584 libvlc: remove (almost unused) libvlc_structures.h
Move the only 2 remaining typedef into vlc/libvlc.h
2016-04-25 10:46:04 +02:00
Thomas Guillem
6719cea3a1 libvlc: clean up deprecated functions
This commit move every deprecated functions to vlc/deprecated.h.

Moved functions still belong to their original doxygen group. Except legacy
logs functions that now belongs to their own deprecated group (libvlc_core
libvlc_log_deprecated).
2016-04-25 10:46:04 +02:00
Thomas Guillem
f8b7b03af8 libvlc: add missing event descriptions 2016-04-21 17:53:10 +02:00
Thomas Guillem
76f79cc436 libvlc: add libvlc_media_get_parsed_status 2016-04-17 08:13:53 +03:00
Thomas Guillem
af0e55a02a libvlc: add libvlc_MediaParsedStatus event
This event is always sent after libvlc_media_parse_with_options is successfuly
called.
2016-04-17 08:13:53 +03:00
Thomas Guillem
d68541a9a0 preparser: don't send vlc_InputItemPreparsedChanged in case of failure
The vlc_InputItemPreparseEnded event should be enough.

There is a compat code inside libvlc in order to don't break old API that are
waiting for a libvlc_MediaParsedChanged, even in case of error.
2016-04-17 08:13:53 +03:00
Thomas Guillem
be5d7c2805 libvlc: factor input_item_preparsed_changed
And don't re-send event, even if this can't happen with current vlc core.
2016-04-17 08:13:53 +03:00
Thomas Guillem
e49ee59ad9 input/item: factor input_item_t New*() functions
Remove "int options, const char *const *options, unsigned option_flags"
arguments from every New() functions since these args are mainly unused. You
now have to call input_item_AddOptions after input item creation to add
options.

Add input_item_net_type enum in order to avoid confusion between 2 int
arguments: i_duration and i_net that could both be -1, 0 or > 0.

Replace input_item_NewWithType and input_item_NewWithTypeExt with
input_item_NewExt.

Add input_item_NewCard, input_item_NewDisc, input_item_NewStream,
input_item_NewDirectory, input_item_NewFile MACRO. These MACROS avoid to use
useless arguments for an item type (for example, it's useless to specify a
duration for a directory type).
2016-04-17 08:11:57 +03:00
Thomas Guillem
ec03185b0f libvlc: media: deprecate libvlc_Buffering state
This state was never set or used. If it was set, it would have overridden the
media state since a media can be buffering while opening or during playback
(while seeking).

PS: Listen to the libvlc_MediaPlayerBuffering event if you want to know if a
media player is buffering.
2016-04-12 09:32:17 +02:00
Petri Hintukainen
c26349e50a libvlc: add popup to libvlc_navigate_mode_t 2016-03-30 22:12:08 +03:00
Thomas Guillem
c021c52459 libvlc: re-order dialog callback arguments
The opaque p_data is now the first argument for the sake of consistency.
2016-03-10 11:45:27 +01:00
Thomas Guillem
b37866a867 dialog: re-order callback arguments
The opaque p_data is now the first argument for the sake of consistency.
2016-03-10 11:45:27 +01:00
Thomas Guillem
21e3fded37 android: get JavaVM* from JNI_OnLoad
And set the JavaVM* in a libvlc var option.

This will allow android modules to access a JNIEnv* even when the parent is a
not a libvlc_media_player. This will be used for the android Keystore module
for example.

Furthermore, this simplify the libvlc API when setting an android context.
2016-02-24 09:47:48 +01:00
Jean-Baptiste Kempf
d1458c92a8 libVLC: rename libvlc_media_discoverer_services_get
to libvlc_media_discoverer_list_get and do the same for release
2016-02-11 17:57:35 +01:00
Thomas Guillem
e676ccf33b libvlc: fix libvlc.sym and NEWS 2016-02-11 16:53:24 +01:00
Thomas Guillem
e744df4cc5 libvlc: add libvlc_media_discoverer_services_get
This function return the list of services discovery handled by libVLC.
2016-02-11 15:39:18 +01:00
Thomas Guillem
902514db6e libvlc: add a libvlc_media_parse_flag_t to interact with the user 2016-02-04 15:05:00 +01:00
Thomas Guillem
68cc74c545 libvlc: add dialog API 2016-02-04 15:03:58 +01:00
Felix Paul Kühne
a527e9d086 libvlc: replace existing title menu bool with int bit mask 2015-12-21 11:03:00 +01:00
Petri Hintukainen
59a8278f6f input: convert input_title_t.b_menu to flags
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-12-02 14:50:10 +01:00
Felix Paul Kühne
5f5121a8d8 libvlc: add a new event fired if the chapter changes 2015-11-25 11:54:03 +01:00
Felix Paul Kühne
0584253f87 libvlc: raise a title changed event if the title changes 2015-11-25 11:53:59 +01:00
Thomas Guillem
860f831fc1 libvlc: don't release media_list while it's used by media
Indeed, events callbacks can access the media_list.
2015-11-05 12:36:59 +01:00
Rémi Denis-Courmont
72b1563b96 lib: get frame rate from media ES, not from demux 2015-10-24 21:23:25 +03:00
Thomas Guillem
9945053450 lib: add libvlc_media_player_set_evas_object
Used to pass an Evas_Object * for the future Evas video_output.
2015-10-23 19:28:15 +02:00
Thomas Guillem
e2c4746368 libvlc_media_player: don't use any vout if vout configuration fails
And assert (debug only).
2015-10-22 09:42:49 +02:00
Jean-Baptiste Kempf
7136d004f8 libVLC: Expose DiscTotal meta 2015-10-16 19:18:46 +02:00
Thomas Guillem
4706adfb46 libvlc_media_player: fix unused warning 2015-10-15 14:02:55 +02:00
Thomas Guillem
5a2e5138a3 libvlc.sym: add missing libvlc_media_player_set_android_context 2015-09-17 17:47:06 +02:00
Felix Paul Kühne
688e3bcb4d libvlc media list player: add getter for player instance 2015-09-10 18:18:49 +02:00
Felix Paul Kühne
6a23d2cd78 libvlc media list player: attach observer after player instance creation 2015-09-10 17:15:14 +02:00
Felix Paul Kühne
90f8255ccd lib/media player: remove remnant 2015-09-10 16:36:06 +02:00
Rémi Denis-Courmont
5f000e6ac6 libvlc: return useful/visible video dimensions (fixes #15122) 2015-08-23 12:46:44 +03:00
Rémi Denis-Courmont
e318990236 lib: fix uninitialized values on error path 2015-08-05 21:38:09 +03:00
Rémi Denis-Courmont
5fb1ac638e lib: remove libvlc_event_manager_register_event_type() 2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
b5985e1d52 lib: remove event listener groups
In real use, there are few (typically only zero or one) listeners per
event type. In this case, the linear search through the listener groups
was actually slower than the linear search through the whole list of
listeners: it required one iteration per event type, even for event
types with no listeners.

(Note: using a hash table over the event type would make a lot more
 sense as an optimization.)
2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
175ce396f3 lib: simplify and speed up event delivery 2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
0a222373f5 lib: merge both event manager locks
The distinction was rather vain, as the inner lock was almost never
held without the outer lock. The only case was adding an event callback
(but _not_ removing one). On the other hand, the distinction required
extra heap manipulations and memory copying for each event.
2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
b80a4563a2 lib: merge event_internal.h into event.c 2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
062bd6c22a lib: remove no lonegr used asynchronous event queue
This fixes excessive (and dumb) usage of thread local variables, and
invalid use of thread cancellation.
2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
e978f924cb lib: add dedicated thread for list player media end handling
This avoids using the buggy asynchronous event queue. This does NOT
solve other existing races and dead locks in the media list player.
2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
5c573b07ac lib: simplify set_relative_playlist_position_and_play() 2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
e15851d57a lib: remove dead code
As of a2ab8b276c, there is always a media
player underneath the media list player.
2015-08-05 21:30:49 +03:00
Rémi Denis-Courmont
a2ab8b276c lib: always create the media player underneath the list player 2015-08-05 19:08:03 +03:00
Rémi Denis-Courmont
7f4edacfd2 event: remove unused instance libvlc_event_manager_new() parameter 2015-08-05 19:08:03 +03:00
Rémi Denis-Courmont
475d6019b3 lib: retain/release the instance more consistently
All objects with a pointer back to the instance ought to retain a
reference to it (which currently means pretty much all objects).
2015-08-05 19:08:02 +03:00
Rémi Denis-Courmont
6a8352db0b lib: remove internal event functions from export list
The following functions are not marked LIBVLC_API and are not in the
public header files (for a reason):
 - libvlc_event_manager_new(),
 - libvlc_event_manager_register_event_type() and
 - libvlc_event_manager_release().
There wer no reasons to have them in the symbols list.
2015-08-05 19:08:02 +03:00
Rémi Denis-Courmont
fc15c20e72 libvlc: expose event for audio output device change 2015-07-28 10:05:27 +03:00
Rémi Denis-Courmont
a8ffc3b821 aout: propagate current device to parent input manager 2015-07-28 10:04:41 +03:00
Rémi Denis-Courmont
bd8485fc6e libvlc: expose event for audio volume change (fixes #14568)
Cc: Harald Sitter <sitter@kde.org>
2015-07-28 10:04:38 +03:00
Rémi Denis-Courmont
09bea7fa99 libvlc: expose events for the audio mute status (refs #14568)
Cc: Harald Sitter <sitter@kde.org>
2015-07-28 10:03:54 +03:00
Rémi Denis-Courmont
32bf025b29 libvlc: add corked and uncorked events (fixes #14444)
This exposes (audio) policy cork events to LibVLC applications. The
intended usage is for applications to pause/resume playback.

We decided against pausing and resuming automatically as it would most
likely confuse the playback state machine of existing applications. By
default, the OS decides might either mute or duck the audio stream.

Cc: Harald Sitter <sitter@kde.org>
2015-07-27 14:08:38 +03:00
Rémi Denis-Courmont
d8aa9aae50 lib: fix warning 2015-07-25 18:10:29 +03:00
Felix Paul Kühne
5f08edfe08 libvlc: deprecate AGL vout setter/getter
The QuickDraw vout is gone since  a long time so this remnant is a NO-OP
2015-07-24 19:18:12 +02:00
Thomas Guillem
a65d213b8b Revert "libvlc_media_player: create the aout when first setting audio options"
This leads to very inconsistent behaviour on WASAPI and PulseAudio.

This reverts commit 1d7c559827.
2015-06-26 10:37:02 +02:00
Thomas Guillem
63dbabfda7 lib: add libvlc_media_player_set_android_context
Used to pass the Java VM and a org.videolan.libvlc.IAWindowNativeHandler
jobject.
2015-06-25 19:08:22 +02:00
Thomas Guillem
1d7c559827 libvlc_media_player: create the aout when first setting audio options
If not setting any audio options, the aout will be created by the decoder
thread.

This avoids to create an audio output that will be destroyed if you change it
with libvlc_audio_output_set.
2015-06-25 19:08:18 +02:00
Rémi Denis-Courmont
3cee1194f9 lib: fix memory leak 2015-06-18 00:11:04 +03:00
Rémi Denis-Courmont
167d5d5d44 lib: fix pointer misused as integer and simplify 2015-06-18 00:11:04 +03:00
Rémi Denis-Courmont
3cc31666d4 lib: remove no-op 2015-06-18 00:11:04 +03:00
Felix Paul Kühne
45668a249e libvlc: clean recent title and chapter API additions
Thanks to Rémi for the suggestions
2015-06-16 12:58:55 +02:00
Zhao Zhili
29ed29e642 fix memory leak in lib/audio.c
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-06-10 18:44:21 +03:00
Felix Paul Kühne
b0ba9c4cc8 libvlc: expand media player API to retrieve full information about available chapter of a given title 2015-06-09 17:58:14 +02:00
Felix Paul Kühne
8bb74ef54d libvlc: expand media player API to retrieve information about all available titles of the currently playing media item 2015-06-09 17:58:14 +02:00
Rémi Denis-Courmont
2772acfee7 lib: use input "state" variable instead of b_dead 2015-06-05 22:25:58 +03:00
Thomas Guillem
c64b46f663 Fix crash: don't free stack pointer
This fixes a regression brought by 9f85beeeaa
2015-05-26 12:14:36 +02:00
Rémi Denis-Courmont
9f85beeeaa Fix title N variable formatting
Do not assume the title number is small; allocate large enough buffer.
2015-05-23 19:08:27 +03:00
Rémi Denis-Courmont
d39ba9a05c input: switch spu and audio delay variables to integer type 2015-05-22 22:14:39 +03:00
Rémi Denis-Courmont
ce80ca38a7 input: change time and length variable to integer 2015-05-22 22:14:37 +03:00
Rémi Denis-Courmont
5bd4542d60 Use input_Close() rather than vlc_object_release()
input_Create() should be matched with input_Close().
vlc_object_release() should be used only to discard extra references to
the input thread object.
2015-05-21 19:36:02 +03:00
Thomas Guillem
3add837059 lib/video: set "video" prop to true when changing video tracks
It allows an application to re-activate video when the media was played without
video (i.e. with :no-video).
2015-04-29 14:12:17 +02:00
Rémi Denis-Courmont
3f3e723193 lib: rationalize/uniformize video window setters 2015-04-15 18:47:48 +03:00
Thomas Guillem
dd9aa43618 libvlc: remove duplicate line 2015-04-13 15:30:32 +02:00
Rémi Denis-Courmont
b67f295520 libvlc: add libvlc_media_new_callbacks() for custom input media
(fixes #8562)
2015-03-30 23:04:13 +03:00
Thomas Guillem
f3cc5c9f0f libvlc: add libvlc_media_get_type
Get the type of the media.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-03-25 15:29:57 +01:00
Rémi Denis-Courmont
80d88b05f2 Mark unreachable code on GCC even if NDEBUG
This might suppress some warnings (and very slightly reduce code size)
when assertions are disabled. Not that I particularly like to create
VLC-specific macros.
2015-02-18 17:52:52 +02:00
Rémi Denis-Courmont
5c16983be8 lib: remove unused GCC-ism macro 2015-02-09 21:12:40 +02:00
Rémi Denis-Courmont
dbe58b27d3 libvlc: fix small race 2015-02-08 16:35:55 +02:00
Rémi Denis-Courmont
65ebc4b51a libvlc: go to libvlc_Ended rather than libvlc_Stopped at EOS
This is what the tests expect, and was the final status before the
merge of ABORT and DEAD input events.

In fact, libvlc_Stopped does not really correspond to anything: it has
no STOPPED_S equivalent in the input thread state. The only way to
reach it is to call libvlc_media_player_stop() explicitly.
Regardless, lets keep it for backward compatibility.
2015-02-08 16:35:55 +02:00
Rémi Denis-Courmont
4ea6b96bce libvlc: provide file name and line number 2015-02-08 14:57:17 +02:00
Rémi Denis-Courmont
acb7470b52 input: remove useless parameter to input_Stop() 2015-02-05 22:40:42 +02:00
Rémi Denis-Courmont
bdcdf97054 input: merge ABORT and DEAD events 2015-02-05 22:30:36 +02:00
Thomas Guillem
f7da3d84c9 lib/media: fix MediaListEndReached not sent when media doesn't have sub items
MediaListEndReached event should not be sent only when a new sub item tree is
added, otherwise it won't be sent if media doesn't have any sub items.

To fix this issue, send the MediaListEndReached event when preparse function
terminates (only if the media_list was created either by user or by sub items
callbacks).

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-02-04 15:04:24 +01:00
Mark Lee
a60b897e11 lib: add libvlc_audio_output_device_get()
This function gets the active device identifier for the current
audio output, if there is one, and is the complementary function
to libvlc_audio_output_device_set().

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-01-28 00:01:39 +01:00
Thomas Guillem
2bf94c2512 libvlc: add libvlc_media_parse_with_options
Extended version of libvlc_media_parse_async. It uses a flag to specify parse
options and returns an int for error handling.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-01-20 11:20:28 +01:00
Thomas Guillem
1723d7e97f libvlc: add libvlc_MediaListEndReached event
Expose an event to libvlc users which allows them to get notified when a media
list reached the end. That is, when the media list is attached to a media
(subitems) that completed a parsing. Or when the media list is attached to a
media discovery that stopped.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-01-20 11:20:28 +01:00
Thomas Guillem
bcb1b3bd53 libvlc: media_list: don't set media if readonly
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-01-20 11:20:27 +01:00
Thomas Guillem
16565d4c04 libvlc: media: fix leak if it has subitems
Don't call libvlc_media_list_set_media from media since it causes
p_md->p_subitems to retain p_md while p_md is already retaining
p_md->p_subitems, therefore these 2 objects won't be releasable.

Add a new internal variable: p_internal_md that is set from media without
retaining it.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-01-20 11:20:27 +01:00
Thomas Guillem
841460febe libvlc: media: lock media_list
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-01-20 08:17:18 +02:00
Thomas Guillem
9b2f91fa25 libvlc: media: set sub_items readonly
media's sub_items should be only writable by media.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-01-20 08:17:18 +02:00
Thomas Guillem
75fe4eafff libvlc: libvlc_media_subitems: lock and always return a medialist
This way, libvlc_media_subitems can be called before, during or after a
parsing. Furthermore, this allows to attach media_list events before
libvlc_media_parse is called.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-01-20 08:17:18 +02:00
Thomas Guillem
9b2c414cc6 libvlc: don't use functions with leading underscore
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-01-20 08:17:18 +02:00
Rémi Denis-Courmont
9d30c4c56a libvlc: missing NULL terminator (fixes #13655) 2015-01-15 21:32:27 +02:00
Rémi Denis-Courmont
950645c061 libvlc: fix vbi-page initialization without zvbi plugin
A variable cannot be inherited if it is not a configuration item.
Note this only avoids generating an error; VBI cannot work without the
plugin anyway.
2015-01-15 21:24:10 +02:00
Thomas Guillem
7458af47e6 libvlc: add libvlc_media_get_codec_description
Get codec description from media elementary stream.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-01-13 23:28:17 +01:00
Thomas Guillem
fa7924acb3 lib: change libvlc_media_discoverer_t creation
libvlc_media_discoverer_new_from_name was creating a services_discovery_t and
was starting it, so libvlc_MediaDiscovererStarted event (or any other events)
could not be received.

To fix that, Split libvlc_media_discoverer_new_from_name into
libvlc_media_discoverer_new and libvlc_media_discoverer_start. That way, we can
attach events between create and start.

libvlc_media_discoverer_new_from_name is now deprecated, but it still works
like before.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2015-01-13 23:28:17 +01:00
Thomas Guillem
89b679a3fc libvlc_media_list: missing vlc_mutex_destroy
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2014-12-29 22:29:37 +01:00
Ludovic Fauvet
d4ccd7a5b4 Fix broken NowPlaying (close #9960, #11796, #12850)
Prevent the es_out from overriding the NowPlaying state by splitting
the meta into NowPlaying and ESNowPlaying.

The function input_item_GetNowPlayingFb can be used to return the
preferred meta value.
2014-12-18 11:27:25 +01:00
Felix Paul Kühne
8d48e95e9f lib/media player: inherit vbi-page to achieve correct variable value on first use 2014-12-09 22:13:36 +01:00
Uwe L. Korn
dae78cbb0e input: Add support for DiscNumber meta
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2014-12-08 12:14:04 +01:00
Uwe L. Korn
ff555c6df9 input: Add support for AlbumArtist meta
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2014-11-23 00:11:45 +01:00
Jean-Baptiste Kempf
67e74ed283 lib: use app-icon-name for libvlc_set_app_id 2014-11-01 13:45:38 +01:00
Hugo Beauzée-Luyssen
f74f2334bb libvlc: Remove duplicated forward declaration 2014-10-24 17:11:47 +02:00