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

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
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(

Powered by Google App Engine
This is Rietveld 408576698