mirror of
https://github.com/openharmony/distributed_screen.git
synced 2026-07-21 04:25:28 -04:00
modify hardware encoder input data format
Signed-off-by: sxzheng96 <zhengshuangxi2@huawei.com>
This commit is contained in:
@@ -212,7 +212,6 @@ void DScreen::HandleEnable(const std::string ¶m, const std::string &taskId)
|
||||
|
||||
videoParam_->SetScreenWidth(attrJson[KEY_SCREEN_WIDTH]);
|
||||
videoParam_->SetScreenHeight(attrJson[KEY_SCREEN_HEIGHT]);
|
||||
videoParam_->SetVideoFormat(VIDEO_DATA_FORMAT_RGBA8888);
|
||||
|
||||
// negotiate codecType
|
||||
int32_t ret = NegotiateCodecType(attrJson[KEY_CODECTYPE]);
|
||||
@@ -263,9 +262,11 @@ 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);
|
||||
} else if(std::find(codecTypeCandidates.begin(), codecTypeCandidates.end(),
|
||||
CODEC_NAME_MPEG4) != codecTypeCandidates.end()) {
|
||||
videoParam_->SetCodecType(VIDEO_CODEC_TYPE_VIDEO_MPEG4);
|
||||
videoParam_->SetVideoFormat(VIDEO_DATA_FORMAT_RGBA8888);
|
||||
} else {
|
||||
DHLOGI("codec type not support.");
|
||||
return ERR_DH_SCREEN_SA_DSCREEN_NEGOTIATE_CODEC_FAIL;
|
||||
|
||||
Reference in New Issue
Block a user