[vlc-devel] [PATCH 1/3] [RFC] renderer: tell when a demux-filter should be used with a renderer
Steve Lhomme
robux4 at videolabs.io
Mon Aug 8 10:33:57 CEST 2016
---
include/vlc_renderer_discovery.h | 9 ++++++++-
modules/services_discovery/microdns.c | 9 ++++++---
src/libvlccore.sym | 1 +
src/misc/renderer_discovery.c | 16 +++++++++++++++-
4 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/include/vlc_renderer_discovery.h b/include/vlc_renderer_discovery.h
index 504bea0..fbbf926 100644
--- a/include/vlc_renderer_discovery.h
+++ b/include/vlc_renderer_discovery.h
@@ -51,12 +51,13 @@ typedef struct vlc_renderer_item vlc_renderer_item;
* @param psz_extra_sout extra sout options
* @param psz_icon_uri icon uri of the renderer item
* @param i_flags flags for the item
+ * @param psz_demux_filter demux filter to use with the renderer
* @return a renderer item or NULL in case of error
*/
VLC_API vlc_renderer_item *
vlc_renderer_item_new(const char *psz_name, const char *psz_uri,
const char *psz_extra_sout, const char *psz_icon_uri,
- int i_flags) VLC_USED;
+ int i_flags, const char *psz_demux_filter) VLC_USED;
/**
* Hold a renderer item, i.e. creates a new reference
@@ -83,6 +84,12 @@ VLC_API const char *
vlc_renderer_item_sout(const vlc_renderer_item *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 *p_item);
+
+/**
* Get the icon uri of a renderer item
*/
VLC_API const char *
diff --git a/modules/services_discovery/microdns.c b/modules/services_discovery/microdns.c
index f7e5fe8..d06e63c 100644
--- a/modules/services_discovery/microdns.c
+++ b/modules/services_discovery/microdns.c
@@ -183,7 +183,7 @@ 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 *p_rd,
const char *psz_name, char *psz_uri,
- const char *psz_icon_uri, int i_flags )
+ const char *psz_icon_uri, int i_flags, const char *psz_demux_filter )
{
struct item *p_item = malloc( sizeof(struct item) );
if( p_item == NULL )
@@ -192,7 +192,8 @@ items_add_renderer( struct discovery_sys *p_sys, vlc_renderer_discovery *p_rd,
const char *psz_extra_uri = i_flags & VLC_RENDERER_CAN_VIDEO ? NULL : "video=0";
vlc_renderer_item *p_renderer_item =
- vlc_renderer_item_new( psz_name, psz_uri, psz_extra_uri, psz_icon_uri, i_flags );
+ vlc_renderer_item_new( psz_name, psz_uri, psz_extra_uri, psz_icon_uri, i_flags,
+ psz_demux_filter );
if( p_renderer_item == NULL )
{
free( psz_uri );
@@ -483,6 +484,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;
@@ -507,7 +509,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_icon_uri, p_srv->i_renderer_flags,
+ psz_demux_filter );
free(psz_icon_uri);
}
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index ae86025..ab5035d 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -758,6 +758,7 @@ vlc_renderer_item_release
vlc_renderer_item_name
vlc_renderer_item_sout
vlc_renderer_item_icon_uri
+vlc_renderer_item_demux_filter
vlc_renderer_item_flags
vlc_renderer_item_set_ctx
vlc_renderer_item_ctx
diff --git a/src/misc/renderer_discovery.c b/src/misc/renderer_discovery.c
index 96010d2..9cf5b4b 100644
--- a/src/misc/renderer_discovery.c
+++ b/src/misc/renderer_discovery.c
@@ -37,6 +37,7 @@ struct vlc_renderer_item
char *psz_name;
char *psz_sout;
char *psz_icon_uri;
+ char *psz_demux_filter;
void *p_ctx;
int i_flags;
atomic_uint refs;
@@ -45,7 +46,7 @@ struct vlc_renderer_item
vlc_renderer_item *
vlc_renderer_item_new(const char *psz_name, const char *psz_uri,
const char *psz_extra_sout, const char *psz_icon_uri,
- int i_flags)
+ int i_flags, const char *psz_demux_filter)
{
assert(psz_uri != NULL);
vlc_renderer_item *p_item = NULL;
@@ -76,6 +77,9 @@ vlc_renderer_item_new(const char *psz_name, const char *psz_uri,
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);
@@ -88,6 +92,7 @@ error:
free(p_item->psz_name);
free(p_item->psz_sout);
free(p_item->psz_icon_uri);
+ free(p_item->psz_demux_filter);
free(p_item);
}
return NULL;
@@ -117,6 +122,14 @@ vlc_renderer_item_icon_uri(const vlc_renderer_item *p_item)
return p_item->psz_icon_uri;
}
+const char *
+vlc_renderer_item_demux_filter(const vlc_renderer_item *p_item)
+{
+ assert(p_item != NULL);
+
+ return p_item->psz_demux_filter;
+}
+
int
vlc_renderer_item_flags(const vlc_renderer_item *p_item)
{
@@ -160,6 +173,7 @@ vlc_renderer_item_release(vlc_renderer_item *p_item)
free(p_item->psz_name);
free(p_item->psz_sout);
free(p_item->psz_icon_uri);
+ free(p_item->psz_demux_filter);
free(p_item);
}
--
2.8.2
More information about the vlc-devel
mailing list