From 5805966b731af28de498a30dae571d2fdf06a898 Mon Sep 17 00:00:00 2001 From: "zhuzhihui7@huawei.com" Date: Wed, 26 Feb 2025 15:07:35 +0800 Subject: [PATCH] add filter ut gn Signed-off-by: zhuzhihui7@huawei.com --- .../av_trans_engine/filters/test/BUILD.gn | 3 + .../test/av_trans_coder_filter_test/BUILD.gn | 134 +++++++++++++++++ .../test/av_trans_input_filter_test/BUILD.gn | 134 +++++++++++++++++ .../test/av_trans_output_filter_test/BUILD.gn | 135 ++++++++++++++++++ 4 files changed, 406 insertions(+) create mode 100644 av_transport/av_trans_engine/filters/test/av_trans_coder_filter_test/BUILD.gn create mode 100644 av_transport/av_trans_engine/filters/test/av_trans_input_filter_test/BUILD.gn create mode 100644 av_transport/av_trans_engine/filters/test/av_trans_output_filter_test/BUILD.gn diff --git a/av_transport/av_trans_engine/filters/test/BUILD.gn b/av_transport/av_trans_engine/filters/test/BUILD.gn index 43090d38..9788b2ae 100644 --- a/av_transport/av_trans_engine/filters/test/BUILD.gn +++ b/av_transport/av_trans_engine/filters/test/BUILD.gn @@ -15,6 +15,9 @@ group("filter_test") { testonly = true deps = [ + "av_trans_coder_filter_test:av_trans_coder_filter_unittest", + "av_trans_input_filter_test:av_trans_input_filter_unittest", + "av_trans_output_filter_test:av_trans_audio_output_filter_unittest", "av_transport_input_filter_test:input_filter_unittest", "av_transport_output_filter_test:output_filter_unittest", ] diff --git a/av_transport/av_trans_engine/filters/test/av_trans_coder_filter_test/BUILD.gn b/av_transport/av_trans_engine/filters/test/av_trans_coder_filter_test/BUILD.gn new file mode 100644 index 00000000..0beb9df1 --- /dev/null +++ b/av_transport/av_trans_engine/filters/test/av_trans_coder_filter_test/BUILD.gn @@ -0,0 +1,134 @@ +# Copyright (c) 2023-2024 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. + +import("//build/test.gni") +import("../../../../distributed_av_transport.gni") + +module_out_path = "distributed_hardware_fwk/av_trans_coder" + +config("module_private_config") { + visibility = [ ":*" ] + + include_dirs = [ + "${filters_path}/av_trans_coder", + "${common_path}/include", + "${distributed_av_transport_path}/framework", + "${distributed_av_transport_path}/framework/filter/include", + "${distributed_av_transport_path}/framework/pipeline/include", + ] +} + +ohos_unittest("AvTransportAudioDecoderFilterTest") { + module_out_path = module_out_path + + configs = [ ":module_private_config" ] + + sources = [ "av_trans_audio_decoder_filter_test.cpp" ] + + cflags = [ + "-O2", + "-fPIC", + "-Wall", + "-fexceptions", + "-Dprivate = public", + "-Dprotected = public", + ] + cflags_cc = cflags + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"av_trans_audio_decoder_filter_test\"", + "LOG_DOMAIN=0xD004101", + ] + + deps = [ + "${distributed_av_transport_path}/framework:distributed_av_pipeline_fwk", + ] + + if (histreamer_compile_part) { + external_deps = [ + "media_foundation:histreamer_base", + "media_foundation:histreamer_codec_filters", + "media_foundation:histreamer_ffmpeg_convert", + ] + } + + external_deps += [ + "av_codec:av_codec_client", + "av_codec:native_media_acodec", + "bounds_checking_function:libsec_shared", + "cJSON:cjson", + "c_utils:utils", + "dsoftbus:softbus_client", + "googletest:gtest", + "hilog:libhilog", + "libevdev:libevdev", + ] +} + +ohos_unittest("AvTransportAudioEncoderFilterTest") { + module_out_path = module_out_path + + configs = [ ":module_private_config" ] + + sources = [ "av_trans_audio_encoder_filter_test.cpp" ] + + cflags = [ + "-O2", + "-fPIC", + "-Wall", + "-fexceptions", + "-Dprivate = public", + "-Dprotected = public", + ] + cflags_cc = cflags + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"av_trans_audio_decoder_filter_test\"", + "LOG_DOMAIN=0xD004101", + ] + + deps = [ + "${distributed_av_transport_path}/framework:distributed_av_pipeline_fwk", + ] + + if (histreamer_compile_part) { + external_deps = [ + "media_foundation:histreamer_base", + "media_foundation:histreamer_codec_filters", + "media_foundation:histreamer_ffmpeg_convert", + ] + } + + external_deps += [ + "av_codec:av_codec_client", + "av_codec:native_media_acodec", + "bounds_checking_function:libsec_shared", + "cJSON:cjson", + "c_utils:utils", + "dsoftbus:softbus_client", + "googletest:gtest", + "hilog:libhilog", + "libevdev:libevdev", + ] +} + +group("av_trans_coder_filter_unittest") { + testonly = true + + deps = [ + ":AvTransportAudioDecoderFilterTest", + ":AvTransportAudioEncoderFilterTest", + ] +} diff --git a/av_transport/av_trans_engine/filters/test/av_trans_input_filter_test/BUILD.gn b/av_transport/av_trans_engine/filters/test/av_trans_input_filter_test/BUILD.gn new file mode 100644 index 00000000..faa5b7f8 --- /dev/null +++ b/av_transport/av_trans_engine/filters/test/av_trans_input_filter_test/BUILD.gn @@ -0,0 +1,134 @@ +# Copyright (c) 2023-2024 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. + +import("//build/test.gni") +import("../../../../distributed_av_transport.gni") + +module_out_path = "distributed_hardware_fwk/av_trans_input" + +config("module_private_config") { + visibility = [ ":*" ] + + include_dirs = [ + "${filters_path}/av_trans_input", + "${filters_path}/av_trans_coder", + "${common_path}/include", + "${distributed_av_transport_path}/framework", + "${distributed_av_transport_path}/framework/filter/include", + "${distributed_av_transport_path}/framework/pipeline/include", + ] +} + +ohos_unittest("AvTransAudioInputFilterTest") { + module_out_path = module_out_path + + configs = [ ":module_private_config" ] + + sources = [ "av_trans_audio_input_filter_test.cpp" ] + + cflags = [ + "-O2", + "-fPIC", + "-Wall", + "-fexceptions", + "-Dprivate = public", + "-Dprotected = public", + ] + cflags_cc = cflags + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"av_trans_audio_input_filter_test\"", + "LOG_DOMAIN=0xD004101", + ] + + deps = [ + "${distributed_av_transport_path}/framework:distributed_av_pipeline_fwk", + ] + + if (histreamer_compile_part) { + external_deps = [ + "media_foundation:histreamer_base", + "media_foundation:histreamer_codec_filters", + "media_foundation:histreamer_ffmpeg_convert", + ] + } + + external_deps += [ + "av_codec:av_codec_client", + "av_codec:native_media_acodec", + "bounds_checking_function:libsec_shared", + "cJSON:cjson", + "c_utils:utils", + "dsoftbus:softbus_client", + "googletest:gtest", + "hilog:libhilog", + "libevdev:libevdev", + ] +} + +ohos_unittest("AVTransBusInputFilterTest") { + module_out_path = module_out_path + + configs = [ ":module_private_config" ] + + sources = [ "av_trans_bus_input_filter_test.cpp" ] + + cflags = [ + "-O2", + "-fPIC", + "-Wall", + "-fexceptions", + "-Dprivate = public", + "-Dprotected = public", + ] + cflags_cc = cflags + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"av_trans_bus_input_filter_test\"", + "LOG_DOMAIN=0xD004101", + ] + + deps = [ + "${distributed_av_transport_path}/framework:distributed_av_pipeline_fwk", + ] + + if (histreamer_compile_part) { + external_deps = [ + "media_foundation:histreamer_base", + "media_foundation:histreamer_codec_filters", + "media_foundation:histreamer_ffmpeg_convert", + ] + } + + external_deps += [ + "av_codec:av_codec_client", + "av_codec:native_media_acodec", + "bounds_checking_function:libsec_shared", + "cJSON:cjson", + "c_utils:utils", + "dsoftbus:softbus_client", + "googletest:gtest", + "hilog:libhilog", + "libevdev:libevdev", + ] +} + +group("av_trans_input_filter_unittest") { + testonly = true + deps = [ + ":AVTransBusInputFilterTest", + ":AvTransAudioInputFilterTest", + ] +} diff --git a/av_transport/av_trans_engine/filters/test/av_trans_output_filter_test/BUILD.gn b/av_transport/av_trans_engine/filters/test/av_trans_output_filter_test/BUILD.gn new file mode 100644 index 00000000..ef7b24db --- /dev/null +++ b/av_transport/av_trans_engine/filters/test/av_trans_output_filter_test/BUILD.gn @@ -0,0 +1,135 @@ +# Copyright (c) 2023-2024 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. + +import("//build/test.gni") +import("../../../../distributed_av_transport.gni") + +module_out_path = "distributed_hardware_fwk/av_trans_output" + +config("module_private_config") { + visibility = [ ":*" ] + + include_dirs = [ + "${filters_path}/av_trans_input", + "${filters_path}/av_trans_coder", + "${filters_path}/av_trans_output", + "${common_path}/include", + "${distributed_av_transport_path}/framework", + "${distributed_av_transport_path}/framework/filter/include", + "${distributed_av_transport_path}/framework/pipeline/include", + ] +} + +ohos_unittest("AvTransAudioOutputFilterTest") { + module_out_path = module_out_path + + configs = [ ":module_private_config" ] + + sources = [ "av_trans_audio_output_filter_test.cpp" ] + + cflags = [ + "-O2", + "-fPIC", + "-Wall", + "-fexceptions", + "-Dprivate = public", + "-Dprotected = public", + ] + cflags_cc = cflags + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"av_trans_audio_output_filter_test\"", + "LOG_DOMAIN=0xD004101", + ] + + deps = [ + "${distributed_av_transport_path}/framework:distributed_av_pipeline_fwk", + ] + + if (histreamer_compile_part) { + external_deps = [ + "media_foundation:histreamer_base", + "media_foundation:histreamer_codec_filters", + "media_foundation:histreamer_ffmpeg_convert", + ] + } + + external_deps += [ + "av_codec:av_codec_client", + "av_codec:native_media_acodec", + "bounds_checking_function:libsec_shared", + "cJSON:cjson", + "c_utils:utils", + "dsoftbus:softbus_client", + "googletest:gtest", + "hilog:libhilog", + "libevdev:libevdev", + ] +} + +ohos_unittest("AVTransAudioDSoftbusOutputFilterTest") { + module_out_path = module_out_path + + configs = [ ":module_private_config" ] + + sources = [ "av_trans_dsoftbus_output_filter_test.cpp" ] + + cflags = [ + "-O2", + "-fPIC", + "-Wall", + "-fexceptions", + "-Dprivate = public", + "-Dprotected = public", + ] + cflags_cc = cflags + + defines = [ + "HI_LOG_ENABLE", + "DH_LOG_TAG=\"av_trans_dsoftbus_output_filter_test\"", + "LOG_DOMAIN=0xD004101", + ] + + deps = [ + "${distributed_av_transport_path}/framework:distributed_av_pipeline_fwk", + ] + + if (histreamer_compile_part) { + external_deps = [ + "media_foundation:histreamer_base", + "media_foundation:histreamer_codec_filters", + "media_foundation:histreamer_ffmpeg_convert", + ] + } + + external_deps += [ + "av_codec:av_codec_client", + "av_codec:native_media_acodec", + "bounds_checking_function:libsec_shared", + "cJSON:cjson", + "c_utils:utils", + "dsoftbus:softbus_client", + "googletest:gtest", + "hilog:libhilog", + "libevdev:libevdev", + ] +} + +group("av_trans_audio_output_filter_unittest") { + testonly = true + deps = [ + ":AVTransAudioDSoftbusOutputFilterTest", + ":AvTransAudioOutputFilterTest", + ] +} -- Gitee