Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mpegts mux+service: export uuid for parent network and mux
  • Loading branch information
perexg committed Apr 1, 2015
1 parent fabd011 commit 08c4af7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/input/mpegts/mpegts_mux.c
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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",
Expand Down
19 changes: 19 additions & 0 deletions src/input/mpegts/mpegts_service.c
Expand Up @@ -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 )
{
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 08c4af7

Please sign in to comment.