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

Unified Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 22876027: Consolidate duplicated frame / capability structures in video_capture_types.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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: content/browser/renderer_host/media/video_capture_controller.cc
diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc
index bac43289a214164353fe028bf61d7c311ec02431..3d5fbac76c7f51886d79a07c2d471fff3a85f57d 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -101,7 +101,7 @@ void VideoCaptureController::StartCapture(
DVLOG(1) << "VideoCaptureController::StartCapture, id " << id.device_id
<< ", (" << params.width
<< ", " << params.height
- << ", " << params.frame_per_second
+ << ", " << params.frame_rate
<< ", " << params.session_id
<< ")";
@@ -264,8 +264,8 @@ void VideoCaptureController::OnIncomingCapturedFrame(
int rotation,
bool flip_vert,
bool flip_horiz) {
- DCHECK(frame_info_.color == media::VideoCaptureCapability::kI420 ||
- frame_info_.color == media::VideoCaptureCapability::kYV12 ||
+ DCHECK(frame_info_.color == media::kI420 ||
+ frame_info_.color == media::kYV12 ||
(rotation == 0 && !flip_vert && !flip_horiz));
scoped_refptr<media::VideoFrame> dst;
@@ -287,26 +287,26 @@ void VideoCaptureController::OnIncomingCapturedFrame(
// Do color conversion from the camera format to I420.
switch (frame_info_.color) {
- case media::VideoCaptureCapability::kColorUnknown: // Color format not set.
+ case media::kColorUnknown: // Color format not set.
break;
- case media::VideoCaptureCapability::kI420:
+ case media::kI420:
DCHECK(!chopped_width_ && !chopped_height_);
RotatePackedYV12Frame(
data, yplane, uplane, vplane, frame_info_.width, frame_info_.height,
rotation, flip_vert, flip_horiz);
break;
- case media::VideoCaptureCapability::kYV12:
+ case media::kYV12:
DCHECK(!chopped_width_ && !chopped_height_);
RotatePackedYV12Frame(
data, yplane, vplane, uplane, frame_info_.width, frame_info_.height,
rotation, flip_vert, flip_horiz);
break;
- case media::VideoCaptureCapability::kNV21:
+ case media::kNV21:
DCHECK(!chopped_width_ && !chopped_height_);
media::ConvertNV21ToYUV(data, yplane, uplane, vplane, frame_info_.width,
frame_info_.height);
break;
- case media::VideoCaptureCapability::kYUY2:
+ case media::kYUY2:
DCHECK(!chopped_width_ && !chopped_height_);
if (frame_info_.width * frame_info_.height * 2 != length) {
// If |length| of |data| does not match the expected width and height
@@ -317,7 +317,7 @@ void VideoCaptureController::OnIncomingCapturedFrame(
media::ConvertYUY2ToYUV(data, yplane, uplane, vplane, frame_info_.width,
frame_info_.height);
break;
- case media::VideoCaptureCapability::kRGB24: {
+ case media::kRGB24: {
int ystride = frame_info_.width;
int uvstride = frame_info_.width / 2;
#if defined(OS_WIN) // RGB on Windows start at the bottom line.
@@ -333,14 +333,14 @@ void VideoCaptureController::OnIncomingCapturedFrame(
rgb_stride, ystride, uvstride);
break;
}
- case media::VideoCaptureCapability::kARGB:
+ case media::kARGB:
media::ConvertRGB32ToYUV(data, yplane, uplane, vplane, frame_info_.width,
frame_info_.height,
(frame_info_.width + chopped_width_) * 4,
frame_info_.width, frame_info_.width / 2);
break;
#if !defined(OS_IOS) && !defined(OS_ANDROID)
- case media::VideoCaptureCapability::kMJPEG: {
+ case media::kMJPEG: {
int yplane_stride = frame_info_.width;
int uv_plane_stride = (frame_info_.width + 1) / 2;
int crop_x = 0;

Powered by Google App Engine
This is Rietveld 408576698