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

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

Issue 2665113006: Delete DeviceInfoImpl::GetExpectedCaptureDelay and related declarations. (Closed)
Patch Set: Drop include of video_capture_delay.h, and definition of WindowsCaptureDelays. Created 3 years, 11 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 f3eefc8b069c4a0c7c5403dcd42425ad30bd3253..e2caeaa58fddd4413d9bed854a6d0d655bb2f10d 100644
--- a/webrtc/modules/video_capture/device_info_impl.cc
+++ b/webrtc/modules/video_capture/device_info_impl.cc
@@ -273,82 +273,6 @@ int32_t DeviceInfoImpl::GetBestMatchedCapability(
return bestformatIndex;
}
-/* Returns the expected Capture delay*/
-int32_t DeviceInfoImpl::GetExpectedCaptureDelay(
- const DelayValues delayValues[],
- const uint32_t sizeOfDelayValues,
- const char* productId,
- const uint32_t width,
- const uint32_t height)
-{
- int32_t bestDelay = kDefaultCaptureDelay;
-
- for (uint32_t device = 0; device < sizeOfDelayValues; ++device)
- {
- if (delayValues[device].productId && strncmp((char*) productId,
- (char*) delayValues[device].productId,
- kVideoCaptureProductIdLength) == 0)
- {
- // We have found the camera
-
- int32_t bestWidth = 0;
- int32_t bestHeight = 0;
-
- //Loop through all tested sizes and find one that seems fitting
- for (uint32_t delayIndex = 0; delayIndex < NoOfDelayValues; ++delayIndex)
- {
- const DelayValue& currentValue = delayValues[device].delayValues[delayIndex];
-
- const int32_t diffWidth = currentValue.width - width;
- const int32_t diffHeight = currentValue.height - height;
-
- const int32_t currentbestDiffWith = bestWidth - width;
- const int32_t currentbestDiffHeight = bestHeight - height;
-
- if ((diffHeight >= 0 && diffHeight <= abs(currentbestDiffHeight)) // Height better or equal than previous.
- || (currentbestDiffHeight < 0 && diffHeight >= currentbestDiffHeight))
- {
-
- if (diffHeight == currentbestDiffHeight) // Found best height. Care about the width)
- {
- if ((diffWidth >= 0 && diffWidth <= abs(currentbestDiffWith)) // Width better or equal
- || (currentbestDiffWith < 0 && diffWidth >= currentbestDiffWith))
- {
- if (diffWidth == currentbestDiffWith && diffHeight
- == currentbestDiffHeight) // Same size as previous
- {
- }
- else // Better width than previously
- {
- bestWidth = currentValue.width;
- bestHeight = currentValue.height;
- bestDelay = currentValue.delay;
- }
- }// else width no good
- }
- else // Better height
- {
- bestWidth = currentValue.width;
- bestHeight = currentValue.height;
- bestDelay = currentValue.delay;
- }
- }// else height not good
- }//end for
- break;
- }
- }
- if (bestDelay > kMaxCaptureDelay)
- {
- LOG(LS_WARNING) << "Expected capture delay (" << bestDelay
- << " ms) too high, using " << kMaxCaptureDelay
- << " ms.";
- bestDelay = kMaxCaptureDelay;
- }
-
- return bestDelay;
-
-}
-
//Default implementation. This should be overridden by Mobile implementations.
int32_t DeviceInfoImpl::GetOrientation(const char* deviceUniqueIdUTF8,
VideoRotation& orientation) {
« no previous file with comments | « webrtc/modules/video_capture/device_info_impl.h ('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