!3314 outputchange state setparameter bugfix

Merge pull request !3314 from Sxs/master
This commit is contained in:
openharmony_ci 2024-09-12 04:15:14 +00:00 committed by Gitee
commit 44f5c8f13f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 12 additions and 12 deletions

View File

@ -395,6 +395,7 @@ private:
virtual void OnCheckIfStuck(const MsgInfo &info);
void OnForceShutDown(const MsgInfo &info);
void OnStateExited() override { codec_->stateGeneration_++; }
void OnSetParameters(const MsgInfo &info);
protected:
HCodec *codec_;
@ -443,7 +444,6 @@ private:
void OnCodecEvent(CodecHDI::CodecEventType event, uint32_t data1, uint32_t data2) override;
void OnShutDown(const MsgInfo &info) override;
void OnFlush(const MsgInfo &info);
void OnSetParameters(const MsgInfo &info);
};
struct OutputPortChangedState : BaseState {

View File

@ -125,6 +125,13 @@ void HCodec::BaseState::OnGetFormat(const MsgInfo &info)
}
}
void HCodec::BaseState::OnSetParameters(const MsgInfo &info)
{
Format params;
(void)info.param->GetValue("params", params);
ReplyErrorCode(info.id, codec_->OnSetParameters(params));
}
void HCodec::BaseState::OnCheckIfStuck(const MsgInfo &info)
{
int32_t generation = 0;
@ -564,13 +571,6 @@ void HCodec::RunningState::OnFlush(const MsgInfo &info)
ReplyErrorCode(info.id, AVCS_ERR_UNKNOWN);
}
}
void HCodec::RunningState::OnSetParameters(const MsgInfo &info)
{
Format params;
(void)info.param->GetValue("params", params);
ReplyErrorCode(info.id, codec_->OnSetParameters(params));
}
/**************************** RunningState End ********************************/
@ -585,15 +585,15 @@ void HCodec::OutputPortChangedState::OnStateEntered()
void HCodec::OutputPortChangedState::OnMsgReceived(const MsgInfo &info)
{
switch (info.type) {
case MsgWhat::FLUSH: {
case MsgWhat::FLUSH:
OnFlush(info);
return;
}
case MsgWhat::START:
case MsgWhat::SET_PARAMETERS: {
codec_->DeferMessage(info);
return;
}
case MsgWhat::SET_PARAMETERS:
OnSetParameters(info);
return;
case MsgWhat::QUEUE_INPUT_BUFFER: {
codec_->OnQueueInputBuffer(info, inputMode_);
return;