Commit 99e1b214 authored by Steve Lhomme's avatar Steve Lhomme Committed by Thomas Guillem

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

Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 4fbe397b
......@@ -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
......@@ -82,6 +84,12 @@ vlc_renderer_item_name(const vlc_renderer_item_t *p_item);
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
*/
......
......@@ -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);
}
......
......@@ -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
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment