| Index: content/renderer/media/pepper_platform_video_decoder_impl.cc
|
| diff --git a/content/renderer/media/pepper_platform_video_decoder_impl.cc b/content/renderer/media/pepper_platform_video_decoder_impl.cc
|
| index 62e5d2396a229b6f4115927d6e7f60dca2311321..05fd7a1b10a3a3595b79f6cd30f8b9870bb0992a 100644
|
| --- a/content/renderer/media/pepper_platform_video_decoder_impl.cc
|
| +++ b/content/renderer/media/pepper_platform_video_decoder_impl.cc
|
| @@ -26,7 +26,7 @@ PlatformVideoDecoderImpl::~PlatformVideoDecoderImpl() {}
|
|
|
| bool PlatformVideoDecoderImpl::Initialize(media::VideoCodecProfile profile) {
|
| // TODO(vrk): Support multiple decoders.
|
| - if (decoder_)
|
| + if (decoder_.get())
|
| return true;
|
|
|
| RenderThreadImpl* render_thread = RenderThreadImpl::current();
|
| @@ -43,43 +43,43 @@ bool PlatformVideoDecoderImpl::Initialize(media::VideoCodecProfile profile) {
|
| DCHECK_EQ(channel->state(), GpuChannelHost::kConnected);
|
|
|
| // Send IPC message to initialize decoder in GPU process.
|
| - decoder_ = channel->CreateVideoDecoder(
|
| - command_buffer_route_id_, profile, this);
|
| + decoder_.reset(channel->CreateVideoDecoder(
|
| + command_buffer_route_id_, profile, this));
|
| return decoder_.get() != NULL;
|
| }
|
|
|
| void PlatformVideoDecoderImpl::Decode(const BitstreamBuffer& bitstream_buffer) {
|
| - DCHECK(decoder_);
|
| + DCHECK(decoder_.get());
|
| decoder_->Decode(bitstream_buffer);
|
| }
|
|
|
| void PlatformVideoDecoderImpl::AssignPictureBuffers(
|
| const std::vector<media::PictureBuffer>& buffers) {
|
| - DCHECK(decoder_);
|
| + DCHECK(decoder_.get());
|
| decoder_->AssignPictureBuffers(buffers);
|
| }
|
|
|
| void PlatformVideoDecoderImpl::ReusePictureBuffer(
|
| int32 picture_buffer_id) {
|
| - DCHECK(decoder_);
|
| + DCHECK(decoder_.get());
|
| decoder_->ReusePictureBuffer(picture_buffer_id);
|
| }
|
|
|
| void PlatformVideoDecoderImpl::Flush() {
|
| - DCHECK(decoder_);
|
| + DCHECK(decoder_.get());
|
| decoder_->Flush();
|
| }
|
|
|
| void PlatformVideoDecoderImpl::Reset() {
|
| - DCHECK(decoder_);
|
| + DCHECK(decoder_.get());
|
| decoder_->Reset();
|
| }
|
|
|
| -void PlatformVideoDecoderImpl::Destroy() {
|
| - DCHECK(decoder_);
|
| - decoder_->Destroy();
|
| +void PlatformVideoDecoderImpl::Destroy(
|
| + scoped_ptr<VideoDecodeAccelerator> self) {
|
| + DCHECK(decoder_.get());
|
| + decoder_->Destroy(decoder_.Pass());
|
| client_ = NULL;
|
| - decoder_ = NULL;
|
| }
|
|
|
| void PlatformVideoDecoderImpl::NotifyError(
|
|
|