diff --git a/audiohandler/BUILD.gn b/audiohandler/BUILD.gn index 4de65870cc6e123a2dd54b741fc57a9018b81a76..a18d3e1ad9fa6cd40085a9fc51e903a4c86c73cb 100644 --- a/audiohandler/BUILD.gn +++ b/audiohandler/BUILD.gn @@ -19,6 +19,7 @@ ohos_shared_library("distributed_audio_handler") { include_dirs = [ "//third_party/json/include", "${fwk_common_path}/utils/include", + "${fwk_utils_path}/include", "${mediastandardfwk_path}/audiomanager/include", "${mediastandardfwk_path}/audiocommon/include", "${mediastandardfwk_path}/audiocapturer/include", @@ -38,6 +39,7 @@ ohos_shared_library("distributed_audio_handler") { "audio_framework:audio_capturer", "audio_framework:audio_client", "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "multimedia_image_framework:image_native", "player_framework:media_client", ] diff --git a/audiohandler/src/daudio_handler.cpp b/audiohandler/src/daudio_handler.cpp index 3b05a3b0f93841c4c21f74dcfea4c3e6787bcdc6..094f6d78229011d6eab8dea63ca31618ee89d342 100644 --- a/audiohandler/src/daudio_handler.cpp +++ b/audiohandler/src/daudio_handler.cpp @@ -22,6 +22,7 @@ #include "nlohmann/json.hpp" #include "string_ex.h" +#include "histreamer_query_tool.h" #include "daudio_constants.h" #include "daudio_errorcode.h" #include "daudio_log.h" @@ -69,7 +70,7 @@ int32_t DAudioHandler::Initialize() std::vector DAudioHandler::Query() { - DHLOGD("Query distributed hardware information."); + DHLOGI("Query distributed hardware information."); auto audioSrv = AudioStandard::AudioSystemManager::GetInstance(); std::vector dhItemVec; if (audioSrv == nullptr) { @@ -94,6 +95,17 @@ std::vector DAudioHandler::Query() } infoJson["INTERRUPT_GROUP_ID"] = dev->interruptGroupId_; infoJson["VOLUME_GROUP_ID"] = dev->volumeGroupId_; + + std::string audioEncoders = + HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::AUDIO_ENCODER); + DHLOGI("DScreen QueryAudioEncoderAbility info: %s", audioEncoders.c_str()); + infoJson[KEY_HISTREAMER_AUDIO_ENCODER] = audioEncoders; + + std::string audioDecoders = + HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::AUDIO_DECODER); + DHLOGI("DScreen QueryAudioDecoderAbility info: %s", audioDecoders.c_str()); + infoJson[KEY_HISTREAMER_AUDIO_DECODER] = audioDecoders; + DHItem dhItem; dhItem.dhId = std::to_string(dhId); dhItem.attrs = infoJson.dump(); diff --git a/common/include/daudio_constants.h b/common/include/daudio_constants.h index 5b84d568214660d3394030401f43b7d50f8c5b46..1b6c86b1520313d26dde502b78a1a482329787aa 100644 --- a/common/include/daudio_constants.h +++ b/common/include/daudio_constants.h @@ -84,6 +84,9 @@ const std::string NAME = "name"; const std::string KEY_CODECTYPE = "codecType"; const std::string KEY_DEVICE_TYPE = "deviceType"; +const std::string KEY_HISTREAMER_AUDIO_ENCODER = "histmAudEnc"; +const std::string KEY_HISTREAMER_AUDIO_DECODER = "histmAudDec"; + const std::string HDF_EVENT_RESULT_SUCCESS = "DH_SUCCESS"; const std::string HDF_EVENT_RESULT_FAILED = "DH_FAILED";