1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef POST_PROCESSING_UTILS_H
17 #define POST_PROCESSING_UTILS_H
18 
19 #include <type_traits>
20 #include "avcodec_log.h"
21 
22 constexpr OHOS::HiviewDFX::HiLogLabel LogLabel(const char* tag = "PostProcessing")
23 {
24     auto label = OHOS::HiviewDFX::HiLogLabel{LOG_CORE, LOG_DOMAIN_FRAMEWORK, tag};
25     return label;
26 }
27 
28 namespace OHOS {
29 namespace MediaAVCodec {
30 namespace PostProcessing {
31 
32 struct CapabilityInfo {
33     int32_t colorSpaceType;
34     int32_t metadataType;
35     int32_t pixelFormat;
36 };
37 
38 template<typename... Types>
39 struct TypeArray {
40     using Array = std::tuple<Types...>;
41 
42     template<size_t I>
43     using Get = std::tuple_element_t<I, Array>;
44 
45     static constexpr size_t size = sizeof...(Types);
46 };
47 
48 template<typename T, T V, typename = std::enable_if_t<std::is_enum_v<T>>>
49 struct EnumerationValue {
50     using UnderlyingType = std::underlying_type_t<T>;
51     static constexpr UnderlyingType value = static_cast<UnderlyingType>(V);
52 };
53 
54 } // namespace PostProcessing
55 } // namespace MediaAVCodec
56 } // namespace OHOS
57 
58 #endif // POST_PROCESSING_UTILS_H