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

Unified Diff: cc/layers/video_frame_provider_client_impl.cc

Issue 12596015: cc: Keep a reference on the media::VideoFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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: cc/layers/video_frame_provider_client_impl.cc
diff --git a/cc/layers/video_frame_provider_client_impl.cc b/cc/layers/video_frame_provider_client_impl.cc
index 2f318bfff3d7889f385fb4fb1ff524dec87f42d0..60286833b2f8b4a02d154375d94ef8c033e36f07 100644
--- a/cc/layers/video_frame_provider_client_impl.cc
+++ b/cc/layers/video_frame_provider_client_impl.cc
@@ -44,7 +44,8 @@ void VideoFrameProviderClientImpl::Stop() {
provider_ = NULL;
}
-media::VideoFrame* VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() {
+scoped_refptr<media::VideoFrame>
+VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() {
provider_lock_.Acquire(); // Balanced by call to ReleaseLock().
if (!provider_)
return NULL;
@@ -52,7 +53,8 @@ media::VideoFrame* VideoFrameProviderClientImpl::AcquireLockAndCurrentFrame() {
return provider_->GetCurrentFrame();
}
-void VideoFrameProviderClientImpl::PutCurrentFrame(media::VideoFrame* frame) {
+void VideoFrameProviderClientImpl::PutCurrentFrame(
+ const scoped_refptr<media::VideoFrame>& frame) {
provider_lock_.AssertAcquired();
provider_->PutCurrentFrame(frame);
}
@@ -66,7 +68,7 @@ void VideoFrameProviderClientImpl::StopUsingProvider() {
// Block the provider from shutting down until this client is done
// using the frame.
base::AutoLock locker(provider_lock_);
- provider_ = 0;
+ provider_ = NULL;
}
void VideoFrameProviderClientImpl::DidReceiveFrame() {

Powered by Google App Engine
This is Rietveld 408576698