From fe885b3ade020b197a04fc63ee41fd90e7e11a14 Mon Sep 17 00:00:00 2001 From: Cosmin Stejerean Date: Tue, 30 Apr 2024 14:10:23 -0700 Subject: [PATCH] feat: add missing DASH roles from ISO/IEC 23009-1 section 5.8.5.5 (#1390) Fixes #1149 --------- Co-authored-by: Joey Parrish --- docs/source/options/dash_stream_descriptors.rst | 7 +++++-- packager/app/packager_main.cc | 7 ++++--- packager/mpd/base/adaptation_set.cc | 16 ++++++++++++++-- packager/mpd/base/adaptation_set.h | 8 +++++++- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/docs/source/options/dash_stream_descriptors.rst b/docs/source/options/dash_stream_descriptors.rst index c5c646899b..a50f7fadaa 100644 --- a/docs/source/options/dash_stream_descriptors.rst +++ b/docs/source/options/dash_stream_descriptors.rst @@ -10,7 +10,10 @@ DASH specific stream descriptor fields :dash_roles (roles): - Optional semicolon separated list of values for DASH Role element. The + optional semicolon separated list of values for DASH Role element. The value should be one of: **caption**, **subtitle**, **main**, **alternate**, - **supplementary**, **commentary**, **description**, **dub** and **forced-subtitle** . + **supplementary**, **commentary**, **dub**, **description**, **sign**, + **metadata**, **enhanced-audio- intelligibility**, **emergency**, + **forced-subtitle**, **easyreader**, and **karaoke**. + See DASH (ISO/IEC 23009-1) specification for details. diff --git a/packager/app/packager_main.cc b/packager/app/packager_main.cc index adf67fc58f..34e27256a7 100644 --- a/packager/app/packager_main.cc +++ b/packager/app/packager_main.cc @@ -126,9 +126,10 @@ const char kUsage[] = " list of values for DASH Accessibility elements. The value should be\n" " in the format: scheme_id_uri=value.\n" " - dash_roles (roles): Optional semicolon separated list of values for\n" - " DASH Role elements. The value should be one of: caption, subtitle,\n" - " forced-subtitle, main, alternate, supplementary, commentary, \n" - " description and dub. See DASH\n" + " DASH Role elements. The value should be one of: caption, subtitle, \n" + " main, alternate, supplementary, commentary, dub, description, sign, \n" + " metadata, enhanced-audio- intelligibility, emergency, \n" + " forced-subtitle, easyreader, and karaoke. See DASH\n" " (ISO/IEC 23009-1) specification for details.\n" " - forced_subtitle: Optional boolean value (0|1). If set to 1 \n" " indicates that this stream is a Forced Narrative subtitle that \n" diff --git a/packager/mpd/base/adaptation_set.cc b/packager/mpd/base/adaptation_set.cc index bfcce9cfa9..4c9802dca0 100644 --- a/packager/mpd/base/adaptation_set.cc +++ b/packager/mpd/base/adaptation_set.cc @@ -59,10 +59,22 @@ std::string RoleToText(AdaptationSet::Role role) { return "commentary"; case AdaptationSet::kRoleDub: return "dub"; - case AdaptationSet::kRoleForcedSubtitle: - return "forced-subtitle"; case AdaptationSet::kRoleDescription: return "description"; + case AdaptationSet::kRoleSign: + return "sign"; + case AdaptationSet::kRoleMetadata: + return "metadata"; + case AdaptationSet::kRoleEnhancedAudioIntelligibility: + return "enhanced-audio-intelligibility"; + case AdaptationSet::kRoleEmergency: + return "emergency"; + case AdaptationSet::kRoleForcedSubtitle: + return "forced-subtitle"; + case AdaptationSet::kRoleEasyreader: + return "easyreader"; + case AdaptationSet::kRoleKaraoke: + return "karaoke"; default: return "unknown"; } diff --git a/packager/mpd/base/adaptation_set.h b/packager/mpd/base/adaptation_set.h index 372bd1bc20..7401254c72 100644 --- a/packager/mpd/base/adaptation_set.h +++ b/packager/mpd/base/adaptation_set.h @@ -43,8 +43,14 @@ class AdaptationSet { kRoleSupplementary, kRoleCommentary, kRoleDub, + kRoleDescription, + kRoleSign, + kRoleMetadata, + kRoleEnhancedAudioIntelligibility, + kRoleEmergency, kRoleForcedSubtitle, - kRoleDescription + kRoleEasyreader, + kRoleKaraoke, }; virtual ~AdaptationSet();