Skip to content

Commit

Permalink
This release adds support for selecting the Program Date Time (PDT) C…
Browse files Browse the repository at this point in the history
…lock source algorithm for HLS outputs.
  • Loading branch information
aws-sdk-cpp-automation committed Jan 7, 2022
1 parent a2512bd commit fb8cbeb
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 21 deletions.
4 changes: 2 additions & 2 deletions aws-cpp-sdk-core/include/aws/core/VersionConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
119 changes: 101 additions & 18 deletions aws-cpp-sdk-medialive/include/aws/medialive/model/HlsGroupSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <aws/medialive/model/HlsMode.h>
#include <aws/medialive/model/HlsOutputSelection.h>
#include <aws/medialive/model/HlsProgramDateTime.h>
#include <aws/medialive/model/HlsProgramDateTimeClock.h>
#include <aws/medialive/model/HlsRedundantManifest.h>
#include <aws/medialive/model/HlsSegmentationMode.h>
#include <aws/medialive/model/HlsStreamInfResolution.h>
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#pragma once
#include <aws/medialive/MediaLive_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

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
16 changes: 16 additions & 0 deletions aws-cpp-sdk-medialive/source/model/HlsGroupSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
70 changes: 70 additions & 0 deletions aws-cpp-sdk-medialive/source/model/HlsProgramDateTimeClock.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/

#include <aws/medialive/model/HlsProgramDateTimeClock.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#include <aws/core/utils/EnumParseOverflowContainer.h>

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<HlsProgramDateTimeClock>(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<int>(enumValue));
}

return {};
}
}

} // namespace HlsProgramDateTimeClockMapper
} // namespace Model
} // namespace MediaLive
} // namespace Aws
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit fb8cbeb

Please sign in to comment.