Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add servicetype HEVC according to DVB specs
  • Loading branch information
Glenn-1990 authored and perexg committed Apr 11, 2016
1 parent f35eadf commit 4eb3de6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/input/mpegts/dvb_psi_lib.c
Expand Up @@ -41,6 +41,7 @@ static const int dvb_servicetype_map[][2] = {
{ 0xA6, ST_HDTV }, /* Bell TV tiered HDTV */
{ 0xA8, ST_SDTV }, /* DN advanced SDTV */
{ 0xD3, ST_SDTV }, /* SKY TV SDTV */
{ 0x1F, ST_UHDTV }, /* HEVC (assume all HEVC content is UHD?) */
};

int
Expand Down
30 changes: 26 additions & 4 deletions src/service.c
Expand Up @@ -155,7 +155,8 @@ service_type_auto_list ( void *o, const char *lang )
{ N_("None"), ST_NONE },
{ N_("Radio"), ST_RADIO },
{ N_("SD TV"), ST_SDTV },
{ N_("HD TV"), ST_HDTV }
{ N_("HD TV"), ST_HDTV },
{ N_("UHD TV"), ST_UHDTV }
};
return strtab2htsmsg(tab, 1, lang);
}
Expand Down Expand Up @@ -1194,7 +1195,27 @@ service_is_hdtv(service_t *t)
else if (s_type == ST_NONE) {
elementary_stream_t *st;
TAILQ_FOREACH(st, &t->s_components, es_link)
if (SCT_ISVIDEO(st->es_type) && st->es_height >= 720)
if (SCT_ISVIDEO(st->es_type) &&
st->es_height >= 720 && st->es_height <= 1080)
return 1;
}
return 0;
}

int
service_is_uhdtv(service_t *t)
{
char s_type;
if(t->s_type_user == ST_UNSET)
s_type = t->s_servicetype;
else
s_type = t->s_type_user;
if (s_type == ST_UHDTV)
return 1;
else if (s_type == ST_NONE) {
elementary_stream_t *st;
TAILQ_FOREACH(st, &t->s_components, es_link)
if (SCT_ISVIDEO(st->es_type) && st->es_height > 1080)
return 1;
}
return 0;
Expand Down Expand Up @@ -1246,12 +1267,13 @@ const char *
service_servicetype_txt ( service_t *s )
{
static const char *types[] = {
"HDTV", "SDTV", "Radio", "Other"
"HDTV", "SDTV", "Radio", "UHDTV", "Other"
};
if (service_is_hdtv(s)) return types[0];
if (service_is_sdtv(s)) return types[1];
if (service_is_radio(s)) return types[2];
return types[3];
if (service_is_uhdtv(s)) return types[3];
return types[4];
}


Expand Down
4 changes: 3 additions & 1 deletion src/service.h
Expand Up @@ -276,6 +276,7 @@ typedef struct service {
ST_OTHER,
ST_SDTV,
ST_HDTV,
ST_UHDTV,
ST_RADIO
} s_servicetype;

Expand Down Expand Up @@ -541,10 +542,11 @@ const char *service_servicetype_txt(service_t *t);

int service_has_audio_or_video(service_t *t);
int service_is_sdtv(service_t *t);
int service_is_uhdtv(service_t *t);
int service_is_hdtv(service_t *t);
int service_is_radio(service_t *t);
int service_is_other(service_t *t);
#define service_is_tv(s) (service_is_hdtv(s) || service_is_sdtv(s))
#define service_is_tv(s) (service_is_hdtv(s) || service_is_sdtv(s) || service_is_uhdtv(s))

int service_is_encrypted ( service_t *t );

Expand Down

0 comments on commit 4eb3de6

Please sign in to comment.