/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace Rekognition { namespace Model { VideoMetadata::VideoMetadata() : m_codecHasBeenSet(false), m_durationMillis(0), m_durationMillisHasBeenSet(false), m_formatHasBeenSet(false), m_frameRate(0.0), m_frameRateHasBeenSet(false), m_frameHeight(0), m_frameHeightHasBeenSet(false), m_frameWidth(0), m_frameWidthHasBeenSet(false), m_colorRange(VideoColorRange::NOT_SET), m_colorRangeHasBeenSet(false) { } VideoMetadata::VideoMetadata(JsonView jsonValue) : m_codecHasBeenSet(false), m_durationMillis(0), m_durationMillisHasBeenSet(false), m_formatHasBeenSet(false), m_frameRate(0.0), m_frameRateHasBeenSet(false), m_frameHeight(0), m_frameHeightHasBeenSet(false), m_frameWidth(0), m_frameWidthHasBeenSet(false), m_colorRange(VideoColorRange::NOT_SET), m_colorRangeHasBeenSet(false) { *this = jsonValue; } VideoMetadata& VideoMetadata::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Codec")) { m_codec = jsonValue.GetString("Codec"); m_codecHasBeenSet = true; } if(jsonValue.ValueExists("DurationMillis")) { m_durationMillis = jsonValue.GetInt64("DurationMillis"); m_durationMillisHasBeenSet = true; } if(jsonValue.ValueExists("Format")) { m_format = jsonValue.GetString("Format"); m_formatHasBeenSet = true; } if(jsonValue.ValueExists("FrameRate")) { m_frameRate = jsonValue.GetDouble("FrameRate"); m_frameRateHasBeenSet = true; } if(jsonValue.ValueExists("FrameHeight")) { m_frameHeight = jsonValue.GetInt64("FrameHeight"); m_frameHeightHasBeenSet = true; } if(jsonValue.ValueExists("FrameWidth")) { m_frameWidth = jsonValue.GetInt64("FrameWidth"); m_frameWidthHasBeenSet = true; } if(jsonValue.ValueExists("ColorRange")) { m_colorRange = VideoColorRangeMapper::GetVideoColorRangeForName(jsonValue.GetString("ColorRange")); m_colorRangeHasBeenSet = true; } return *this; } JsonValue VideoMetadata::Jsonize() const { JsonValue payload; if(m_codecHasBeenSet) { payload.WithString("Codec", m_codec); } if(m_durationMillisHasBeenSet) { payload.WithInt64("DurationMillis", m_durationMillis); } if(m_formatHasBeenSet) { payload.WithString("Format", m_format); } if(m_frameRateHasBeenSet) { payload.WithDouble("FrameRate", m_frameRate); } if(m_frameHeightHasBeenSet) { payload.WithInt64("FrameHeight", m_frameHeight); } if(m_frameWidthHasBeenSet) { payload.WithInt64("FrameWidth", m_frameWidth); } if(m_colorRangeHasBeenSet) { payload.WithString("ColorRange", VideoColorRangeMapper::GetNameForVideoColorRange(m_colorRange)); } return payload; } } // namespace Model } // namespace Rekognition } // namespace Aws