vlc | branch: master | Steve Lhomme <rob...@videolabs.io> | Mon Aug  8 10:33:57 
2016 +0200| [99e1b214d929a9d577fdfda14c6954113f372036] | committer: Thomas 
Guillem

renderer: tell when a demux-filter should be used with a renderer

Signed-off-by: Thomas Guillem <tho...@gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=99e1b214d929a9d577fdfda14c6954113f372036
---

 include/vlc_renderer_discovery.h      | 10 +++++++++-
 modules/services_discovery/microdns.c |  9 ++++++---
 src/libvlccore.sym                    |  1 +
 src/misc/renderer_discovery.c         | 16 +++++++++++++++-
 4 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/include/vlc_renderer_discovery.h b/include/vlc_renderer_discovery.h
index e922df2..30019ee 100644
--- a/include/vlc_renderer_discovery.h
+++ b/include/vlc_renderer_discovery.h
@@ -48,6 +48,7 @@
  * @param psz_uri uri of the renderer item, must contains a valid protocol and
  * a valid host
  * @param psz_extra_sout extra sout options
+ * @param psz_demux_filter demux filter to use with the renderer
  * @param psz_icon_uri icon uri of the renderer item
  * @param i_flags flags for the item
  * @return a renderer item or NULL in case of error
@@ -55,7 +56,8 @@
 VLC_API vlc_renderer_item_t *
 vlc_renderer_item_new(const char *psz_type, const char *psz_name,
                       const char *psz_uri, const char *psz_extra_sout,
-                      const char *psz_icon_uri, int i_flags) VLC_USED;
+                      const char *psz_demux_filter, const char *psz_icon_uri,
+                      int i_flags) VLC_USED;
 
 /**
  * Hold a renderer item, i.e. creates a new reference
@@ -83,6 +85,12 @@ VLC_API const char *
 vlc_renderer_item_type(const vlc_renderer_item_t *p_item);
 
 /**
+ * Get the demux filter to use with a renderer item
+ */
+VLC_API const char *
+vlc_renderer_item_demux_filter(const vlc_renderer_item_t *p_item);
+
+/**
  * Get the sout command of a renderer item
  */
 VLC_API const char *
diff --git a/modules/services_discovery/microdns.c 
b/modules/services_discovery/microdns.c
index fb417a6..08c8668 100644
--- a/modules/services_discovery/microdns.c
+++ b/modules/services_discovery/microdns.c
@@ -183,7 +183,8 @@ items_add_input( struct discovery_sys *p_sys, 
services_discovery_t *p_sd,
 static int
 items_add_renderer( struct discovery_sys *p_sys, vlc_renderer_discovery_t 
*p_rd,
                     const char *psz_name, char *psz_uri,
-                    const char *psz_icon_uri, int i_flags )
+                    const char *psz_demux_filter, const char *psz_icon_uri,
+                    int i_flags )
 {
     struct item *p_item = malloc( sizeof(struct item) );
     if( p_item == NULL )
@@ -193,7 +194,7 @@ items_add_renderer( struct discovery_sys *p_sys, 
vlc_renderer_discovery_t *p_rd,
 
     vlc_renderer_item_t *p_renderer_item =
         vlc_renderer_item_new( "chromecast", psz_name, psz_uri, psz_extra_uri,
-                               psz_icon_uri, i_flags );
+                               psz_demux_filter, psz_icon_uri, i_flags );
     if( p_renderer_item == NULL )
     {
         free( psz_uri );
@@ -484,6 +485,7 @@ new_entries_rd_cb( void *p_this, int i_status, const struct 
rr_entry *p_entries
         char *psz_icon_uri = NULL;
         char *psz_uri = create_uri( p_srv->psz_protocol, psz_ip, b_ipv6,
                                     p_srv->i_port );
+        const char *psz_demux_filter = NULL;
 
         if( psz_uri == NULL )
             break;
@@ -508,7 +510,8 @@ new_entries_rd_cb( void *p_this, int i_status, const struct 
rr_entry *p_entries
             p_srv->i_renderer_flags |= VLC_RENDERER_CAN_VIDEO;
 
         items_add_renderer( p_sys, p_rd, p_srv->psz_device_name, psz_uri,
-                            psz_icon_uri, p_srv->i_renderer_flags );
+                            psz_demux_filter, psz_icon_uri,
+                            p_srv->i_renderer_flags );
         free(psz_icon_uri);
     }
 
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index d9d94e0..8bb2dac 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -767,6 +767,7 @@ vlc_renderer_item_name
 vlc_renderer_item_type
 vlc_renderer_item_sout
 vlc_renderer_item_icon_uri
+vlc_renderer_item_demux_filter
 vlc_renderer_item_flags
 vlc_rd_get_names
 vlc_rd_new
diff --git a/src/misc/renderer_discovery.c b/src/misc/renderer_discovery.c
index a8ad1c0..1ceb0de 100644
--- a/src/misc/renderer_discovery.c
+++ b/src/misc/renderer_discovery.c
@@ -38,6 +38,7 @@ struct vlc_renderer_item_t
     char *psz_type;
     char *psz_sout;
     char *psz_icon_uri;
+    char *psz_demux_filter;
     int i_flags;
     atomic_uint refs;
 };
@@ -49,13 +50,15 @@ item_free(vlc_renderer_item_t *p_item)
     free(p_item->psz_type);
     free(p_item->psz_sout);
     free(p_item->psz_icon_uri);
+    free(p_item->psz_demux_filter);
     free(p_item);
 }
 
 vlc_renderer_item_t *
 vlc_renderer_item_new(const char *psz_type, const char *psz_name,
                       const char *psz_uri, const char *psz_extra_sout,
-                      const char *psz_icon_uri, int i_flags)
+                      const char *psz_demux_filter, const char *psz_icon_uri,
+                      int i_flags)
 {
     assert(psz_uri != NULL);
     vlc_renderer_item_t *p_item = NULL;
@@ -89,6 +92,9 @@ vlc_renderer_item_new(const char *psz_type, const char 
*psz_name,
     if ((p_item->psz_icon_uri = strdup(psz_icon_uri)) == NULL)
         goto error;
 
+    if ((p_item->psz_demux_filter = strdup(psz_demux_filter)) == NULL)
+        goto error;
+
     p_item->i_flags = i_flags;
     atomic_init(&p_item->refs, 1);
     vlc_UrlClean(&url);
@@ -133,6 +139,14 @@ vlc_renderer_item_icon_uri(const vlc_renderer_item_t 
*p_item)
     return p_item->psz_icon_uri;
 }
 
+const char *
+vlc_renderer_item_demux_filter(const vlc_renderer_item_t *p_item)
+{
+    assert(p_item != NULL);
+
+    return p_item->psz_demux_filter;
+}
+
 int
 vlc_renderer_item_flags(const vlc_renderer_item_t *p_item)
 {

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to