From fb8cbebf2fd62720b65aeff841ad2950e73d8ebd Mon Sep 17 00:00:00 2001 From: aws-sdk-cpp-automation Date: Fri, 7 Jan 2022 20:01:13 +0000 Subject: [PATCH] This release adds support for selecting the Program Date Time (PDT) Clock source algorithm for HLS outputs. --- .../include/aws/core/VersionConfig.h | 4 +- .../aws/medialive/model/HlsGroupSettings.h | 119 +++++++++++++++--- .../medialive/model/HlsProgramDateTimeClock.h | 31 +++++ .../source/model/HlsGroupSettings.cpp | 16 +++ .../source/model/HlsProgramDateTimeClock.cpp | 70 +++++++++++ .../medialive-2017-10-14.normal.json | 15 ++- 6 files changed, 234 insertions(+), 21 deletions(-) create mode 100644 aws-cpp-sdk-medialive/include/aws/medialive/model/HlsProgramDateTimeClock.h create mode 100644 aws-cpp-sdk-medialive/source/model/HlsProgramDateTimeClock.cpp diff --git a/aws-cpp-sdk-core/include/aws/core/VersionConfig.h b/aws-cpp-sdk-core/include/aws/core/VersionConfig.h index 893dd7a4fc0..d7480f2e142 100644 --- a/aws-cpp-sdk-core/include/aws/core/VersionConfig.h +++ b/aws-cpp-sdk-core/include/aws/core/VersionConfig.h @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0. */ -#define AWS_SDK_VERSION_STRING "1.9.169" +#define AWS_SDK_VERSION_STRING "1.9.170" #define AWS_SDK_VERSION_MAJOR 1 #define AWS_SDK_VERSION_MINOR 9 -#define AWS_SDK_VERSION_PATCH 169 +#define AWS_SDK_VERSION_PATCH 170 diff --git a/aws-cpp-sdk-medialive/include/aws/medialive/model/HlsGroupSettings.h b/aws-cpp-sdk-medialive/include/aws/medialive/model/HlsGroupSettings.h index 51dc33e5038..e2f771e8126 100644 --- a/aws-cpp-sdk-medialive/include/aws/medialive/model/HlsGroupSettings.h +++ b/aws-cpp-sdk-medialive/include/aws/medialive/model/HlsGroupSettings.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1668,53 +1669,132 @@ SEGMENTS_ONLY: Does not generate any manifests for this output group. /** * Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The - * value is calculated as follows: either the program date and time are initialized - * using the input timecode source, or the time is initialized using the input - * timecode source and the date is initialized using the timestampOffset. + * value is calculated using the program date time clock. */ inline const HlsProgramDateTime& GetProgramDateTime() const{ return m_programDateTime; } /** * Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The - * value is calculated as follows: either the program date and time are initialized - * using the input timecode source, or the time is initialized using the input - * timecode source and the date is initialized using the timestampOffset. + * value is calculated using the program date time clock. */ inline bool ProgramDateTimeHasBeenSet() const { return m_programDateTimeHasBeenSet; } /** * Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The - * value is calculated as follows: either the program date and time are initialized - * using the input timecode source, or the time is initialized using the input - * timecode source and the date is initialized using the timestampOffset. + * value is calculated using the program date time clock. */ inline void SetProgramDateTime(const HlsProgramDateTime& value) { m_programDateTimeHasBeenSet = true; m_programDateTime = value; } /** * Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The - * value is calculated as follows: either the program date and time are initialized - * using the input timecode source, or the time is initialized using the input - * timecode source and the date is initialized using the timestampOffset. + * value is calculated using the program date time clock. */ inline void SetProgramDateTime(HlsProgramDateTime&& value) { m_programDateTimeHasBeenSet = true; m_programDateTime = std::move(value); } /** * Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The - * value is calculated as follows: either the program date and time are initialized - * using the input timecode source, or the time is initialized using the input - * timecode source and the date is initialized using the timestampOffset. + * value is calculated using the program date time clock. */ inline HlsGroupSettings& WithProgramDateTime(const HlsProgramDateTime& value) { SetProgramDateTime(value); return *this;} /** * Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The - * value is calculated as follows: either the program date and time are initialized - * using the input timecode source, or the time is initialized using the input - * timecode source and the date is initialized using the timestampOffset. + * value is calculated using the program date time clock. */ inline HlsGroupSettings& WithProgramDateTime(HlsProgramDateTime&& value) { SetProgramDateTime(std::move(value)); return *this;} + /** + * Specifies the algorithm used to drive the HLS EXT-X-PROGRAM-DATE-TIME clock. + * Options include: + +INITIALIZE_FROM_OUTPUT_TIMECODE: The PDT clock is initialized + * as a function of the first output timecode, then incremented by the EXTINF + * duration of each encoded segment. + +SYSTEM_CLOCK: The PDT clock is initialized as + * a function of the UTC wall clock, then incremented by the EXTINF duration of + * each encoded segment. If the PDT clock diverges from the wall clock by more than + * 500ms, it is resynchronized to the wall clock. + */ + inline const HlsProgramDateTimeClock& GetProgramDateTimeClock() const{ return m_programDateTimeClock; } + + /** + * Specifies the algorithm used to drive the HLS EXT-X-PROGRAM-DATE-TIME clock. + * Options include: + +INITIALIZE_FROM_OUTPUT_TIMECODE: The PDT clock is initialized + * as a function of the first output timecode, then incremented by the EXTINF + * duration of each encoded segment. + +SYSTEM_CLOCK: The PDT clock is initialized as + * a function of the UTC wall clock, then incremented by the EXTINF duration of + * each encoded segment. If the PDT clock diverges from the wall clock by more than + * 500ms, it is resynchronized to the wall clock. + */ + inline bool ProgramDateTimeClockHasBeenSet() const { return m_programDateTimeClockHasBeenSet; } + + /** + * Specifies the algorithm used to drive the HLS EXT-X-PROGRAM-DATE-TIME clock. + * Options include: + +INITIALIZE_FROM_OUTPUT_TIMECODE: The PDT clock is initialized + * as a function of the first output timecode, then incremented by the EXTINF + * duration of each encoded segment. + +SYSTEM_CLOCK: The PDT clock is initialized as + * a function of the UTC wall clock, then incremented by the EXTINF duration of + * each encoded segment. If the PDT clock diverges from the wall clock by more than + * 500ms, it is resynchronized to the wall clock. + */ + inline void SetProgramDateTimeClock(const HlsProgramDateTimeClock& value) { m_programDateTimeClockHasBeenSet = true; m_programDateTimeClock = value; } + + /** + * Specifies the algorithm used to drive the HLS EXT-X-PROGRAM-DATE-TIME clock. + * Options include: + +INITIALIZE_FROM_OUTPUT_TIMECODE: The PDT clock is initialized + * as a function of the first output timecode, then incremented by the EXTINF + * duration of each encoded segment. + +SYSTEM_CLOCK: The PDT clock is initialized as + * a function of the UTC wall clock, then incremented by the EXTINF duration of + * each encoded segment. If the PDT clock diverges from the wall clock by more than + * 500ms, it is resynchronized to the wall clock. + */ + inline void SetProgramDateTimeClock(HlsProgramDateTimeClock&& value) { m_programDateTimeClockHasBeenSet = true; m_programDateTimeClock = std::move(value); } + + /** + * Specifies the algorithm used to drive the HLS EXT-X-PROGRAM-DATE-TIME clock. + * Options include: + +INITIALIZE_FROM_OUTPUT_TIMECODE: The PDT clock is initialized + * as a function of the first output timecode, then incremented by the EXTINF + * duration of each encoded segment. + +SYSTEM_CLOCK: The PDT clock is initialized as + * a function of the UTC wall clock, then incremented by the EXTINF duration of + * each encoded segment. If the PDT clock diverges from the wall clock by more than + * 500ms, it is resynchronized to the wall clock. + */ + inline HlsGroupSettings& WithProgramDateTimeClock(const HlsProgramDateTimeClock& value) { SetProgramDateTimeClock(value); return *this;} + + /** + * Specifies the algorithm used to drive the HLS EXT-X-PROGRAM-DATE-TIME clock. + * Options include: + +INITIALIZE_FROM_OUTPUT_TIMECODE: The PDT clock is initialized + * as a function of the first output timecode, then incremented by the EXTINF + * duration of each encoded segment. + +SYSTEM_CLOCK: The PDT clock is initialized as + * a function of the UTC wall clock, then incremented by the EXTINF duration of + * each encoded segment. If the PDT clock diverges from the wall clock by more than + * 500ms, it is resynchronized to the wall clock. + */ + inline HlsGroupSettings& WithProgramDateTimeClock(HlsProgramDateTimeClock&& value) { SetProgramDateTimeClock(std::move(value)); return *this;} + + /** * Period of insertion of EXT-X-PROGRAM-DATE-TIME entry, in seconds. */ @@ -2232,6 +2312,9 @@ SINGLE_FILE: Applies only if Mode field is VOD. Emit the program as a HlsProgramDateTime m_programDateTime; bool m_programDateTimeHasBeenSet; + HlsProgramDateTimeClock m_programDateTimeClock; + bool m_programDateTimeClockHasBeenSet; + int m_programDateTimePeriod; bool m_programDateTimePeriodHasBeenSet; diff --git a/aws-cpp-sdk-medialive/include/aws/medialive/model/HlsProgramDateTimeClock.h b/aws-cpp-sdk-medialive/include/aws/medialive/model/HlsProgramDateTimeClock.h new file mode 100644 index 00000000000..be7f6b9cb4e --- /dev/null +++ b/aws-cpp-sdk-medialive/include/aws/medialive/model/HlsProgramDateTimeClock.h @@ -0,0 +1,31 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#pragma once +#include +#include + +namespace Aws +{ +namespace MediaLive +{ +namespace Model +{ + enum class HlsProgramDateTimeClock + { + NOT_SET, + INITIALIZE_FROM_OUTPUT_TIMECODE, + SYSTEM_CLOCK + }; + +namespace HlsProgramDateTimeClockMapper +{ +AWS_MEDIALIVE_API HlsProgramDateTimeClock GetHlsProgramDateTimeClockForName(const Aws::String& name); + +AWS_MEDIALIVE_API Aws::String GetNameForHlsProgramDateTimeClock(HlsProgramDateTimeClock value); +} // namespace HlsProgramDateTimeClockMapper +} // namespace Model +} // namespace MediaLive +} // namespace Aws diff --git a/aws-cpp-sdk-medialive/source/model/HlsGroupSettings.cpp b/aws-cpp-sdk-medialive/source/model/HlsGroupSettings.cpp index ca62b044fc1..30e61ef596f 100644 --- a/aws-cpp-sdk-medialive/source/model/HlsGroupSettings.cpp +++ b/aws-cpp-sdk-medialive/source/model/HlsGroupSettings.cpp @@ -71,6 +71,8 @@ HlsGroupSettings::HlsGroupSettings() : m_outputSelectionHasBeenSet(false), m_programDateTime(HlsProgramDateTime::NOT_SET), m_programDateTimeHasBeenSet(false), + m_programDateTimeClock(HlsProgramDateTimeClock::NOT_SET), + m_programDateTimeClockHasBeenSet(false), m_programDateTimePeriod(0), m_programDateTimePeriodHasBeenSet(false), m_redundantManifest(HlsRedundantManifest::NOT_SET), @@ -147,6 +149,8 @@ HlsGroupSettings::HlsGroupSettings(JsonView jsonValue) : m_outputSelectionHasBeenSet(false), m_programDateTime(HlsProgramDateTime::NOT_SET), m_programDateTimeHasBeenSet(false), + m_programDateTimeClock(HlsProgramDateTimeClock::NOT_SET), + m_programDateTimeClockHasBeenSet(false), m_programDateTimePeriod(0), m_programDateTimePeriodHasBeenSet(false), m_redundantManifest(HlsRedundantManifest::NOT_SET), @@ -403,6 +407,13 @@ HlsGroupSettings& HlsGroupSettings::operator =(JsonView jsonValue) m_programDateTimeHasBeenSet = true; } + if(jsonValue.ValueExists("programDateTimeClock")) + { + m_programDateTimeClock = HlsProgramDateTimeClockMapper::GetHlsProgramDateTimeClockForName(jsonValue.GetString("programDateTimeClock")); + + m_programDateTimeClockHasBeenSet = true; + } + if(jsonValue.ValueExists("programDateTimePeriod")) { m_programDateTimePeriod = jsonValue.GetInteger("programDateTimePeriod"); @@ -665,6 +676,11 @@ JsonValue HlsGroupSettings::Jsonize() const payload.WithString("programDateTime", HlsProgramDateTimeMapper::GetNameForHlsProgramDateTime(m_programDateTime)); } + if(m_programDateTimeClockHasBeenSet) + { + payload.WithString("programDateTimeClock", HlsProgramDateTimeClockMapper::GetNameForHlsProgramDateTimeClock(m_programDateTimeClock)); + } + if(m_programDateTimePeriodHasBeenSet) { payload.WithInteger("programDateTimePeriod", m_programDateTimePeriod); diff --git a/aws-cpp-sdk-medialive/source/model/HlsProgramDateTimeClock.cpp b/aws-cpp-sdk-medialive/source/model/HlsProgramDateTimeClock.cpp new file mode 100644 index 00000000000..ecc37f2fb8a --- /dev/null +++ b/aws-cpp-sdk-medialive/source/model/HlsProgramDateTimeClock.cpp @@ -0,0 +1,70 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ + +#include +#include +#include +#include + +using namespace Aws::Utils; + + +namespace Aws +{ + namespace MediaLive + { + namespace Model + { + namespace HlsProgramDateTimeClockMapper + { + + static const int INITIALIZE_FROM_OUTPUT_TIMECODE_HASH = HashingUtils::HashString("INITIALIZE_FROM_OUTPUT_TIMECODE"); + static const int SYSTEM_CLOCK_HASH = HashingUtils::HashString("SYSTEM_CLOCK"); + + + HlsProgramDateTimeClock GetHlsProgramDateTimeClockForName(const Aws::String& name) + { + int hashCode = HashingUtils::HashString(name.c_str()); + if (hashCode == INITIALIZE_FROM_OUTPUT_TIMECODE_HASH) + { + return HlsProgramDateTimeClock::INITIALIZE_FROM_OUTPUT_TIMECODE; + } + else if (hashCode == SYSTEM_CLOCK_HASH) + { + return HlsProgramDateTimeClock::SYSTEM_CLOCK; + } + EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); + if(overflowContainer) + { + overflowContainer->StoreOverflow(hashCode, name); + return static_cast(hashCode); + } + + return HlsProgramDateTimeClock::NOT_SET; + } + + Aws::String GetNameForHlsProgramDateTimeClock(HlsProgramDateTimeClock enumValue) + { + switch(enumValue) + { + case HlsProgramDateTimeClock::INITIALIZE_FROM_OUTPUT_TIMECODE: + return "INITIALIZE_FROM_OUTPUT_TIMECODE"; + case HlsProgramDateTimeClock::SYSTEM_CLOCK: + return "SYSTEM_CLOCK"; + default: + EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); + if(overflowContainer) + { + return overflowContainer->RetrieveOverflow(static_cast(enumValue)); + } + + return {}; + } + } + + } // namespace HlsProgramDateTimeClockMapper + } // namespace Model + } // namespace MediaLive +} // namespace Aws diff --git a/code-generation/api-descriptions/medialive-2017-10-14.normal.json b/code-generation/api-descriptions/medialive-2017-10-14.normal.json index 24afd64e61a..cb606f76431 100644 --- a/code-generation/api-descriptions/medialive-2017-10-14.normal.json +++ b/code-generation/api-descriptions/medialive-2017-10-14.normal.json @@ -8488,7 +8488,12 @@ "ProgramDateTime": { "shape": "HlsProgramDateTime", "locationName": "programDateTime", - "documentation": "Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The value is calculated as follows: either the program date and time are initialized using the input timecode source, or the time is initialized using the input timecode source and the date is initialized using the timestampOffset." + "documentation": "Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. The value is calculated using the program date time clock." + }, + "ProgramDateTimeClock": { + "shape": "HlsProgramDateTimeClock", + "locationName": "programDateTimeClock", + "documentation": "Specifies the algorithm used to drive the HLS EXT-X-PROGRAM-DATE-TIME clock. Options include:\n\nINITIALIZE_FROM_OUTPUT_TIMECODE: The PDT clock is initialized as a function of the first output timecode, then incremented by the EXTINF duration of each encoded segment.\n\nSYSTEM_CLOCK: The PDT clock is initialized as a function of the UTC wall clock, then incremented by the EXTINF duration of each encoded segment. If the PDT clock diverges from the wall clock by more than 500ms, it is resynchronized to the wall clock." }, "ProgramDateTimePeriod": { "shape": "__integerMin0Max3600", @@ -8739,6 +8744,14 @@ "INCLUDE" ] }, + "HlsProgramDateTimeClock": { + "type": "string", + "documentation": "Hls Program Date Time Clock", + "enum": [ + "INITIALIZE_FROM_OUTPUT_TIMECODE", + "SYSTEM_CLOCK" + ] + }, "HlsRedundantManifest": { "type": "string", "documentation": "Hls Redundant Manifest",