1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/test.gni")
15import("//foundation/multimedia/player_framework/config.gni")
16
17module_output_path = "player_framework/transcoder"
18
19ohos_unittest("transcoder_unit_test") {
20  module_out_path = module_output_path
21  include_dirs = [
22    "./include",
23    "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native",
24    "$MEDIA_PLAYER_ROOT_DIR/frameworks/native/transcoder",
25    "$MEDIA_PLAYER_ROOT_DIR/test/unittest/common/include",
26  ]
27
28  cflags = [
29    "-Wall",
30    "-Werror",
31    "-Wno-deprecated-declarations",
32  ]
33
34  if (player_framework_support_transcoder) {
35    sources = [
36      "src/transcoder_mock.cpp",
37      "src/transcoder_unit_test.cpp",
38    ]
39  }
40
41  if (target_cpu == "arm64") {
42    av_codec_path = "\"/system/lib64\""
43  } else {
44    av_codec_path = "\"/system/lib\""
45  }
46  defines = [ "AV_CODEC_PATH=${av_codec_path}" ]
47
48  deps = [ "$MEDIA_PLAYER_ROOT_DIR/interfaces/inner_api/native:media_client" ]
49
50  external_deps = [
51    "c_utils:utils",
52    "hilog:libhilog",
53    "media_foundation:media_foundation",
54  ]
55
56  resource_config_file =
57      "$MEDIA_PLAYER_ROOT_DIR/test/unittest/resources/ohos_test.xml"
58}
59