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 8cbacc13445a428b62767832dc6870ef60687451..b6ef134dd7c63c428420b038e0358ef757fdf66f 100644 |
| --- a/webrtc/video/video_capture_input.cc |
| +++ b/webrtc/video/video_capture_input.cc |
| @@ -67,14 +67,7 @@ VideoCaptureInput::~VideoCaptureInput() { |
| encoder_thread_.Stop(); |
| } |
| -void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) { |
| - // TODO(pbos): Remove local rendering, it should be handled by the client code |
| - // if required. |
| - if (local_renderer_) |
| - local_renderer_->RenderFrame(video_frame, 0); |
| - |
| - stats_proxy_->OnIncomingFrame(video_frame.width(), video_frame.height()); |
| - |
| +VideoFrame VideoCaptureInput::UpdateTimestamps(const VideoFrame& video_frame) { |
| VideoFrame incoming_frame = video_frame; |
| if (incoming_frame.ntp_time_ms() != 0) { |
| @@ -95,6 +88,19 @@ void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) { |
| incoming_frame.set_timestamp( |
| kMsToRtpTimestamp * static_cast<uint32_t>(incoming_frame.ntp_time_ms())); |
| + return incoming_frame; |
| +} |
| + |
| +void VideoCaptureInput::IncomingCapturedFrame(const VideoFrame& video_frame) { |
| + // TODO(pbos): Remove local rendering, it should be handled by the client code |
| + // if required. |
| + if (local_renderer_) |
| + local_renderer_->RenderFrame(video_frame, 0); |
|
pbos-webrtc
2015/12/18 16:23:16
Use this callback instead of wrapping input, but m
sprang_webrtc
2015/12/18 16:52:57
Done.
|
| + |
| + stats_proxy_->OnIncomingFrame(video_frame.width(), video_frame.height()); |
| + |
| + VideoFrame incoming_frame = UpdateTimestamps(video_frame); |
| + |
| CriticalSectionScoped cs(capture_cs_.get()); |
| if (incoming_frame.ntp_time_ms() <= last_captured_timestamp_) { |
| // We don't allow the same capture time for two frames, drop this one. |