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@5265 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -17,7 +17,7 @@ namespace webrtc {
|
||||
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 @@ VcmCapturer::~VcmCapturer() { Destroy(); }
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user