diff --git a/bundle.json b/bundle.json index bcd6ba69be3b2aa801e0b1bfb9e368b9d1bc7bba..bad4c763ca122118577cd256e687dbe3c1728546 100755 --- a/bundle.json +++ b/bundle.json @@ -55,6 +55,7 @@ "//foundation/distributedhardware/distributed_audio/services/common:distributed_audio_utils", "//foundation/distributedhardware/distributed_audio/services/hdfaudioclient:daudio_client", + "//foundation/distributedhardware/distributed_audio/services/audioclient:distributed_audio_sink_client", "//foundation/distributedhardware/distributed_audio/services/audiomanager/servicesource:distributed_audio_source", "//foundation/distributedhardware/distributed_audio/services/audiomanager/servicesink:distributed_audio_sink", @@ -88,6 +89,37 @@ ] } }, + { + "type": "so", + "name": "//foundation/distributedhardware/distributed_audio/services/audioclient:distributed_audio_sink_client", + "header": { + "header_base": "//foundation/distributedhardware/distributed_audio/services/audioclient", + "header_files": [ + "interface/imic_client.h", + "interface/ispk_client.h" + ] + } + }, + { + "type": "so", + "name": "//foundation/distributedhardware/distributed_audio/services/audiotransport/decodetransport:distributed_audio_decode_transport", + "header": { + "header_base": "//foundation/distributedhardware/distributed_audio/services/audiotransport/decodetransport", + "header_files": [ + "include/audio_decode_transport.h" + ] + } + }, + { + "type": "so", + "name": "//foundation/distributedhardware/distributed_audio/services/audiotransport/encodetransport:distributed_audio_encode_transport", + "header": { + "header_base": "//foundation/distributedhardware/distributed_audio/services/audiotransport/encodetransport", + "header_files": [ + "include/audio_encode_transport.h" + ] + } + }, { "type": "so", "name": "//foundation/distributedhardware/distributed_audio/services/common:distributed_audio_utils", diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/BUILD.gn b/hdf_service/distributed_audio/hdi_service/audio/v1_0/BUILD.gn index bb3479370f053c3a41784290b72b9d5fe13a8c7b..8db4eef5148e5990fd93babda0f4ed3a4e4f3779 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/BUILD.gn +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/BUILD.gn @@ -26,10 +26,8 @@ ohos_shared_library("libaudio_manager_daudio_primary_service_1.0") { sources = [ "./src/audio_adapter_interface_impl.cpp", "./src/audio_capture_interface_impl.cpp", - "./src/audio_capture_interface_impl_base.cpp", "./src/audio_manager_interface_impl.cpp", "./src/audio_render_interface_impl.cpp", - "./src/audio_render_interface_impl_base.cpp", ] public_deps = [ diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl.h b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl.h index d60f8db4944c52026632fa78dd74a53bbaeb13ee..12df1f6213ab3ca12e789cecf58cda43e018256c 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl.h +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl.h @@ -35,14 +35,6 @@ using OHOS::HDI::DistributedAudio::Audioext::V1_0::AudioParameter; using OHOS::HDI::DistributedAudio::Audioext::V1_0::DAudioEvent; using OHOS::HDI::DistributedAudio::Audioext::V1_0::IDAudioCallback; -typedef enum { - CAPTURE_STATUS_OPEN = 0, - CAPTURE_STATUS_CLOSE, - CAPTURE_STATUS_START, - CAPTURE_STATUS_STOP, - CAPTURE_STATUS_PAUSE, -} AudioCaptureStatus; - class AudioCaptureInterfaceImpl : public AudioCaptureInterfaceImplBase { public: AudioCaptureInterfaceImpl(const std::string &adpName, const AudioDeviceDescriptor &desc, @@ -80,6 +72,7 @@ public: int32_t TurnStandbyMode() override; int32_t AudioDevDump(int32_t range, int32_t fd) override; int32_t IsSupportsPauseAndResume(bool &supportPause, bool &supportResume) override; + const AudioDeviceDescriptor &GetCaptureDesc() override; private: static constexpr int64_t AUDIO_OFFSET_FRAME_NUM = 10; diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl_base.h b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl_base.h index 6282dc6797af04808f093c55df348e6a99630141..d705eae390aaf69f0db00f11726ecb7734a2b77f 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl_base.h +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_capture_interface_impl_base.h @@ -29,16 +29,20 @@ namespace V1_0 { using OHOS::HDI::DistributedAudio::Audioext::V1_0::AudioData; using OHOS::HDI::DistributedAudio::Audioext::V1_0::AudioParameter; using OHOS::HDI::DistributedAudio::Audioext::V1_0::IDAudioCallback; +typedef enum { + CAPTURE_STATUS_OPEN = 0, + CAPTURE_STATUS_CLOSE, + CAPTURE_STATUS_START, + CAPTURE_STATUS_STOP, + CAPTURE_STATUS_PAUSE, +} AudioCaptureStatus; class AudioCaptureInterfaceImplBase : public IAudioCapture { public: - AudioCaptureInterfaceImplBase(const AudioDeviceDescriptor &desc); - ~AudioCaptureInterfaceImplBase(); + AudioCaptureInterfaceImplBase() = default; + virtual ~AudioCaptureInterfaceImplBase() = default; - const AudioDeviceDescriptor &GetCaptureDesc(); - -private: - AudioDeviceDescriptor baseDevDesc_; + virtual const AudioDeviceDescriptor &GetCaptureDesc() = 0; }; } // V1_0 } // Audio diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h index ff602bd84b6f35f3dba93d4489184070f62a3468..c1536720a9ab95865605126589fbede0e21b0e64 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl.h @@ -38,13 +38,6 @@ using OHOS::HDI::DistributedAudio::Audioext::V1_0::IDAudioCallback; constexpr uint32_t DURATION_FRAMES = 100; constexpr uint32_t CUR_FRAME_INIT_VALUE = 0; -typedef enum { - RENDER_STATUS_OPEN = 0, - RENDER_STATUS_CLOSE, - RENDER_STATUS_START, - RENDER_STATUS_STOP, - RENDER_STATUS_PAUSE, -} AudioRenderStatus; class AudioRenderInterfaceImpl : public AudioRenderInterfaceImplBase { public: @@ -92,6 +85,13 @@ public: int32_t AudioDevDump(int32_t range, int32_t fd) override; int32_t IsSupportsPauseAndResume(bool &supportPause, bool &supportResume) override; + const AudioDeviceDescriptor &GetRenderDesc() override; + void SetVolumeInner(const uint32_t vol) override; + void SetVolumeRangeInner(const uint32_t volMax, const uint32_t volMin) override; + uint32_t GetVolumeInner() override; + uint32_t GetMaxVolumeInner() override; + uint32_t GetMinVolumeInner() override; + private: float GetFadeRate(uint32_t currentIndex, const uint32_t durationIndex); int32_t FadeInProcess(const uint32_t durationFrame, int8_t* frameData, const size_t frameLength); @@ -116,6 +116,11 @@ private: int64_t frameIndex_ = 0; int64_t framePeriodNs_ = 0; int64_t startTime_ = 0; + + std::mutex volMtx_; + uint32_t vol_ = 0; + uint32_t volMax_ = 0; + uint32_t volMin_ = 0; }; } // V1_0 } // Audio diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl_base.h b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl_base.h index 4243a6207c91d6f2d8a03387785cadd9aa1940d9..dea8aa2b077daba96b368c493b39198b341f3cd6 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl_base.h +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/include/audio_render_interface_impl_base.h @@ -29,24 +29,25 @@ namespace HDI { namespace DistributedAudio { namespace Audio { namespace V1_0 { +typedef enum { + RENDER_STATUS_OPEN = 0, + RENDER_STATUS_CLOSE, + RENDER_STATUS_START, + RENDER_STATUS_STOP, + RENDER_STATUS_PAUSE, +} AudioRenderStatus; + class AudioRenderInterfaceImplBase : public IAudioRender { public: - AudioRenderInterfaceImplBase(const AudioDeviceDescriptor &desc); - ~AudioRenderInterfaceImplBase(); - - const AudioDeviceDescriptor &GetRenderDesc(); - void SetVolumeInner(const uint32_t vol); - void SetVolumeRangeInner(const uint32_t volMax, const uint32_t volMin); - uint32_t GetVolumeInner(); - uint32_t GetMaxVolumeInner(); - uint32_t GetMinVolumeInner(); + AudioRenderInterfaceImplBase() = default; + virtual ~AudioRenderInterfaceImplBase() = default; -private: - AudioDeviceDescriptor baseDevDesc_; - std::mutex volMtx_; - uint32_t vol_ = 0; - uint32_t volMax_ = 0; - uint32_t volMin_ = 0; + virtual const AudioDeviceDescriptor &GetRenderDesc() = 0; + virtual void SetVolumeInner(const uint32_t vol) = 0; + virtual void SetVolumeRangeInner(const uint32_t volMax, const uint32_t volMin) = 0; + virtual uint32_t GetVolumeInner() = 0; + virtual uint32_t GetMaxVolumeInner() = 0; + virtual uint32_t GetMinVolumeInner() = 0; }; } // V1_0 } // Audio diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_capture_interface_impl.cpp b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_capture_interface_impl.cpp index d6e80e8fd72f2b8487870806199598b4f260ff1b..bbfcabba248d6eca9721c60c0884f9cd5b754fd4 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_capture_interface_impl.cpp +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_capture_interface_impl.cpp @@ -36,7 +36,7 @@ namespace Audio { namespace V1_0 { AudioCaptureInterfaceImpl::AudioCaptureInterfaceImpl(const std::string &adpName, const AudioDeviceDescriptor &desc, const AudioSampleAttributes &attrs, const sptr &callback) - : AudioCaptureInterfaceImplBase(desc), adapterName_(adpName), devDesc_(desc), + : adapterName_(adpName), devDesc_(desc), devAttrs_(attrs), audioExtCallback_(callback) { devAttrs_.frameSize = CalculateFrameSize(attrs.sampleRate, attrs.channelCount, attrs.format, timeInterval_, false); @@ -320,6 +320,11 @@ int32_t AudioCaptureInterfaceImpl::GetFrameBufferSize(uint64_t &bufferSize) (void)bufferSize; return HDF_SUCCESS; } + +const AudioDeviceDescriptor &AudioCaptureInterfaceImpl::GetCaptureDesc() +{ + return devDesc_; +} } // V1_0 } // Audio } // Distributedaudio diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_capture_interface_impl_base.cpp b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_capture_interface_impl_base.cpp deleted file mode 100644 index 20f59ead849fcfb9431e817e4be5c78f6366e513..0000000000000000000000000000000000000000 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_capture_interface_impl_base.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2023 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. - */ - -#include "audio_capture_interface_impl_base.h" - -#include -#include -#include "sys/time.h" -#include - -#include "daudio_constants.h" -#include "daudio_log.h" -#include "daudio_utils.h" - -#undef DH_LOG_TAG -#define DH_LOG_TAG "AudioCaptureInterfaceImplBase" - -using namespace OHOS::DistributedHardware; -namespace OHOS { -namespace HDI { -namespace DistributedAudio { -namespace Audio { -namespace V1_0 { -AudioCaptureInterfaceImplBase::AudioCaptureInterfaceImplBase(const AudioDeviceDescriptor &desc) - : baseDevDesc_(desc) -{ - DHLOGD("Distributed audio capture base constructed, id(%d).", baseDevDesc_.pins); -} - -AudioCaptureInterfaceImplBase::~AudioCaptureInterfaceImplBase() -{ - DHLOGD("Distributed audio capture base destructed, id(%d).", baseDevDesc_.pins); -} - -const AudioDeviceDescriptor &AudioCaptureInterfaceImplBase::GetCaptureDesc() -{ - return baseDevDesc_; -} -} // V1_0 -} // Audio -} // Distributedaudio -} // HDI -} // OHOS diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp index d0374f55ae8aaa4d72d8922bb517f20270d8ec75..f8478f10a21c1747156dfc4dd557c98f5983fee5 100644 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp +++ b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl.cpp @@ -35,7 +35,7 @@ namespace Audio { namespace V1_0 { AudioRenderInterfaceImpl::AudioRenderInterfaceImpl(const std::string &adpName, const AudioDeviceDescriptor &desc, const AudioSampleAttributes &attrs, const sptr &callback) - : AudioRenderInterfaceImplBase(desc), adapterName_(adpName), devDesc_(desc), + : adapterName_(adpName), devDesc_(desc), devAttrs_(attrs), audioExtCallback_(callback) { devAttrs_.frameSize = CalculateFrameSize(attrs.sampleRate, attrs.channelCount, attrs.format, timeInterval_, false); @@ -399,6 +399,42 @@ int32_t AudioRenderInterfaceImpl::GetFrameBufferSize(uint64_t &bufferSize) (void)bufferSize; return HDF_SUCCESS; } + +const AudioDeviceDescriptor &AudioRenderInterfaceImpl::GetRenderDesc() +{ + return devDesc_; +} + +void AudioRenderInterfaceImpl::SetVolumeInner(const uint32_t vol) +{ + std::lock_guard volLck(volMtx_); + vol_ = vol; +} + +void AudioRenderInterfaceImpl::SetVolumeRangeInner(const uint32_t volMax, const uint32_t volMin) +{ + std::lock_guard volLck(volMtx_); + volMin_ = volMin; + volMax_ = volMax; +} + +uint32_t AudioRenderInterfaceImpl::GetVolumeInner() +{ + std::lock_guard volLck(volMtx_); + return vol_; +} + +uint32_t AudioRenderInterfaceImpl::GetMaxVolumeInner() +{ + std::lock_guard volLck(volMtx_); + return volMax_; +} + +uint32_t AudioRenderInterfaceImpl::GetMinVolumeInner() +{ + std::lock_guard volLck(volMtx_); + return volMin_; +} } // V1_0 } // Audio } // Distributedaudio diff --git a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl_base.cpp b/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl_base.cpp deleted file mode 100644 index d47b2b10452f250c8ec224d903b2418c2fc17eb0..0000000000000000000000000000000000000000 --- a/hdf_service/distributed_audio/hdi_service/audio/v1_0/src/audio_render_interface_impl_base.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2022 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. - */ - -#include "audio_render_interface_impl_base.h" - -#include -#include -#include "sys/time.h" - -#include "daudio_constants.h" -#include "daudio_events.h" -#include "daudio_log.h" -#include "daudio_utils.h" - -#undef DH_LOG_TAG -#define DH_LOG_TAG "AudioRenderInterfaceImplBase" - -using namespace OHOS::DistributedHardware; -namespace OHOS { -namespace HDI { -namespace DistributedAudio { -namespace Audio { -namespace V1_0 { -AudioRenderInterfaceImplBase::AudioRenderInterfaceImplBase(const AudioDeviceDescriptor &desc) - : baseDevDesc_(desc) -{ - DHLOGD("Distributed audio render base constructed, id(%d).", desc.pins); -} - -AudioRenderInterfaceImplBase::~AudioRenderInterfaceImplBase() -{ - DHLOGD("Distributed audio render base destructed, id(%d).", baseDevDesc_.pins); -} - - -const AudioDeviceDescriptor &AudioRenderInterfaceImplBase::GetRenderDesc() -{ - return baseDevDesc_; -} - -void AudioRenderInterfaceImplBase::SetVolumeInner(const uint32_t vol) -{ - std::lock_guard volLck(volMtx_); - vol_ = vol; -} - - -void AudioRenderInterfaceImplBase::SetVolumeRangeInner(const uint32_t volMax, const uint32_t volMin) -{ - std::lock_guard volLck(volMtx_); - volMin_ = volMin; - volMax_ = volMax; -} - -uint32_t AudioRenderInterfaceImplBase::GetVolumeInner() -{ - std::lock_guard volLck(volMtx_); - return vol_; -} - -uint32_t AudioRenderInterfaceImplBase::GetMaxVolumeInner() -{ - std::lock_guard volLck(volMtx_); - return volMax_; -} - -uint32_t AudioRenderInterfaceImplBase::GetMinVolumeInner() -{ - std::lock_guard volLck(volMtx_); - return volMin_; -} -} // V1_0 -} // Audio -} // Distributedaudio -} // HDI -} // OHOS diff --git a/services/audioclient/BUILD.gn b/services/audioclient/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..f17df2372837325ee932d745ccab0404d6dff2bf --- /dev/null +++ b/services/audioclient/BUILD.gn @@ -0,0 +1,73 @@ +# Copyright (c) 2022 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/ohos.gni") +import("//build/ohos_var.gni") +import("../../distributedaudio.gni") + +config("daudio_client_pub_config") { + include_dirs = [ "interface" ] +} + +ohos_shared_library("distributed_audio_sink_client") { + include_dirs = [ "//third_party/json/include" ] + + include_dirs += [ + "${audio_client_path}/interface", + "${audio_client_path}/micclient/include", + "${audio_client_path}/spkclient/include", + "${audio_processor_path}/encodeprocessor/include", + "${audio_processor_path}/decodeprocessor/include", + "${audio_processor_path}/interface", + "${audio_transport_path}/audiochannel/interface", + "${audio_transport_path}/audiochannel/audiodatachannel/include", + "${audio_transport_path}/decodetransport/include", + "${audio_transport_path}/encodetransport/include", + "${audio_transport_path}/interface", + "${common_path}/dfx_utils/include", + "${common_path}/include", + "${fwk_common_path}/utils/include", + "${services_path}/common/audioeventcallback", + "${services_path}/common/audiodata/include", + "${services_path}/common/audioparam", + ] + + public_configs = [ ":daudio_client_pub_config" ] + + sources = [ + "${audio_client_path}/micclient/src/dmic_client.cpp", + "${audio_client_path}/spkclient/src/dspeaker_client.cpp", + ] + + deps = [ + "${audio_transport_path}/decodetransport:distributed_audio_decode_transport", + "${audio_transport_path}/encodetransport:distributed_audio_encode_transport", + "${services_path}/common:distributed_audio_utils", + ] + + external_deps = [ + "hisysevent_native:libhisysevent", + "hitrace_native:hitrace_meter", + "multimedia_audio_framework:audio_capturer", + "multimedia_audio_framework:audio_client", + "multimedia_audio_framework:audio_renderer", + ] + + defines = [ + "HI_LOG_ENABLE", + "LOG_DOMAIN=0xD004100", + ] + + subsystem_name = "distributedhardware" + part_name = "distributed_audio" +} diff --git a/services/audioclient/spkclient/src/dspeaker_client.cpp b/services/audioclient/spkclient/src/dspeaker_client.cpp index a0b630648962d6ea1fe55fa880956d857be92ed2..b9e5315ebc3385534cd3f09653d9ea75cde647ff 100644 --- a/services/audioclient/spkclient/src/dspeaker_client.cpp +++ b/services/audioclient/spkclient/src/dspeaker_client.cpp @@ -18,7 +18,6 @@ #include "daudio_constants.h" #include "daudio_hisysevent.h" #include "daudio_util.h" -#include "dh_utils_tool.h" #undef DH_LOG_TAG #define DH_LOG_TAG "DSpeakerClient" diff --git a/services/audioclient/test/unittest/micclient/BUILD.gn b/services/audioclient/test/unittest/micclient/BUILD.gn index 77246db6710fc4d723ac0974a8bcc6847e05945f..cac585047d888623b8845d5cf8c9cc73fc2f4e32 100644 --- a/services/audioclient/test/unittest/micclient/BUILD.gn +++ b/services/audioclient/test/unittest/micclient/BUILD.gn @@ -60,7 +60,7 @@ ohos_unittest("MicClientTest") { configs = [ ":module_private_config" ] deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", + "${services_path}/audioclient:distributed_audio_sink_client", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", ] diff --git a/services/audioclient/test/unittest/spkclient/BUILD.gn b/services/audioclient/test/unittest/spkclient/BUILD.gn index 118cd99b0487622efa8b658da99c9aaf2d584342..a5d21277141161dce7cfd14919cf705d5276b9a4 100644 --- a/services/audioclient/test/unittest/spkclient/BUILD.gn +++ b/services/audioclient/test/unittest/spkclient/BUILD.gn @@ -64,7 +64,7 @@ ohos_unittest("SpeakerClientTest") { configs = [ ":module_private_config" ] deps = [ - "${services_path}/audiomanager/servicesink:distributed_audio_sink", + "${services_path}/audioclient:distributed_audio_sink_client", "${services_path}/common:distributed_audio_utils", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", diff --git a/services/audiomanager/servicesink/BUILD.gn b/services/audiomanager/servicesink/BUILD.gn index bd822197d38cec95f634afff34ce636e02c6d4fa..a84ec228ad1d75ca93b4a6188ea52187ea0f89ec 100755 --- a/services/audiomanager/servicesink/BUILD.gn +++ b/services/audiomanager/servicesink/BUILD.gn @@ -28,10 +28,6 @@ ohos_shared_library("distributed_audio_sink") { "//third_party/json/include", "//utils/system/safwk/native/include", "${fwk_common_path}/utils/include", - "${mediastandardfwk_path}/audiocapturer/include", - "${mediastandardfwk_path}/audiocommon/include", - "${mediastandardfwk_path}/audiorenderer/include", - "${mediastandardfwk_path}/audiomanager/include", ] include_dirs += [ @@ -39,7 +35,6 @@ ohos_shared_library("distributed_audio_sink") { "${audio_client_path}/micclient/include", "${audio_client_path}/spkclient/include", "${audio_control_path}/controlsink/include", - "${audio_client_path}/interface", "${audio_processor_path}/encodeprocessor/include", "${audio_processor_path}/decodeprocessor/include", "${audio_processor_path}/interface", @@ -67,8 +62,6 @@ ohos_shared_library("distributed_audio_sink") { ] sources = [ - "${audio_client_path}/micclient/src/dmic_client.cpp", - "${audio_client_path}/spkclient/src/dspeaker_client.cpp", "${audio_control_path}/controlsink/src/daudio_sink_dev_ctrl_manager.cpp", "${innerkits_path}/native_cpp/audio_sink/src/daudio_sink_handler.cpp", "${innerkits_path}/native_cpp/audio_sink/src/daudio_sink_load_callback.cpp", @@ -84,6 +77,7 @@ ohos_shared_library("distributed_audio_sink") { "${audio_transport_path}/audioctrltransport:distributed_audio_control", "${audio_transport_path}/decodetransport:distributed_audio_decode_transport", "${audio_transport_path}/encodetransport:distributed_audio_encode_transport", + "${services_path}/audioclient:distributed_audio_sink_client", "${services_path}/common:distributed_audio_utils", ] diff --git a/services/audiomanager/test/unittest/managersink/BUILD.gn b/services/audiomanager/test/unittest/managersink/BUILD.gn index d34046af18112ca7acff9debca21fbb593847676..7bc416d749ac468f825b882c6f3e6c9a09f45e52 100644 --- a/services/audiomanager/test/unittest/managersink/BUILD.gn +++ b/services/audiomanager/test/unittest/managersink/BUILD.gn @@ -71,6 +71,7 @@ ohos_unittest("DaudioSinkDevTest") { configs = [ ":module_private_config" ] deps = [ + "${services_path}/audioclient:distributed_audio_sink_client", "${services_path}/audiomanager/servicesink:distributed_audio_sink", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", @@ -101,6 +102,7 @@ ohos_unittest("DAudioSinkManagerTest") { configs = [ ":module_private_config" ] deps = [ + "${services_path}/audioclient:distributed_audio_sink_client", "${services_path}/audiomanager/servicesink:distributed_audio_sink", "//third_party/googletest:gmock", "//third_party/googletest:gtest_main", diff --git a/services/audiotransport/decodetransport/BUILD.gn b/services/audiotransport/decodetransport/BUILD.gn index 2c920c4ddf678d1f83873cbbd81e57978c147e20..077491ab7351054af0416e7b6de5f92db3c35f97 100644 --- a/services/audiotransport/decodetransport/BUILD.gn +++ b/services/audiotransport/decodetransport/BUILD.gn @@ -15,6 +15,18 @@ import("//build/ohos.gni") import("//build/ohos_var.gni") import("../../../distributedaudio.gni") +config("decode_transport_pub_config") { + include_dirs = [ + "include", + "../audiotransportstatus/include", + "../audiotransportstatus/interface", + "../interface", + "../audiochannel/interface", + "../audiochannel/audiodatachannel/include", + "../../audioprocessor/interface", + ] +} + ohos_shared_library("distributed_audio_decode_transport") { include_dirs = [ "//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include", @@ -43,6 +55,8 @@ ohos_shared_library("distributed_audio_decode_transport") { "${softbusadapter_path}/include", ] + public_configs = [ ":decode_transport_pub_config" ] + sources = [ "${audio_processor_path}/decodeprocessor/src/audio_decoder_processor.cpp", "${audio_processor_path}/decoder/src/audio_decoder.cpp", diff --git a/services/audiotransport/encodetransport/BUILD.gn b/services/audiotransport/encodetransport/BUILD.gn index 7dbd57b4cb5342c44e6b3f9dc770c310c40430d0..f302209f0e3519baad7e237fe60d4c48ae87383e 100644 --- a/services/audiotransport/encodetransport/BUILD.gn +++ b/services/audiotransport/encodetransport/BUILD.gn @@ -15,6 +15,18 @@ import("//build/ohos.gni") import("//build/ohos_var.gni") import("../../../distributedaudio.gni") +config("encode_transport_pub_config") { + include_dirs = [ + "include", + "../audiotransportstatus/include", + "../audiotransportstatus/interface", + "../audiochannel/audiodatachannel/include", + "../audiochannel/interface", + "../interface", + "../../audioprocessor/interface", + ] +} + ohos_shared_library("distributed_audio_encode_transport") { include_dirs = [ "//base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/include", @@ -43,6 +55,8 @@ ohos_shared_library("distributed_audio_encode_transport") { "${softbusadapter_path}/include", ] + public_configs = [ ":encode_transport_pub_config" ] + sources = [ "${audio_processor_path}/encodeprocessor/src/audio_encoder_processor.cpp", "${audio_processor_path}/encoder/src/audio_encoder.cpp", diff --git a/services/common/BUILD.gn b/services/common/BUILD.gn index fd1793ed3ad4fa4845b96ffacfc78920a9255546..6fe124dfdd8279ab7ed7305dd0ebe358aa87b237 100644 --- a/services/common/BUILD.gn +++ b/services/common/BUILD.gn @@ -18,7 +18,9 @@ import("../../distributedaudio.gni") config("daudio_common_pub_config") { include_dirs = [ "audiodata/include", + "audioeventcallback", "audioparam", + "${common_path}/dfxutils/include", "${common_path}/include", ] }