!76 修改分布式屏幕编码色彩format

Merge pull request !76 from gaoqiang/master
This commit is contained in:
openharmony_ci
2022-05-20 09:29:53 +00:00
committed by Gitee
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -106,6 +106,7 @@ const std::string KEY_SCREEN_WIDTH = "screenWidth";
const std::string KEY_SCREEN_HEIGHT = "screenHeight";
const std::string KEY_VIDEO_WIDTH = "videoWidth";
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 SCREEN_CLIENT_WINDOW = "screenClientWindow";
@@ -120,7 +121,7 @@ constexpr float DEFAULT_DENSITY = 2.0;
constexpr int32_t DEFAULT_SCREEN_FLAGS = 0;
constexpr uint32_t DEFAULT_FPS = 30;
constexpr uint8_t DEFAULT_CODECTYPE = VIDEO_CODEC_TYPE_VIDEO_H264;
constexpr uint8_t DEFAULT_VIDEO_FORMAT = VIDEO_DATA_FORMAT_NV21;
constexpr uint8_t DEFAULT_VIDEO_FORMAT = VIDEO_DATA_FORMAT_NV12;
constexpr int32_t DISTRIBUTED_HARDWARE_SCREEN_SOURCE_SA_ID = 4807;
constexpr int32_t DISTRIBUTED_HARDWARE_SCREEN_SINK_SA_ID = 4808;
constexpr uint64_t SCREEN_ID_INVALID = -1ULL;
+3 -1
View File
@@ -99,7 +99,8 @@ void to_json(json &j, const DistributedHardware::VideoParam &videoParam)
{KEY_VIDEO_WIDTH, videoParam.videoWidth_},
{KEY_VIDEO_HEIGHT, videoParam.videoHeight_},
{KEY_FPS, videoParam.fps_},
{KEY_CODECTYPE, videoParam.codecType_}
{KEY_CODECTYPE, videoParam.codecType_},
{KEY_COLOR_FORMAT, videoParam.videoFormat_}
};
}
@@ -111,6 +112,7 @@ void from_json(const json &j, DistributedHardware::VideoParam &videoParam)
j.at(KEY_VIDEO_HEIGHT).get_to(videoParam.videoHeight_);
j.at(KEY_FPS).get_to(videoParam.fps_);
j.at(KEY_CODECTYPE).get_to(videoParam.codecType_);
j.at(KEY_COLOR_FORMAT).get_to(videoParam.videoFormat_);
}
} // namespace DistributedHardware
} // namespace OHOS
@@ -262,7 +262,7 @@ int32_t DScreen::NegotiateCodecType(const std::string &remoteCodecInfoStr)
if (std::find(codecTypeCandidates.begin(), codecTypeCandidates.end(),
CODEC_NAME_H264) != codecTypeCandidates.end()) {
videoParam_->SetCodecType(VIDEO_CODEC_TYPE_VIDEO_H264);
videoParam_->SetVideoFormat(VIDEO_DATA_FORMAT_NV21);
videoParam_->SetVideoFormat(VIDEO_DATA_FORMAT_NV12);
} else if (std::find(codecTypeCandidates.begin(), codecTypeCandidates.end(),
CODEC_NAME_MPEG4) != codecTypeCandidates.end()) {
videoParam_->SetCodecType(VIDEO_CODEC_TYPE_VIDEO_MPEG4);