• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/av_codec/config.gni")
16
17module_output_path = "av_codec/AVCodec_Video/unittest"
18media_demuxer_test_sources = [
19  "$av_codec_root_dir/services/media_engine/modules/demuxer/sample_queue.cpp",
20  "$av_codec_root_dir/services/media_engine/modules/demuxer/type_finder.cpp",
21]
22config("media_demuxer_unittest_cfg") {
23  defines = [
24    "HST_ANY_WITH_NO_RTTI",
25    "MEDIA_OHOS",
26    "TESTING",
27  ]
28
29  cflags = [
30    "-Wno-sign-compare",
31    "-fno-exceptions",
32    "-fno-common",
33    "-fstack-protector-all",
34    "-Wshadow",
35    "-FPIC",
36    "-FS",
37    "-O2",
38    "-D_FORTIFY_SOURCE=2",
39    "-Wformat=2",
40    "-Wdate-time",
41    "-Dprivate=public",
42    "-Dprotected=public",
43  ]
44
45  cflags_cc = [
46    "-std=c++17",
47    "-fno-rtti",
48  ]
49
50  include_dirs = [
51    "$av_codec_root_dir/interfaces",
52    "$av_codec_root_dir/interfaces/inner_api",
53    "$av_codec_root_dir/interfaces/inner_api/native",
54    "$av_codec_root_dir/services/drm_decryptor",
55    "$av_codec_root_dir/services/media_engine/modules",
56    "$av_codec_root_dir/services/utils/include",
57    "$av_codec_root_dir/test/unittest/common",
58    "./mock",
59  ]
60}
61
62#################################################################################################################
63ohos_unittest("media_demuxer_ext_unit_test") {
64  sanitize = av_codec_test_sanitize
65  module_out_path = module_output_path
66  testonly = true
67  configs = [
68    ":media_demuxer_unittest_cfg",
69    "$av_codec_root_dir/services/dfx:av_codec_service_log_dfx_public_config",
70  ]
71  sources = media_demuxer_test_sources + [ "media_demuxer_ext_unit_test.cpp" ]
72  deps = [ "$av_codec_root_dir/services/dfx:av_codec_service_dfx" ]
73
74  external_deps = [
75    "c_utils:utils",
76    "googletest:gmock",
77    "googletest:gtest",
78    "graphic_surface:surface",
79    "hilog:libhilog",
80    "hisysevent:libhisysevent",
81    "init:libbegetutil",
82    "ipc:ipc_single",
83    "media_foundation:media_foundation",
84    "netmanager_base:net_conn_manager_if",
85    "openssl:libcrypto_shared",
86    "safwk:system_ability_fwk",
87  ]
88}
89