Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: content/renderer/media/pepper_platform_video_decoder_impl.cc

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/pepper_platform_video_decoder_impl.h ('k') | media/filters/gpu_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « content/renderer/media/pepper_platform_video_decoder_impl.h ('k') | media/filters/gpu_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698