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

Unified Diff: webrtc/video/video_capture_input.cc

Issue 1889443002: Delete method webrtc::VideoFrame::Reset. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « webrtc/video/video_capture_input.h ('k') | webrtc/video/video_capture_input_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_capture_input.cc
diff --git a/webrtc/video/video_capture_input.cc b/webrtc/video/video_capture_input.cc
index 16263ccaf356018276fb1336ae872a0df92042a0..54b41b50064e60f8d33ca3d6e034a4f2aa9909bd 100644
--- a/webrtc/video/video_capture_input.cc
+++ b/webrtc/video/video_capture_input.cc
@@ -84,10 +84,11 @@ void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) {
return;
}
- captured_frame_.ShallowCopy(incoming_frame);
+ captured_frame_.reset(new VideoFrame);
pbos-webrtc 2016/04/13 12:31:52 Consider getting rid of this heap allocation.
nisse-webrtc 2016/04/13 12:45:26 It's kind-of tricky. 1. I aim to make sure that
+ captured_frame_->ShallowCopy(incoming_frame);
last_captured_timestamp_ = incoming_frame.ntp_time_ms();
- overuse_detector_->FrameCaptured(captured_frame_);
+ overuse_detector_->FrameCaptured(*captured_frame_);
TRACE_EVENT_ASYNC_BEGIN1("webrtc", "Video", video_frame.render_time_ms(),
"render_time", video_frame.render_time_ms());
@@ -97,11 +98,11 @@ void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) {
bool VideoCaptureInput::GetVideoFrame(VideoFrame* video_frame) {
rtc::CritScope lock(&crit_);
- if (captured_frame_.IsZeroSize())
+ if (!captured_frame_)
return false;
- *video_frame = captured_frame_;
- captured_frame_.Reset();
+ *video_frame = *captured_frame_;
+ captured_frame_.reset();
return true;
}
« no previous file with comments | « webrtc/video/video_capture_input.h ('k') | webrtc/video/video_capture_input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698