1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/medialive/model/H265LookAheadRateControl.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 MediaLive 17 { 18 namespace Model 19 { 20 namespace H265LookAheadRateControlMapper 21 { 22 23 static const int HIGH_HASH = HashingUtils::HashString("HIGH"); 24 static const int LOW_HASH = HashingUtils::HashString("LOW"); 25 static const int MEDIUM_HASH = HashingUtils::HashString("MEDIUM"); 26 27 GetH265LookAheadRateControlForName(const Aws::String & name)28 H265LookAheadRateControl GetH265LookAheadRateControlForName(const Aws::String& name) 29 { 30 int hashCode = HashingUtils::HashString(name.c_str()); 31 if (hashCode == HIGH_HASH) 32 { 33 return H265LookAheadRateControl::HIGH; 34 } 35 else if (hashCode == LOW_HASH) 36 { 37 return H265LookAheadRateControl::LOW; 38 } 39 else if (hashCode == MEDIUM_HASH) 40 { 41 return H265LookAheadRateControl::MEDIUM; 42 } 43 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 44 if(overflowContainer) 45 { 46 overflowContainer->StoreOverflow(hashCode, name); 47 return static_cast<H265LookAheadRateControl>(hashCode); 48 } 49 50 return H265LookAheadRateControl::NOT_SET; 51 } 52 GetNameForH265LookAheadRateControl(H265LookAheadRateControl enumValue)53 Aws::String GetNameForH265LookAheadRateControl(H265LookAheadRateControl enumValue) 54 { 55 switch(enumValue) 56 { 57 case H265LookAheadRateControl::HIGH: 58 return "HIGH"; 59 case H265LookAheadRateControl::LOW: 60 return "LOW"; 61 case H265LookAheadRateControl::MEDIUM: 62 return "MEDIUM"; 63 default: 64 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 65 if(overflowContainer) 66 { 67 return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); 68 } 69 70 return {}; 71 } 72 } 73 74 } // namespace H265LookAheadRateControlMapper 75 } // namespace Model 76 } // namespace MediaLive 77 } // namespace Aws 78