From 1e737af647b18f832d652294b8322c74364b764f Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Sun, 25 Jun 2023 11:48:53 +0800 Subject: [PATCH 1/3] add histreamer ability query Signed-off-by: hwzhangchuang --- common/include/dscreen_constants.h | 2 ++ screenhandler/BUILD.gn | 2 ++ screenhandler/src/dscreen_handler.cpp | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/common/include/dscreen_constants.h b/common/include/dscreen_constants.h index 101c26a1..12a128c9 100644 --- a/common/include/dscreen_constants.h +++ b/common/include/dscreen_constants.h @@ -160,6 +160,8 @@ const std::string KEY_VIDEO_HEIGHT = "videoHeight"; const std::string KEY_COLOR_FORMAT = "colorFormat"; const std::string KEY_FPS = "fps"; const std::string KEY_CODECTYPE = "codecType"; +const std::string KEY_HISTREAMER_VIDEO_ENCODER = "histmVidEnc"; +const std::string KEY_HISTREAMER_VIDEO_DECODER = "histmVidDec"; const std::string SCREEN_CLIENT_WINDOW = "screenClientWindow"; const std::string KEY_DEV_ID = "devId"; const std::string KEY_DH_ID = "dhId"; diff --git a/screenhandler/BUILD.gn b/screenhandler/BUILD.gn index 6bb6aa36..541a8f0c 100644 --- a/screenhandler/BUILD.gn +++ b/screenhandler/BUILD.gn @@ -20,6 +20,7 @@ ohos_shared_library("distributed_screen_handler") { include_dirs = [ "//third_party/json/include", "${fwk_common_path}/utils/include", + "${fwk_utils_path}/include" ] include_dirs += [ @@ -43,6 +44,7 @@ ohos_shared_library("distributed_screen_handler") { "ipc:ipc_core", "player_framework:media_client", "window_manager:libdm", + "distributed_hardware_fwk:distributedhardwareutils" ] subsystem_name = "distributedhardware" diff --git a/screenhandler/src/dscreen_handler.cpp b/screenhandler/src/dscreen_handler.cpp index 86dc4eb5..2c0f13c7 100644 --- a/screenhandler/src/dscreen_handler.cpp +++ b/screenhandler/src/dscreen_handler.cpp @@ -19,6 +19,7 @@ #include "avcodec_list.h" #include "nlohmann/json.hpp" #include "screen.h" +#include "histreamer_query_tool.h" #include "dscreen_constants.h" #include "dscreen_errcode.h" @@ -130,6 +131,12 @@ std::vector DScreenHandler::Query() attrJson[KEY_SCREEN_WIDTH] = screenWidth; attrJson[KEY_SCREEN_HEIGHT] = screenHeight; attrJson[KEY_CODECTYPE] = QueryCodecInfo(); + std::string videoEncoders = HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::VIDEO_ENCODER); + DHLOGI("DScreen QueryVideoEncoderAbility info: %s", videoEncoders.c_str()); + attrJson[KEY_HISTREAMER_VIDEO_ENCODER] = videoEncoders; + std::string videoDecoders = HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::VIDEO_DECODER); + DHLOGI("DScreen QueryVideoDecoderAbility info: %s", videoDecoders.c_str()); + attrJson[KEY_HISTREAMER_VIDEO_DECODER] = videoDecoders; DHItem dhItem; dhItem.dhId = dhId; -- Gitee From 7abcf7efd428d3141a1c987769521596162ea12f Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Sun, 25 Jun 2023 15:02:22 +0800 Subject: [PATCH 2/3] patch Signed-off-by: hwzhangchuang --- screenhandler/BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/screenhandler/BUILD.gn b/screenhandler/BUILD.gn index 541a8f0c..11d1b083 100644 --- a/screenhandler/BUILD.gn +++ b/screenhandler/BUILD.gn @@ -20,7 +20,7 @@ ohos_shared_library("distributed_screen_handler") { include_dirs = [ "//third_party/json/include", "${fwk_common_path}/utils/include", - "${fwk_utils_path}/include" + "${fwk_utils_path}/include", ] include_dirs += [ @@ -40,11 +40,11 @@ ohos_shared_library("distributed_screen_handler") { external_deps = [ "c_utils:utils", + "distributed_hardware_fwk:distributedhardwareutils", "graphic_standard:surface", "ipc:ipc_core", "player_framework:media_client", "window_manager:libdm", - "distributed_hardware_fwk:distributedhardwareutils" ] subsystem_name = "distributedhardware" -- Gitee From 845074e0ea8db8a323f94a15e5364d9caedf1c60 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Sun, 25 Jun 2023 16:49:55 +0800 Subject: [PATCH 3/3] patch Signed-off-by: hwzhangchuang --- screenhandler/src/dscreen_handler.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/screenhandler/src/dscreen_handler.cpp b/screenhandler/src/dscreen_handler.cpp index 2c0f13c7..349f7221 100644 --- a/screenhandler/src/dscreen_handler.cpp +++ b/screenhandler/src/dscreen_handler.cpp @@ -131,10 +131,12 @@ std::vector DScreenHandler::Query() attrJson[KEY_SCREEN_WIDTH] = screenWidth; attrJson[KEY_SCREEN_HEIGHT] = screenHeight; attrJson[KEY_CODECTYPE] = QueryCodecInfo(); - std::string videoEncoders = HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::VIDEO_ENCODER); + std::string videoEncoders = + HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::VIDEO_ENCODER); DHLOGI("DScreen QueryVideoEncoderAbility info: %s", videoEncoders.c_str()); attrJson[KEY_HISTREAMER_VIDEO_ENCODER] = videoEncoders; - std::string videoDecoders = HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::VIDEO_DECODER); + std::string videoDecoders = + HiStreamerQueryTool::GetInstance().QueryHiStreamerPluginInfo(HISTREAM_PLUGIN_TYPE::VIDEO_DECODER); DHLOGI("DScreen QueryVideoDecoderAbility info: %s", videoDecoders.c_str()); attrJson[KEY_HISTREAMER_VIDEO_DECODER] = videoDecoders; -- Gitee