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

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

Issue 2765243002: Delete RawVideoType enum, use the VideoType enum instead. (Closed)
Patch Set: Define constant webrtc::kI420, for backwards compatibility. Created 3 years, 8 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 0afa9aabeed2a4164f2c23bcdf7d7aa14b6a6640..5ee10665e7f8a82afa5346da8305080b8a13521d 100644
--- a/webrtc/modules/video_capture/video_capture_impl.cc
+++ b/webrtc/modules/video_capture/video_capture_impl.cc
@@ -89,7 +89,7 @@ VideoCaptureImpl::VideoCaptureImpl()
_requestedCapability.width = kDefaultWidth;
_requestedCapability.height = kDefaultHeight;
_requestedCapability.maxFPS = 30;
- _requestedCapability.rawType = kVideoI420;
+ _requestedCapability.videoType = VideoType::kI420;
memset(_incomingFrameTimesNanos, 0, sizeof(_incomingFrameTimesNanos));
}
@@ -134,11 +134,8 @@ int32_t VideoCaptureImpl::IncomingFrame(
TRACE_EVENT1("webrtc", "VC::IncomingFrame", "capture_time", captureTime);
// Not encoded, convert to I420.
- const VideoType commonVideoType =
- RawVideoTypeToCommonVideoVideoType(frameInfo.rawType);
-
- if (frameInfo.rawType != kVideoMJPEG &&
- CalcBufferSize(commonVideoType, width, abs(height)) !=
+ if (frameInfo.videoType != VideoType::kMJPEG &&
+ CalcBufferSize(frameInfo.videoType, width, abs(height)) !=
videoFrameLength) {
LOG(LS_ERROR) << "Wrong incoming frame length.";
return -1;
@@ -169,12 +166,12 @@ int32_t VideoCaptureImpl::IncomingFrame(
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
+ frameInfo.videoType, videoFrame, 0, 0, // No cropping
width, height, videoFrameLength,
apply_rotation ? _rotateFrame : kVideoRotation_0, buffer.get());
if (conversionResult < 0) {
LOG(LS_ERROR) << "Failed to convert capture frame from type "
- << frameInfo.rawType << "to I420.";
+ << static_cast<int>(frameInfo.videoType) << "to I420.";
return -1;
}
« no previous file with comments | « webrtc/modules/video_capture/video_capture_defines.h ('k') | webrtc/modules/video_capture/windows/device_info_ds.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698