base::BindRepeating(&TTvdVideoDecoder::GetCommandBufferHelper,
base::Unretained(this)),
gpu_task_runner_, decoder_thread_.task_runner(), get_video_facade_cb_,
- workarounds_);
- // Since it's not allowed to allocate resources in some states, we should
- // notify new instance about current known state.
- OnStateChange(last_state_);
+ workarounds_, last_state_);
}
decoder_impl_.AsyncCall(&TTvdVideoDecoderImpl::Initialize)
.WithArgs(config, low_delay, cdm_context,
scoped_refptr<base::SingleThreadTaskRunner> decoder_task_runner,
base::RepeatingCallback<std::unique_ptr<DecoderFacadeVideo>(
const gpu::GpuDriverBugWorkarounds*)> get_video_facade_cb,
- const gpu::GpuDriverBugWorkarounds& workarounds)
+ const gpu::GpuDriverBugWorkarounds& workarounds,
+ suspend_resume::State suspend_state)
: workarounds_(workarounds),
last_processing_frame_(
std::make_pair(base::TimeDelta(), ProcessingAction::kRender)),
}
output_surface_manager_ = GetOrCreateOutputSurfaceManager(workarounds_);
+ TIZEN_MEDIA_LOG(INFO) << "Create decoder in state: " << suspend_state;
+ switch (suspend_state) {
+ case suspend_resume::State::SUSPENDED:
+ decoder_state_ = DecoderState::kSuspended;
+ break;
+ case suspend_resume::State::PARTIAL:
+ decoder_state_ = DecoderState::kReleasedBeforeInit;
+ break;
+ case suspend_resume::State::RESUMED:
+ // Do nothing, |kCreated| is proper state.
+ break;
+ }
}
DecodedCollectionOnGpu::~DecodedCollectionOnGpu() {
scoped_refptr<base::SingleThreadTaskRunner> decoder_task_runner,
base::RepeatingCallback<std::unique_ptr<DecoderFacadeVideo>(
const gpu::GpuDriverBugWorkarounds*)> get_video_facade_cb,
- const gpu::GpuDriverBugWorkarounds& workarounds);
+ const gpu::GpuDriverBugWorkarounds& workarounds,
+ suspend_resume::State suspend_state);
~TTvdVideoDecoderImpl();
TTvdVideoDecoderImpl(const TTvdVideoDecoderImpl&) = delete;