mirror of
https://gitee.com/openharmony/multimedia_av_codec
synced 2024-11-27 17:10:46 +00:00
parent
9ac4ec6687
commit
73cb140956
@ -1216,6 +1216,7 @@ int32_t CodecServer::FlushPostProcessing()
|
||||
if (!postProcessing_) {
|
||||
return AVCS_ERR_OK;
|
||||
}
|
||||
DeactivatePostProcessingQueue();
|
||||
if (postProcessingTask_) {
|
||||
postProcessingTask_->Pause();
|
||||
}
|
||||
|
@ -81,6 +81,8 @@ public:
|
||||
[[fallthrough]];
|
||||
case State::RUNNING:
|
||||
[[fallthrough]];
|
||||
case State::FLUSHED:
|
||||
[[fallthrough]];
|
||||
case State::STOPPED:
|
||||
{
|
||||
int32_t ret = controller_->SetOutputSurface(surface);
|
||||
@ -131,8 +133,9 @@ public:
|
||||
int32_t Start()
|
||||
{
|
||||
CHECK_AND_RETURN_RET_LOG(controller_, AVCS_ERR_UNKNOWN, "Post processing controller is null");
|
||||
CHECK_AND_RETURN_RET_LOG(state_.Get() == State::PREPARED || state_.Get() == State::STOPPED,
|
||||
AVCS_ERR_INVALID_OPERATION, "Post processing is not prepared");
|
||||
CHECK_AND_RETURN_RET_LOG(state_.Get() == State::PREPARED || state_.Get() == State::STOPPED ||
|
||||
state_.Get() == State::FLUSHED,
|
||||
AVCS_ERR_INVALID_OPERATION, "Post processing is not prepared");
|
||||
AVCODEC_SYNC_TRACE;
|
||||
int32_t ret = controller_->Start();
|
||||
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, ret, "Start failed");
|
||||
@ -143,8 +146,8 @@ public:
|
||||
int32_t Stop()
|
||||
{
|
||||
CHECK_AND_RETURN_RET_LOG(controller_, AVCS_ERR_UNKNOWN, "Post processing controller is null");
|
||||
CHECK_AND_RETURN_RET_LOG(state_.Get() == State::RUNNING, AVCS_ERR_INVALID_STATE,
|
||||
"Invalid post processing state: %{public}s", state_.Name());
|
||||
CHECK_AND_RETURN_RET_LOG(state_.Get() == State::RUNNING || state_.Get() == State::FLUSHED,
|
||||
AVCS_ERR_INVALID_STATE, "Invalid post processing state: %{public}s", state_.Name());
|
||||
AVCODEC_SYNC_TRACE;
|
||||
int32_t ret = controller_->Stop();
|
||||
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, ret, "Start failed");
|
||||
@ -160,6 +163,7 @@ public:
|
||||
AVCODEC_SYNC_TRACE;
|
||||
int32_t ret = controller_->Flush();
|
||||
CHECK_AND_RETURN_RET_LOG(ret == AVCS_ERR_OK, ret, "Flush failed");
|
||||
state_.Set(State::FLUSHED);
|
||||
return AVCS_ERR_OK;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@ enum class State {
|
||||
CONFIGURED,
|
||||
PREPARED,
|
||||
RUNNING,
|
||||
FLUSHED,
|
||||
STOPPED
|
||||
};
|
||||
|
||||
|
@ -310,6 +310,10 @@ bool TEST_SUIT::GetWaterMarkCapability(int32_t param)
|
||||
AVCodecCategory::AVCODEC_SOFTWARE);
|
||||
break;
|
||||
}
|
||||
if (capabilityData == nullptr) {
|
||||
std::cout << "capabilityData is nullptr" << std::endl;
|
||||
return false;
|
||||
}
|
||||
if (capabilityData->featuresMap.count(static_cast<int32_t>(AVCapabilityFeature::VIDEO_WATERMARK))) {
|
||||
std::cout << "Support watermark" << std::endl;
|
||||
return true;
|
||||
@ -949,7 +953,6 @@ HWTEST_P(TEST_SUIT, VideoEncoder_SetCustomBuffer_001, TestSize.Level1)
|
||||
ASSERT_EQ(ret, true);
|
||||
std::shared_ptr<AVBufferMock> buffer = AVBufferMockFactory::CreateAVBuffer(avbuffer);
|
||||
std::shared_ptr<FormatMock> param = buffer->GetParameter();
|
||||
(void)memset_s(buffer->GetAddr(), buffer->GetCapacity(), 0, 10000);
|
||||
param->PutIntValue(Tag::VIDEO_ENCODER_ENABLE_WATERMARK, 1);
|
||||
param->PutIntValue(Tag::VIDEO_COORDINATE_X, 100);
|
||||
param->PutIntValue(Tag::VIDEO_COORDINATE_Y, 100);
|
||||
@ -1185,7 +1188,6 @@ HWTEST_P(TEST_SUIT, VideoEncoder_SetCustomBuffer_009, TestSize.Level1)
|
||||
ASSERT_EQ(ret, true);
|
||||
std::shared_ptr<AVBufferMock> buffer = AVBufferMockFactory::CreateAVBuffer(avbuffer);
|
||||
std::shared_ptr<FormatMock> param = buffer->GetParameter();
|
||||
(void)memset_s(buffer->GetAddr(), buffer->GetCapacity(), 0, 10000);
|
||||
param->PutIntValue(Tag::VIDEO_ENCODER_ENABLE_WATERMARK, 1);
|
||||
param->PutIntValue(Tag::VIDEO_COORDINATE_X, 100);
|
||||
param->PutIntValue(Tag::VIDEO_COORDINATE_Y, 100);
|
||||
@ -1225,7 +1227,6 @@ HWTEST_P(TEST_SUIT, VideoEncoder_SetCustomBuffer_0010, TestSize.Level1)
|
||||
ASSERT_EQ(ret, true);
|
||||
std::shared_ptr<AVBufferMock> buffer = AVBufferMockFactory::CreateAVBuffer(avbuffer);
|
||||
std::shared_ptr<FormatMock> param = buffer->GetParameter();
|
||||
(void)memset_s(buffer->GetAddr(), buffer->GetCapacity(), 0, 10000);
|
||||
param->PutIntValue(Tag::VIDEO_ENCODER_ENABLE_WATERMARK, 1);
|
||||
param->PutIntValue(Tag::VIDEO_COORDINATE_X, 100);
|
||||
param->PutIntValue(Tag::VIDEO_COORDINATE_Y, 100);
|
||||
|
Loading…
Reference in New Issue
Block a user