1f6603c60Sopenharmony_ci/* 2f6603c60Sopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 3f6603c60Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4f6603c60Sopenharmony_ci * you may not use this file except in compliance with the License. 5f6603c60Sopenharmony_ci * You may obtain a copy of the License at 6f6603c60Sopenharmony_ci * 7f6603c60Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8f6603c60Sopenharmony_ci * 9f6603c60Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10f6603c60Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11f6603c60Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12f6603c60Sopenharmony_ci * See the License for the specific language governing permissions and 13f6603c60Sopenharmony_ci * limitations under the License. 14f6603c60Sopenharmony_ci */ 15f6603c60Sopenharmony_ci#include <string> 16f6603c60Sopenharmony_ci#include <securec.h> 17f6603c60Sopenharmony_ci#include "gtest/gtest.h" 18f6603c60Sopenharmony_ci#include "native_avcodec_videoencoder.h" 19f6603c60Sopenharmony_ci#include "native_averrors.h" 20f6603c60Sopenharmony_ci#include "native_avcodec_base.h" 21f6603c60Sopenharmony_ci#include "avcodec_codec_name.h" 22f6603c60Sopenharmony_ci#include "native_avcapability.h" 23f6603c60Sopenharmony_ci 24f6603c60Sopenharmony_cinamespace { 25f6603c60Sopenharmony_ciOH_AVCodec *venc_ = NULL; 26f6603c60Sopenharmony_ciOH_AVCapability *cap = nullptr; 27f6603c60Sopenharmony_ciOH_AVCapability *cap_hevc = nullptr; 28f6603c60Sopenharmony_ciconstexpr uint32_t CODEC_NAME_SIZE = 128; 29f6603c60Sopenharmony_cichar g_codecName[CODEC_NAME_SIZE] = {}; 30f6603c60Sopenharmony_cichar g_codecNameHEVC[CODEC_NAME_SIZE] = {}; 31f6603c60Sopenharmony_ciOH_AVFormat *format; 32f6603c60Sopenharmony_ci} // namespace 33f6603c60Sopenharmony_cinamespace OHOS { 34f6603c60Sopenharmony_cinamespace Media { 35f6603c60Sopenharmony_ciclass HwCapabilityNdkTest : public testing::Test { 36f6603c60Sopenharmony_cipublic: 37f6603c60Sopenharmony_ci static void SetUpTestCase(); 38f6603c60Sopenharmony_ci static void TearDownTestCase(); 39f6603c60Sopenharmony_ci void SetUp() override; 40f6603c60Sopenharmony_ci void TearDown() override; 41f6603c60Sopenharmony_ci void InputFunc(); 42f6603c60Sopenharmony_ci void OutputFunc(); 43f6603c60Sopenharmony_ci void Release(); 44f6603c60Sopenharmony_ci int32_t Stop(); 45f6603c60Sopenharmony_ci}; 46f6603c60Sopenharmony_ci} // namespace Media 47f6603c60Sopenharmony_ci} // namespace OHOS 48f6603c60Sopenharmony_ci 49f6603c60Sopenharmony_ciusing namespace std; 50f6603c60Sopenharmony_ciusing namespace OHOS; 51f6603c60Sopenharmony_ciusing namespace OHOS::Media; 52f6603c60Sopenharmony_ciusing namespace testing::ext; 53f6603c60Sopenharmony_ci 54f6603c60Sopenharmony_civoid HwCapabilityNdkTest::SetUpTestCase() 55f6603c60Sopenharmony_ci{ 56f6603c60Sopenharmony_ci cap = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 57f6603c60Sopenharmony_ci const char *tmpCodecName = OH_AVCapability_GetName(cap); 58f6603c60Sopenharmony_ci if (memcpy_s(g_codecName, sizeof(g_codecName), tmpCodecName, strlen(tmpCodecName)) != 0) 59f6603c60Sopenharmony_ci cout << "memcpy failed" << endl; 60f6603c60Sopenharmony_ci cout << "codecname: " << g_codecName << endl; 61f6603c60Sopenharmony_ci cap_hevc = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_HEVC, true, HARDWARE); 62f6603c60Sopenharmony_ci const char *tmpCodecNameHevc = OH_AVCapability_GetName(cap_hevc); 63f6603c60Sopenharmony_ci if (memcpy_s(g_codecNameHEVC, sizeof(g_codecNameHEVC), tmpCodecNameHevc, strlen(tmpCodecNameHevc)) != 0) 64f6603c60Sopenharmony_ci cout << "memcpy failed" << endl; 65f6603c60Sopenharmony_ci cout << "codecname_hevc: " << g_codecNameHEVC << endl; 66f6603c60Sopenharmony_ci} 67f6603c60Sopenharmony_civoid HwCapabilityNdkTest::TearDownTestCase() {} 68f6603c60Sopenharmony_civoid HwCapabilityNdkTest::SetUp() {} 69f6603c60Sopenharmony_civoid HwCapabilityNdkTest::TearDown() 70f6603c60Sopenharmony_ci{ 71f6603c60Sopenharmony_ci if (venc_ != NULL) { 72f6603c60Sopenharmony_ci OH_VideoEncoder_Destroy(venc_); 73f6603c60Sopenharmony_ci venc_ = nullptr; 74f6603c60Sopenharmony_ci } 75f6603c60Sopenharmony_ci if (format != nullptr) { 76f6603c60Sopenharmony_ci OH_AVFormat_Destroy(format); 77f6603c60Sopenharmony_ci format = nullptr; 78f6603c60Sopenharmony_ci } 79f6603c60Sopenharmony_ci} 80f6603c60Sopenharmony_cinamespace { 81f6603c60Sopenharmony_ci/** 82f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0010 83f6603c60Sopenharmony_ci * @tc.name : OH_AVCapability_IsFeatureSupported para error 84f6603c60Sopenharmony_ci * @tc.desc : api test 85f6603c60Sopenharmony_ci */ 86f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0010, TestSize.Level2) 87f6603c60Sopenharmony_ci{ 88f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 89f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 90f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, static_cast<OH_AVCapabilityFeature>(4))); 91f6603c60Sopenharmony_ci} 92f6603c60Sopenharmony_ci 93f6603c60Sopenharmony_ci/** 94f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0011 95f6603c60Sopenharmony_ci * @tc.name : 解码,是否支持分层编码 96f6603c60Sopenharmony_ci * @tc.desc : api test 97f6603c60Sopenharmony_ci */ 98f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0011, TestSize.Level2) 99f6603c60Sopenharmony_ci{ 100f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, HARDWARE); 101f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 102f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, VIDEO_ENCODER_TEMPORAL_SCALABILITY)); 103f6603c60Sopenharmony_ci} 104f6603c60Sopenharmony_ci 105f6603c60Sopenharmony_ci/** 106f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0012 107f6603c60Sopenharmony_ci * @tc.name : 编码,是否支持分层编码 108f6603c60Sopenharmony_ci * @tc.desc : api test 109f6603c60Sopenharmony_ci */ 110f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0012, TestSize.Level1) 111f6603c60Sopenharmony_ci{ 112f6603c60Sopenharmony_ci if (!access("/system/lib64/media/", 0)) { 113f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 114f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 115f6603c60Sopenharmony_ci ASSERT_EQ(true, OH_AVCapability_IsFeatureSupported(capability, VIDEO_ENCODER_TEMPORAL_SCALABILITY)); 116f6603c60Sopenharmony_ci } else { 117f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 118f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 119f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, VIDEO_ENCODER_TEMPORAL_SCALABILITY)); 120f6603c60Sopenharmony_ci } 121f6603c60Sopenharmony_ci} 122f6603c60Sopenharmony_ci 123f6603c60Sopenharmony_ci/** 124f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0013 125f6603c60Sopenharmony_ci * @tc.name : 解码,是否支持LTR 126f6603c60Sopenharmony_ci * @tc.desc : api test 127f6603c60Sopenharmony_ci */ 128f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0013, TestSize.Level2) 129f6603c60Sopenharmony_ci{ 130f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, HARDWARE); 131f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 132f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, VIDEO_ENCODER_LONG_TERM_REFERENCE)); 133f6603c60Sopenharmony_ci} 134f6603c60Sopenharmony_ci 135f6603c60Sopenharmony_ci/** 136f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0014 137f6603c60Sopenharmony_ci * @tc.name : 编码,是否支持LTR 138f6603c60Sopenharmony_ci * @tc.desc : api test 139f6603c60Sopenharmony_ci */ 140f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0014, TestSize.Level1) 141f6603c60Sopenharmony_ci{ 142f6603c60Sopenharmony_ci if (!access("/system/lib64/media/", 0)) { 143f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 144f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 145f6603c60Sopenharmony_ci ASSERT_EQ(true, OH_AVCapability_IsFeatureSupported(capability, VIDEO_ENCODER_LONG_TERM_REFERENCE)); 146f6603c60Sopenharmony_ci } else { 147f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 148f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 149f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, VIDEO_ENCODER_LONG_TERM_REFERENCE)); 150f6603c60Sopenharmony_ci } 151f6603c60Sopenharmony_ci} 152f6603c60Sopenharmony_ci 153f6603c60Sopenharmony_ci/** 154f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0015 155f6603c60Sopenharmony_ci * @tc.name : 软解,是否支持低时延 156f6603c60Sopenharmony_ci * @tc.desc : api test 157f6603c60Sopenharmony_ci */ 158f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0015, TestSize.Level2) 159f6603c60Sopenharmony_ci{ 160f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, SOFTWARE); 161f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 162f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, VIDEO_LOW_LATENCY)); 163f6603c60Sopenharmony_ci} 164f6603c60Sopenharmony_ci 165f6603c60Sopenharmony_ci/** 166f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0016 167f6603c60Sopenharmony_ci * @tc.name : 硬解,是否支持低时延 168f6603c60Sopenharmony_ci * @tc.desc : api test 169f6603c60Sopenharmony_ci */ 170f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0016, TestSize.Level2) 171f6603c60Sopenharmony_ci{ 172f6603c60Sopenharmony_ci if (!access("/system/lib64/media/", 0)) { 173f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory( 174f6603c60Sopenharmony_ci OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, HARDWARE); 175f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 176f6603c60Sopenharmony_ci ASSERT_EQ(true, OH_AVCapability_IsFeatureSupported(capability, VIDEO_LOW_LATENCY)); 177f6603c60Sopenharmony_ci } else { 178f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory( 179f6603c60Sopenharmony_ci OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, HARDWARE); 180f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 181f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, VIDEO_LOW_LATENCY)); 182f6603c60Sopenharmony_ci } 183f6603c60Sopenharmony_ci} 184f6603c60Sopenharmony_ci 185f6603c60Sopenharmony_ci/** 186f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0017 187f6603c60Sopenharmony_ci * @tc.name : 编码,是否支持低时延 188f6603c60Sopenharmony_ci * @tc.desc : api test 189f6603c60Sopenharmony_ci */ 190f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0017, TestSize.Level1) 191f6603c60Sopenharmony_ci{ 192f6603c60Sopenharmony_ci if (!access("/system/lib64/media/", 0)) { 193f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 194f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 195f6603c60Sopenharmony_ci ASSERT_EQ(true, OH_AVCapability_IsFeatureSupported(capability, VIDEO_LOW_LATENCY)); 196f6603c60Sopenharmony_ci } else { 197f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 198f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 199f6603c60Sopenharmony_ci ASSERT_EQ(false, OH_AVCapability_IsFeatureSupported(capability, VIDEO_LOW_LATENCY)); 200f6603c60Sopenharmony_ci } 201f6603c60Sopenharmony_ci} 202f6603c60Sopenharmony_ci 203f6603c60Sopenharmony_ci/** 204f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0018 205f6603c60Sopenharmony_ci * @tc.name : OH_AVCapability_GetFeatureProperties para error 206f6603c60Sopenharmony_ci * @tc.desc : api test 207f6603c60Sopenharmony_ci */ 208f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0018, TestSize.Level2) 209f6603c60Sopenharmony_ci{ 210f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 211f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 212f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, static_cast<OH_AVCapabilityFeature>(4))); 213f6603c60Sopenharmony_ci 214f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, static_cast<OH_AVCapabilityFeature>(-1))); 215f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, static_cast<OH_AVCapabilityFeature>(100))); 216f6603c60Sopenharmony_ci 217f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_ENCODER_TEMPORAL_SCALABILITY)); 218f6603c60Sopenharmony_ci} 219f6603c60Sopenharmony_ci 220f6603c60Sopenharmony_ci/** 221f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0019 222f6603c60Sopenharmony_ci * @tc.name : 解码,查询分层编码的能力值 223f6603c60Sopenharmony_ci * @tc.desc : api test 224f6603c60Sopenharmony_ci */ 225f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0019, TestSize.Level2) 226f6603c60Sopenharmony_ci{ 227f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, HARDWARE); 228f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 229f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_ENCODER_TEMPORAL_SCALABILITY)); 230f6603c60Sopenharmony_ci} 231f6603c60Sopenharmony_ci 232f6603c60Sopenharmony_ci/** 233f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0020 234f6603c60Sopenharmony_ci * @tc.name : 编码,查询分层编码的能力值 235f6603c60Sopenharmony_ci * @tc.desc : api test 236f6603c60Sopenharmony_ci */ 237f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0020, TestSize.Level1) 238f6603c60Sopenharmony_ci{ 239f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 240f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 241f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_ENCODER_TEMPORAL_SCALABILITY)); 242f6603c60Sopenharmony_ci} 243f6603c60Sopenharmony_ci 244f6603c60Sopenharmony_ci/** 245f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0021 246f6603c60Sopenharmony_ci * @tc.name : 解码,查询LTR能力值 247f6603c60Sopenharmony_ci * @tc.desc : api test 248f6603c60Sopenharmony_ci */ 249f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0021, TestSize.Level2) 250f6603c60Sopenharmony_ci{ 251f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, HARDWARE); 252f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 253f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_ENCODER_LONG_TERM_REFERENCE)); 254f6603c60Sopenharmony_ci} 255f6603c60Sopenharmony_ci 256f6603c60Sopenharmony_ci/** 257f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0022 258f6603c60Sopenharmony_ci * @tc.name : 编码,查询LTR的能力值 259f6603c60Sopenharmony_ci * @tc.desc : api test 260f6603c60Sopenharmony_ci */ 261f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0022, TestSize.Level1) 262f6603c60Sopenharmony_ci{ 263f6603c60Sopenharmony_ci if (!access("/system/lib64/media/", 0)) { 264f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 265f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 266f6603c60Sopenharmony_ci format = OH_AVCapability_GetFeatureProperties(capability, VIDEO_ENCODER_LONG_TERM_REFERENCE); 267f6603c60Sopenharmony_ci ASSERT_NE(nullptr, format); 268f6603c60Sopenharmony_ci int ltrnum = 0; 269f6603c60Sopenharmony_ci EXPECT_EQ(OH_AVFormat_GetIntValue( 270f6603c60Sopenharmony_ci format, OH_FEATURE_PROPERTY_KEY_VIDEO_ENCODER_MAX_LTR_FRAME_COUNT, <rnum), true); 271f6603c60Sopenharmony_ci EXPECT_EQ(ltrnum, 10); 272f6603c60Sopenharmony_ci } else { 273f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 274f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 275f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_ENCODER_LONG_TERM_REFERENCE)); 276f6603c60Sopenharmony_ci } 277f6603c60Sopenharmony_ci} 278f6603c60Sopenharmony_ci 279f6603c60Sopenharmony_ci/** 280f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0023 281f6603c60Sopenharmony_ci * @tc.name : 软解,查询低时延的能力值 282f6603c60Sopenharmony_ci * @tc.desc : api test 283f6603c60Sopenharmony_ci */ 284f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0023, TestSize.Level2) 285f6603c60Sopenharmony_ci{ 286f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, SOFTWARE); 287f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 288f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_LOW_LATENCY)); 289f6603c60Sopenharmony_ci} 290f6603c60Sopenharmony_ci 291f6603c60Sopenharmony_ci/** 292f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0024 293f6603c60Sopenharmony_ci * @tc.name : 硬解,查询低时延的能力值 294f6603c60Sopenharmony_ci * @tc.desc : api test 295f6603c60Sopenharmony_ci */ 296f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0024, TestSize.Level2) 297f6603c60Sopenharmony_ci{ 298f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, false, HARDWARE); 299f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 300f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_LOW_LATENCY)); 301f6603c60Sopenharmony_ci} 302f6603c60Sopenharmony_ci 303f6603c60Sopenharmony_ci/** 304f6603c60Sopenharmony_ci * @tc.number : VIDEO_TEMPORAL_ENCODE_API_0025 305f6603c60Sopenharmony_ci * @tc.name : 编码,查询低时延的能力值 306f6603c60Sopenharmony_ci * @tc.desc : api test 307f6603c60Sopenharmony_ci */ 308f6603c60Sopenharmony_ciHWTEST_F(HwCapabilityNdkTest, VIDEO_TEMPORAL_ENCODE_API_0025, TestSize.Level1) 309f6603c60Sopenharmony_ci{ 310f6603c60Sopenharmony_ci OH_AVCapability *capability = OH_AVCodec_GetCapabilityByCategory(OH_AVCODEC_MIMETYPE_VIDEO_AVC, true, HARDWARE); 311f6603c60Sopenharmony_ci ASSERT_NE(nullptr, capability); 312f6603c60Sopenharmony_ci ASSERT_EQ(nullptr, OH_AVCapability_GetFeatureProperties(capability, VIDEO_LOW_LATENCY)); 313f6603c60Sopenharmony_ci} 314f6603c60Sopenharmony_ci} // namespace