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>
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.
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.
This reverts commit 3add837059.
This commit was incomplete (missing audio/spu support) and is now done in vlc
core. See 8bc1b9ff8747be1b87730bea14a1b3778aed0bd6.
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.
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>
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>
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.
Inherit "deinterlace" and "deinterlace-mode" values from libvlc (values are set
from libvlc-module.c).
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
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.
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).
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).
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.
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).
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.
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.
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.)
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.
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.
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>
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.
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.
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.
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>
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>
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>
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>
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>
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>
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.
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>
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.