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

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

Issue 172843002: The cricket::VideoCapturer on longer makes a copy of the frame from the camera. As a result we can'… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 10 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 | « no previous file | content/renderer/media/video_source_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/video_source_handler.cc
===================================================================
--- content/renderer/media/video_source_handler.cc (revision 252031)
+++ content/renderer/media/video_source_handler.cc (working copy)
@@ -36,9 +36,11 @@
virtual bool RenderFrame(const cricket::VideoFrame* frame) OVERRIDE {
base::AutoLock auto_lock(lock_);
if (reader_) {
- // Make a shallow copy of the frame as the |reader_| may need to queue it.
- // Both frames will share a single reference-counted frame buffer.
- reader_->GotFrame(frame->Copy());
+ // |frame| will be invalid after this function is returned. So keep a copy
+ // before return.
+ cricket::VideoFrame* copied_frame = frame->Copy();
+ copied_frame->MakeExclusive();
+ reader_->GotFrame(copied_frame);
}
return true;
}
« no previous file with comments | « no previous file | content/renderer/media/video_source_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698