Index: webrtc/modules/video_capture/video_capture_impl.cc |
diff --git a/webrtc/modules/video_capture/video_capture_impl.cc b/webrtc/modules/video_capture/video_capture_impl.cc |
index 90ac26713a2cd9ccd8ec1911bb5bce0c17fe2e23..e6b2d55f98692497229f905138113febc3ff50ae 100644 |
--- a/webrtc/modules/video_capture/video_capture_impl.cc |
+++ b/webrtc/modules/video_capture/video_capture_impl.cc |
@@ -275,14 +275,14 @@ |
// Setting absolute height (in case it was negative). |
// In Windows, the image starts bottom left, instead of top left. |
// Setting a negative source height, inverts the image (within LibYuv). |
- |
- // TODO(nisse): Use a pool? |
- rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create( |
- target_width, abs(target_height), stride_y, stride_uv, stride_uv); |
+ _captureFrame.CreateEmptyFrame(target_width, |
+ abs(target_height), |
+ stride_y, |
+ stride_uv, stride_uv); |
const int conversionResult = ConvertToI420( |
commonVideoType, videoFrame, 0, 0, // No cropping |
width, height, videoFrameLength, |
- apply_rotation ? _rotateFrame : kVideoRotation_0, buffer.get()); |
+ apply_rotation ? _rotateFrame : kVideoRotation_0, &_captureFrame); |
if (conversionResult < 0) |
{ |
LOG(LS_ERROR) << "Failed to convert capture frame from type " |
@@ -290,12 +290,15 @@ |
return -1; |
} |
- VideoFrame captureFrame( |
- buffer, 0, rtc::TimeMillis(), |
- !apply_rotation ? _rotateFrame : kVideoRotation_0); |
- captureFrame.set_ntp_time_ms(captureTime); |
- |
- DeliverCapturedFrame(captureFrame); |
+ if (!apply_rotation) { |
+ _captureFrame.set_rotation(_rotateFrame); |
+ } else { |
+ _captureFrame.set_rotation(kVideoRotation_0); |
+ } |
+ _captureFrame.set_ntp_time_ms(captureTime); |
+ _captureFrame.set_render_time_ms(rtc::TimeMillis()); |
+ |
+ DeliverCapturedFrame(_captureFrame); |
} |
else // Encoded format |
{ |