Chromium Code Reviews| 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; |
| } |