| 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..b00f36c7a7f59b4f8b399873bfa307d1cd5d5833 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();
|
| + DCHECK(decoder_.get());
|
| + decoder_.release()->Destroy();
|
| client_ = NULL;
|
| - decoder_ = NULL;
|
| + delete this;
|
| }
|
|
|
| void PlatformVideoDecoderImpl::NotifyError(
|
|
|