mirror of
https://gitee.com/openharmony/multimedia_av_codec
synced 2024-10-07 06:04:54 +00:00
!3314 outputchange state setparameter bugfix
Merge pull request !3314 from Sxs/master
This commit is contained in:
commit
44f5c8f13f
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user