mpegts mux+service: export uuid for parent network and mux

This commit is contained in:
Jaroslav Kysela 2015-04-01 12:57:57 +02:00
parent fabd01191d
commit 08c4af7e6a
2 changed files with 38 additions and 0 deletions

View file

@ -342,6 +342,18 @@ mpegts_mux_class_get_network ( void *ptr )
return &s;
}
static const void *
mpegts_mux_class_get_network_uuid ( void *ptr )
{
static char buf[UUID_HEX_SIZE], *s = buf;
mpegts_mux_t *mm = ptr;
if (mm && mm->mm_network)
strcpy(buf, idnode_uuid_as_str(&mm->mm_network->mn_id) ?: "");
else
*buf = 0;
return &s;
}
static const void *
mpegts_mux_class_get_name ( void *ptr )
{
@ -490,6 +502,13 @@ const idclass_t mpegts_mux_class =
.opts = PO_RDONLY | PO_NOSAVE,
.get = mpegts_mux_class_get_network,
},
{
.type = PT_STR,
.id = "network_uuid",
.name = "Network Uuid",
.opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
.get = mpegts_mux_class_get_network_uuid,
},
{
.type = PT_STR,
.id = "name",

View file

@ -45,6 +45,18 @@ mpegts_service_class_get_mux ( void *ptr )
return &s;
}
static const void *
mpegts_service_class_get_mux_uuid ( void *ptr )
{
static char buf[UUID_HEX_SIZE], *s = buf;
mpegts_service_t *ms = ptr;
if (ms && ms->s_dvb_mux)
strcpy(buf, idnode_uuid_as_str(&ms->s_dvb_mux->mm_id) ?: "");
else
*buf = 0;
return &s;
}
static const void *
mpegts_service_class_get_network ( void *ptr )
{
@ -90,6 +102,13 @@ const idclass_t mpegts_service_class =
.opts = PO_RDONLY | PO_NOSAVE,
.get = mpegts_service_class_get_mux,
},
{
.type = PT_STR,
.id = "multiplex_uuid",
.name = "Mux UUID",
.opts = PO_RDONLY | PO_NOSAVE | PO_HIDDEN,
.get = mpegts_service_class_get_mux_uuid,
},
{
.type = PT_U16,
.id = "sid",