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