1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/mediaconvert/model/Ac3CodingMode.h> 7 #include <aws/core/utils/HashingUtils.h> 8 #include <aws/core/Globals.h> 9 #include <aws/core/utils/EnumParseOverflowContainer.h> 10 11 using namespace Aws::Utils; 12 13 14 namespace Aws 15 { 16 namespace MediaConvert 17 { 18 namespace Model 19 { 20 namespace Ac3CodingModeMapper 21 { 22 23 static const int CODING_MODE_1_0_HASH = HashingUtils::HashString("CODING_MODE_1_0"); 24 static const int CODING_MODE_1_1_HASH = HashingUtils::HashString("CODING_MODE_1_1"); 25 static const int CODING_MODE_2_0_HASH = HashingUtils::HashString("CODING_MODE_2_0"); 26 static const int CODING_MODE_3_2_LFE_HASH = HashingUtils::HashString("CODING_MODE_3_2_LFE"); 27 28 GetAc3CodingModeForName(const Aws::String & name)29 Ac3CodingMode GetAc3CodingModeForName(const Aws::String& name) 30 { 31 int hashCode = HashingUtils::HashString(name.c_str()); 32 if (hashCode == CODING_MODE_1_0_HASH) 33 { 34 return Ac3CodingMode::CODING_MODE_1_0; 35 } 36 else if (hashCode == CODING_MODE_1_1_HASH) 37 { 38 return Ac3CodingMode::CODING_MODE_1_1; 39 } 40 else if (hashCode == CODING_MODE_2_0_HASH) 41 { 42 return Ac3CodingMode::CODING_MODE_2_0; 43 } 44 else if (hashCode == CODING_MODE_3_2_LFE_HASH) 45 { 46 return Ac3CodingMode::CODING_MODE_3_2_LFE; 47 } 48 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 49 if(overflowContainer) 50 { 51 overflowContainer->StoreOverflow(hashCode, name); 52 return static_cast<Ac3CodingMode>(hashCode); 53 } 54 55 return Ac3CodingMode::NOT_SET; 56 } 57 GetNameForAc3CodingMode(Ac3CodingMode enumValue)58 Aws::String GetNameForAc3CodingMode(Ac3CodingMode enumValue) 59 { 60 switch(enumValue) 61 { 62 case Ac3CodingMode::CODING_MODE_1_0: 63 return "CODING_MODE_1_0"; 64 case Ac3CodingMode::CODING_MODE_1_1: 65 return "CODING_MODE_1_1"; 66 case Ac3CodingMode::CODING_MODE_2_0: 67 return "CODING_MODE_2_0"; 68 case Ac3CodingMode::CODING_MODE_3_2_LFE: 69 return "CODING_MODE_3_2_LFE"; 70 default: 71 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 72 if(overflowContainer) 73 { 74 return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); 75 } 76 77 return {}; 78 } 79 } 80 81 } // namespace Ac3CodingModeMapper 82 } // namespace Model 83 } // namespace MediaConvert 84 } // namespace Aws 85