Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: webrtc/modules/video_capture/video_capture_impl.cc

Issue 2278883002: Move MutableDataY{,U,V} methods to I420Buffer only. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete unused variable. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 e6b2d55f98692497229f905138113febc3ff50ae..90ac26713a2cd9ccd8ec1911bb5bce0c17fe2e23 100644
--- a/webrtc/modules/video_capture/video_capture_impl.cc
+++ b/webrtc/modules/video_capture/video_capture_impl.cc
@@ -275,14 +275,14 @@ int32_t VideoCaptureImpl::IncomingFrame(
// 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).
- _captureFrame.CreateEmptyFrame(target_width,
- abs(target_height),
- stride_y,
- stride_uv, stride_uv);
+
+ // TODO(nisse): Use a pool?
+ rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create(
+ 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, &_captureFrame);
+ apply_rotation ? _rotateFrame : kVideoRotation_0, buffer.get());
if (conversionResult < 0)
{
LOG(LS_ERROR) << "Failed to convert capture frame from type "
@@ -290,15 +290,12 @@ int32_t VideoCaptureImpl::IncomingFrame(
return -1;
}
- 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());
+ VideoFrame captureFrame(
+ buffer, 0, rtc::TimeMillis(),
+ !apply_rotation ? _rotateFrame : kVideoRotation_0);
+ captureFrame.set_ntp_time_ms(captureTime);
- DeliverCapturedFrame(_captureFrame);
+ DeliverCapturedFrame(captureFrame);
}
else // Encoded format
{
« no previous file with comments | « webrtc/modules/video_capture/video_capture_impl.h ('k') | webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698