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

Unified Diff: webrtc/modules/video_capture/device_info_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/device_info_impl.cc
diff --git a/webrtc/modules/video_capture/device_info_impl.cc b/webrtc/modules/video_capture/device_info_impl.cc
index eade3aba50753adb7239b54e56fa4310f1d39032..35434c00fdd855f57afb7ae1bb8e6edee2180038 100644
--- a/webrtc/modules/video_capture/device_info_impl.cc
+++ b/webrtc/modules/video_capture/device_info_impl.cc
@@ -153,7 +153,7 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
int32_t bestWidth = 0;
int32_t bestHeight = 0;
int32_t bestFrameRate = 0;
- RawVideoType bestRawType = kVideoUnknown;
+ VideoType bestVideoType = VideoType::kUnknown;
const int32_t numberOfCapabilies =
static_cast<int32_t>(_captureCapabilities.size());
@@ -193,15 +193,15 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
if ((currentbestDiffFrameRate == diffFrameRate) // Same frame rate as previous or frame rate allready good enough
|| (currentbestDiffFrameRate >= 0))
{
- if (bestRawType != requested.rawType
- && requested.rawType != kVideoUnknown
- && (capability.rawType == requested.rawType
- || capability.rawType == kVideoI420
- || capability.rawType == kVideoYUY2
- || capability.rawType == kVideoYV12))
- {
- bestRawType = capability.rawType;
- bestformatIndex = tmp;
+ if (bestVideoType != requested.videoType &&
+ requested.videoType != VideoType::kUnknown &&
+ (capability.videoType ==
+ requested.videoType ||
+ capability.videoType == VideoType::kI420 ||
+ capability.videoType == VideoType::kYUY2 ||
+ capability.videoType == VideoType::kYV12)) {
+ bestVideoType = capability.videoType;
+ bestformatIndex = tmp;
}
// If width height and frame rate is full filled we can use the camera for encoding if it is supported.
if (capability.height == requested.height
@@ -216,7 +216,7 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
bestWidth = capability.width;
bestHeight = capability.height;
bestFrameRate = capability.maxFPS;
- bestRawType = capability.rawType;
+ bestVideoType = capability.videoType;
bestformatIndex = tmp;
}
}
@@ -226,7 +226,7 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
bestWidth = capability.width;
bestHeight = capability.height;
bestFrameRate = capability.maxFPS;
- bestRawType = capability.rawType;
+ bestVideoType = capability.videoType;
bestformatIndex = tmp;
}
}// else width no good
@@ -236,7 +236,7 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
bestWidth = capability.width;
bestHeight = capability.height;
bestFrameRate = capability.maxFPS;
- bestRawType = capability.rawType;
+ bestVideoType = capability.videoType;
bestformatIndex = tmp;
}
}// else height not good
@@ -244,7 +244,7 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
LOG(LS_VERBOSE) << "Best camera format: " << bestWidth << "x" << bestHeight
<< "@" << bestFrameRate
- << "fps, color format: " << bestRawType;
+ << "fps, color format: " << static_cast<int>(bestVideoType);
// Copy the capability
if (bestformatIndex < 0)
« no previous file with comments | « webrtc/media/engine/webrtcvideocapturer_unittest.cc ('k') | webrtc/modules/video_capture/linux/device_info_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698