[vlc-devel] [RFC PATCH 4/8] playlist: Add playlist_SetRenderer

Hugo Beauzée-Luyssen hugo at beauzee.fr
Wed Jul 19 16:17:44 CEST 2017


---
 include/vlc_playlist.h           | 8 ++++++++
 src/Makefile.am                  | 1 +
 src/libvlccore.sym               | 1 +
 src/playlist/engine.c            | 3 +++
 src/playlist/playlist_internal.h | 1 +
 5 files changed, 14 insertions(+)

diff --git a/include/vlc_playlist.h b/include/vlc_playlist.h
index 6774410433..36e69ea077 100644
--- a/include/vlc_playlist.h
+++ b/include/vlc_playlist.h
@@ -357,6 +357,14 @@ VLC_API bool playlist_IsServicesDiscoveryLoaded( playlist_t *,const char *) VLC_
 /** Query a services discovery */
 VLC_API int playlist_ServicesDiscoveryControl( playlist_t *, const char *, int, ... );
 
+/********************** Renderer ***********************/
+/**
+ * Sets a renderer or remove the current one
+ * @param p_item    The renderer item to be used, or NULL to disable the current
+ *                  one. If a renderer is provided, its reference count will be
+ *                  incremented.
+ */
+VLC_API int playlist_SetRenderer( playlist_t* p_pl, vlc_renderer_item_t* p_item );
 
 
 /********************************************************
diff --git a/src/Makefile.am b/src/Makefile.am
index 6b661a655d..4843d9a7d5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -225,6 +225,7 @@ libvlccore_la_SOURCES = \
 	playlist/item.c \
 	playlist/search.c \
 	playlist/services_discovery.c \
+	playlist/renderer.c \
 	input/item.c \
 	input/access.c \
 	input/clock.c \
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 93c56d3749..b27b831815 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -360,6 +360,7 @@ playlist_VolumeSet
 playlist_VolumeUp
 playlist_MuteSet
 playlist_MuteGet
+playlist_SetRenderer
 sdp_AddAttribute
 sdp_AddMedia
 secstotimestr
diff --git a/src/playlist/engine.c b/src/playlist/engine.c
index 0b0c82ee92..680366cd09 100644
--- a/src/playlist/engine.c
+++ b/src/playlist/engine.c
@@ -34,6 +34,7 @@
 #include <vlc_playlist.h>
 #include <vlc_interface.h>
 #include <vlc_http.h>
+#include <vlc_renderer_discovery.h>
 #include "playlist_internal.h"
 #include "input/resource.h"
 
@@ -310,6 +311,8 @@ void playlist_Destroy( playlist_t *p_playlist )
     /* Release input resources */
     assert( p_sys->p_input == NULL );
     input_resource_Release( p_sys->p_input_resource );
+    if( p_sys->p_renderer )
+        vlc_renderer_item_release( p_sys->p_renderer );
 
     if( p_playlist->p_media_library != NULL )
         playlist_MLDump( p_playlist );
diff --git a/src/playlist/playlist_internal.h b/src/playlist/playlist_internal.h
index ed40679f8f..3515a898bd 100644
--- a/src/playlist/playlist_internal.h
+++ b/src/playlist/playlist_internal.h
@@ -58,6 +58,7 @@ typedef struct playlist_private_t
     input_thread_t *      p_input;  /**< the input thread associated
                                      * with the current item */
     input_resource_t *   p_input_resource; /**< input resources */
+    vlc_renderer_item_t *p_renderer;
     struct {
         /* Current status. These fields are readonly, only the playlist
          * main loop can touch it*/
-- 
2.11.0



More information about the vlc-devel mailing list