[vlc-devel] [PATCH 2/2] libvlc media list player: add getter player instance
Felix Paul Kühne
fkuehne at videolan.org
Thu Sep 10 13:48:21 CEST 2015
---
include/vlc/libvlc_media_list_player.h | 10 ++++++++++
lib/libvlc.sym | 1 +
lib/media_list_player.c | 16 +++++++++++++++-
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/include/vlc/libvlc_media_list_player.h b/include/vlc/libvlc_media_list_player.h
index b85981d..71e2ac0 100644
--- a/include/vlc/libvlc_media_list_player.h
+++ b/include/vlc/libvlc_media_list_player.h
@@ -103,6 +103,16 @@ LIBVLC_API void
libvlc_media_player_t * p_mi );
/**
+ * Get media player instance in this media_list_player instance.
+ *
+ * \param p_mlp media list player instance
+ * \return p_mi media player instance
+ * \note the caller is responsible for releasing the player instance
+ */
+LIBVLC_API libvlc_media_player_t *
+ libvlc_media_list_player_get_media_player(libvlc_media_list_player_t * p_mlp);
+
+/**
* Set the media list associated with the player
*
* \param p_mlp media list player instance
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 06c9826..97b153b 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -109,6 +109,7 @@ libvlc_media_list_lock
libvlc_media_list_media
libvlc_media_list_new
libvlc_media_list_player_event_manager
+libvlc_media_list_player_get_media_player
libvlc_media_list_player_get_state
libvlc_media_list_player_is_playing
libvlc_media_list_player_new
diff --git a/lib/media_list_player.c b/lib/media_list_player.c
index 44f75a0..b5a645e 100644
--- a/lib/media_list_player.c
+++ b/lib/media_list_player.c
@@ -1,10 +1,12 @@
/*****************************************************************************
* media_list_player.c: libvlc new API media_list player functions
*****************************************************************************
- * Copyright (C) 2007 VLC authors and VideoLAN
+ * Copyright (C) 2007-2015 VLC authors and VideoLAN
* $Id$
*
* Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
+ * Niles Bindel <zaggal69 # gmail.com>
+ * Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
@@ -601,6 +603,18 @@ void libvlc_media_list_player_set_media_player(libvlc_media_list_player_t * p_ml
}
/**************************************************************************
+ * get_media_player (Public)
+ **************************************************************************/
+libvlc_media_player_t * libvlc_media_list_player_get_media_player(libvlc_media_list_player_t * p_mlp)
+{
+ if (p_mlp->p_mi == NULL)
+ return NULL;
+
+ libvlc_media_player_retain(p_mlp->p_mi);
+ return p_mlp->p_mi;
+}
+
+/**************************************************************************
* set_media_list (Public)
**************************************************************************/
void libvlc_media_list_player_set_media_list(libvlc_media_list_player_t * p_mlp, libvlc_media_list_t * p_mlist)
--
2.5.1
More information about the vlc-devel
mailing list