From 1566ee289364fdac5aa9dcc62db3070033208ad1 Mon Sep 17 00:00:00 2001 From: "pbos@webrtc.org" Date: Fri, 23 May 2014 13:03:45 +0000 Subject: [PATCH] Revert "Revert "Remove VideoSendStreamInput::PutFrame."" This reverts commit r6230 to re-land r6229. ViECapturer::SwapFrame now resets timestamps. BUG= R=stefan@webrtc.org TBR=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/13529004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6231 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/video/full_stack.cc | 4 ---- webrtc/video/video_send_stream.cc | 16 ++-------------- webrtc/video/video_send_stream.h | 2 -- webrtc/video_engine/vie_capturer.cc | 3 +++ webrtc/video_send_stream.h | 1 - 5 files changed, 5 insertions(+), 21 deletions(-) diff --git a/webrtc/video/full_stack.cc b/webrtc/video/full_stack.cc index cb0ba55a3..cb97cd85b 100644 --- a/webrtc/video/full_stack.cc +++ b/webrtc/video/full_stack.cc @@ -125,10 +125,6 @@ class VideoAnalyzer : public PacketReceiver, return receiver_->DeliverPacket(packet, length); } - virtual void PutFrame(const I420VideoFrame& video_frame) OVERRIDE { - ADD_FAILURE() << "PutFrame() should not have been called in this test."; - } - virtual void SwapFrame(I420VideoFrame* video_frame) OVERRIDE { I420VideoFrame* copy = NULL; { diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc index 7cdb35339..ced0b697e 100644 --- a/webrtc/video/video_send_stream.cc +++ b/webrtc/video/video_send_stream.cc @@ -280,24 +280,12 @@ VideoSendStream::~VideoSendStream() { rtp_rtcp_->Release(); } -void VideoSendStream::PutFrame(const I420VideoFrame& frame) { - input_frame_.CopyFrame(frame); - SwapFrame(&input_frame_); -} - void VideoSendStream::SwapFrame(I420VideoFrame* frame) { - // TODO(pbos): Warn if frame is "too far" into the future, or too old. This - // would help detect if frame's being used without NTP. - // TO REVIEWER: Is there any good check for this? Should it be - // skipped? - if (frame != &input_frame_) - input_frame_.SwapFrame(frame); - // TODO(pbos): Local rendering should not be done on the capture thread. if (config_.local_renderer != NULL) - config_.local_renderer->RenderFrame(input_frame_, 0); + config_.local_renderer->RenderFrame(*frame, 0); - external_capture_->SwapFrame(&input_frame_); + external_capture_->SwapFrame(frame); } VideoSendStreamInput* VideoSendStream::Input() { return this; } diff --git a/webrtc/video/video_send_stream.h b/webrtc/video/video_send_stream.h index b8f5661fd..a7e22676e 100644 --- a/webrtc/video/video_send_stream.h +++ b/webrtc/video/video_send_stream.h @@ -57,7 +57,6 @@ class VideoSendStream : public webrtc::VideoSendStream, bool DeliverRtcp(const uint8_t* packet, size_t length); // From VideoSendStreamInput. - virtual void PutFrame(const I420VideoFrame& frame) OVERRIDE; virtual void SwapFrame(I420VideoFrame* frame) OVERRIDE; // From webrtc::VideoSendStream. @@ -69,7 +68,6 @@ class VideoSendStream : public webrtc::VideoSendStream, virtual std::string GetCName() OVERRIDE; private: - I420VideoFrame input_frame_; TransportAdapter transport_adapter_; EncodedFrameCallbackAdapter encoded_frame_proxy_; scoped_ptr codec_lock_; diff --git a/webrtc/video_engine/vie_capturer.cc b/webrtc/video_engine/vie_capturer.cc index 65159a1d8..f037dc82d 100644 --- a/webrtc/video_engine/vie_capturer.cc +++ b/webrtc/video_engine/vie_capturer.cc @@ -337,6 +337,9 @@ int ViECapturer::IncomingFrameI420(const ViEVideoFrameI420& video_frame, void ViECapturer::SwapFrame(I420VideoFrame* frame) { external_capture_module_->IncomingI420VideoFrame(frame, frame->render_time_ms()); + frame->set_timestamp(0); + frame->set_ntp_time_ms(0); + frame->set_render_time_ms(0); } void ViECapturer::OnIncomingCapturedFrame(const int32_t capture_id, diff --git a/webrtc/video_send_stream.h b/webrtc/video_send_stream.h index 1a94121dc..87c0dac99 100644 --- a/webrtc/video_send_stream.h +++ b/webrtc/video_send_stream.h @@ -29,7 +29,6 @@ class VideoSendStreamInput { // These methods do not lock internally and must be called sequentially. // If your application switches input sources synchronization must be done // externally to make sure that any old frames are not delivered concurrently. - virtual void PutFrame(const I420VideoFrame& video_frame) = 0; virtual void SwapFrame(I420VideoFrame* video_frame) = 0; protected: