Add SwapFrame() to VideoSendStreamInput.
Optionally prevents doing a frame copy when putting frames into a
VideoSendStream. PutFrame() is still there, which copies the frame.
Also removes time_since_capture_ms as a parameter, since
I420VideoFrame::render_time_ms() denotes when the frame was captured.
BUG=2657
R=mflodman@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/5119004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5265 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/test/vcm_capturer.cc b/test/vcm_capturer.cc
index cbf7b1f..a5820bf 100644
--- a/test/vcm_capturer.cc
+++ b/test/vcm_capturer.cc
@@ -17,7 +17,7 @@
namespace test {
VcmCapturer::VcmCapturer(webrtc::VideoSendStreamInput* input)
- : VideoCapturer(input), started_(false), vcm_(NULL), last_timestamp_(0) {}
+ : VideoCapturer(input), started_(false), vcm_(NULL) {}
bool VcmCapturer::Init(size_t width, size_t height, size_t target_fps) {
VideoCaptureModule::DeviceInfo* device_info =
@@ -88,14 +88,8 @@
void VcmCapturer::OnIncomingCapturedFrame(const int32_t id,
I420VideoFrame& frame) {
- if (last_timestamp_ == 0 || frame.timestamp() < last_timestamp_) {
- last_timestamp_ = frame.timestamp();
- }
-
- if (started_) {
- input_->PutFrame(frame, frame.timestamp() - last_timestamp_);
- }
- last_timestamp_ = frame.timestamp();
+ if (started_)
+ input_->SwapFrame(&frame);
}
void VcmCapturer::OnCaptureDelayChanged(const int32_t id, const int32_t delay) {