* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CODEC_KEYVALUE
#define CODEC_KEYVALUE
#include <type_traits>
namespace OHOS::HDI::Codec {
inline constexpr char KEY_RESOLUTION[] = "resolution";
inline constexpr char KEY_FRAME_RATE[] = "frameRate";
inline constexpr char KEY_HIGH_PERF_FLAG[] = "highPerfFlag";
inline constexpr char KEY_CALLER_NAME[] = "callerName";
inline constexpr char KEY_UV_ORDER[] = "uvOrder";
inline constexpr char KEY_INPUT_STREAM_ERROR[] = "inputStreamError";
inline constexpr char KEY_CONSUMER_USAGE[] = "consumerUsage";
inline constexpr char KEY_PROFILE[] = "profile";
inline constexpr char KEY_I_FRAME_INTERVAL[] = "iFrameInterval";
inline constexpr char KEY_REQUEST_IDR[] = "requestIDR";
inline constexpr char KEY_BITRATE_CONTROL_MODE[] = "bitrateControlMode";
inline constexpr char KEY_TARGET_BITRATE[] = "targetBitrate";
inline constexpr char KEY_TARGET_QUALITY[] = "targetQuality";
inline constexpr char KEY_TARGET_QP[] = "targetQp";
inline constexpr char KEY_COLOR_ASPECTS[] = "colorAspects";
inline constexpr char KEY_OPERATING_RATE[] = "operatingRate";
inline constexpr char KEY_SORTING_MODE[] = "sortingMode";
inline constexpr char KEY_NUM_OF_GS[] = "numOfGS";
inline constexpr char KEY_SH_PRDER[] = "shOrder";
inline constexpr char KEY_MIN_MAX[] = "minMax";
enum class SampleFlag : uint32_t {
EOS = 0x1,
CSD = 0x2,
IFRAME = 0x4,
};
enum ComponentType {
VIDEO_DECODER,
VIDEO_ENCODER,
THREEDGS_SORTING,
};
enum Standard {
AVC,
HEVC,
VVC,
VP9,
AV1,
PROVIVID,
};
struct Resolution {
uint32_t w = 0;
uint32_t h = 0;
};
static_assert(std::is_trivially_copyable_v<Resolution>);
struct ColorAspects {
bool range = false;
uint8_t primaries = 2;
uint8_t transfer = 2;
uint8_t matrixCoeffs = 2;
};
static_assert(std::is_trivially_copyable_v<ColorAspects>);
enum AvcProfile {
AVC_PROFILE_BASELINE,
AVC_PROFILE_MAIN,
AVC_PROFILE_HIGH
};
enum HevcProfile {
HEVC_PROFILE_MAIN,
HEVC_PROFILE_MAIN_10
};
enum BitrateControlMode {
VBR,
CBR,
CQ,
SQR,
CBR_VIDEOCALL,
CRF,
};
enum SortingMode {
SLOW,
MEDIUM,
FAST,
VERY_FAST,
};
}
#endif