modify hardware encoder input data format

Signed-off-by: sxzheng96 <zhengshuangxi2@huawei.com>
This commit is contained in:
sxzheng96
2022-03-17 10:05:54 +08:00
parent 5ed15e0ead
commit ae5abc9306
@@ -212,7 +212,6 @@ void DScreen::HandleEnable(const std::string &param, 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;