Delete DeviceInfoImpl::GetExpectedCaptureDelay and related declarations.
This feature is unused. We can then also delete the header file video_capture_delay.h. BUG=None Review-Url: https://codereview.webrtc.org/2665113006 Cr-Commit-Position: refs/heads/master@{#16666}
This commit is contained in:
parent
3ff474b72b
commit
642943baea
@ -94,7 +94,6 @@ static bool FormatToCapability(const VideoFormat& format,
|
||||
cap->width = format.width;
|
||||
cap->height = format.height;
|
||||
cap->maxFPS = VideoFormat::IntervalToFps(format.interval);
|
||||
cap->expectedCaptureDelay = 0;
|
||||
cap->rawType = webrtc_type;
|
||||
cap->codecType = webrtc::kVideoCodecUnknown;
|
||||
cap->interlaced = false;
|
||||
|
||||
@ -19,7 +19,6 @@ rtc_static_library("video_capture_module") {
|
||||
"video_capture.h",
|
||||
"video_capture_config.h",
|
||||
"video_capture_defines.h",
|
||||
"video_capture_delay.h",
|
||||
"video_capture_factory.cc",
|
||||
"video_capture_factory.h",
|
||||
"video_capture_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) {
|
||||
|
||||
@ -14,7 +14,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/modules/video_capture/video_capture.h"
|
||||
#include "webrtc/modules/video_capture/video_capture_delay.h"
|
||||
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
|
||||
|
||||
namespace webrtc
|
||||
@ -48,12 +47,6 @@ protected:
|
||||
*/
|
||||
virtual int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8)=0;
|
||||
|
||||
/* Returns the expected Capture delay*/
|
||||
int32_t GetExpectedCaptureDelay(const DelayValues delayValues[],
|
||||
const uint32_t sizeOfDelayValues,
|
||||
const char* productId,
|
||||
const uint32_t width,
|
||||
const uint32_t height);
|
||||
protected:
|
||||
// Data members
|
||||
typedef std::vector<VideoCaptureCapability> VideoCaptureCapabilities;
|
||||
|
||||
@ -285,7 +285,6 @@ int32_t DeviceInfoLinux::FillCapabilities(int fd)
|
||||
VideoCaptureCapability cap;
|
||||
cap.width = video_fmt.fmt.pix.width;
|
||||
cap.height = video_fmt.fmt.pix.height;
|
||||
cap.expectedCaptureDelay = 120;
|
||||
if (videoFormats[fmts] == V4L2_PIX_FMT_YUYV)
|
||||
{
|
||||
cap.rawType = kVideoYUY2;
|
||||
|
||||
@ -227,7 +227,6 @@ int32_t VideoCaptureModuleV4L2::StartCapture(
|
||||
// initialize current width and height
|
||||
_currentWidth = video_fmt.fmt.pix.width;
|
||||
_currentHeight = video_fmt.fmt.pix.height;
|
||||
_captureDelay = 120;
|
||||
|
||||
// Trying to set frame rate, before check driver capability.
|
||||
bool driver_framerate_support = true;
|
||||
|
||||
@ -60,8 +60,6 @@
|
||||
capability.width = 352;
|
||||
capability.height = 288;
|
||||
capability.maxFPS = 30;
|
||||
capability.expectedCaptureDelay =
|
||||
webrtc::videocapturemodule::kDefaultCaptureDelay;
|
||||
capability.rawType = webrtc::kVideoNV12;
|
||||
capability.codecType = webrtc::kVideoCodecUnknown;
|
||||
capability.interlaced = false;
|
||||
@ -69,8 +67,6 @@
|
||||
capability.width = 640;
|
||||
capability.height = 480;
|
||||
capability.maxFPS = 30;
|
||||
capability.expectedCaptureDelay =
|
||||
webrtc::videocapturemodule::kDefaultCaptureDelay;
|
||||
capability.rawType = webrtc::kVideoNV12;
|
||||
capability.codecType = webrtc::kVideoCodecUnknown;
|
||||
capability.interlaced = false;
|
||||
@ -78,8 +74,6 @@
|
||||
capability.width = 1280;
|
||||
capability.height = 720;
|
||||
capability.maxFPS = 30;
|
||||
capability.expectedCaptureDelay =
|
||||
webrtc::videocapturemodule::kDefaultCaptureDelay;
|
||||
capability.rawType = webrtc::kVideoNV12;
|
||||
capability.codecType = webrtc::kVideoCodecUnknown;
|
||||
capability.interlaced = false;
|
||||
|
||||
@ -31,7 +31,6 @@ struct VideoCaptureCapability
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
int32_t maxFPS;
|
||||
int32_t expectedCaptureDelay;
|
||||
RawVideoType rawType;
|
||||
VideoCodecType codecType;
|
||||
bool interlaced;
|
||||
@ -41,7 +40,6 @@ struct VideoCaptureCapability
|
||||
width = 0;
|
||||
height = 0;
|
||||
maxFPS = 0;
|
||||
expectedCaptureDelay = 0;
|
||||
rawType = kVideoUnknown;
|
||||
codecType = kVideoCodecUnknown;
|
||||
interlaced = false;
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_DELAY_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_DELAY_H_
|
||||
|
||||
namespace webrtc
|
||||
{
|
||||
namespace videocapturemodule
|
||||
{
|
||||
|
||||
struct DelayValue
|
||||
{
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
int32_t delay;
|
||||
};
|
||||
|
||||
enum { NoOfDelayValues = 40 };
|
||||
struct DelayValues
|
||||
{
|
||||
char * deviceName;
|
||||
char* productId;
|
||||
DelayValue delayValues[NoOfDelayValues];
|
||||
};
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_VIDEO_CAPTURE_DELAY_H_
|
||||
@ -82,7 +82,6 @@ int32_t VideoCaptureImpl::RotationInDegrees(VideoRotation rotation,
|
||||
VideoCaptureImpl::VideoCaptureImpl()
|
||||
: _deviceUniqueId(NULL),
|
||||
_apiCs(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||
_captureDelay(0),
|
||||
_requestedCapability(),
|
||||
_lastProcessTimeNanos(rtc::TimeNanos()),
|
||||
_lastFrameRateCallbackTimeNanos(rtc::TimeNanos()),
|
||||
|
||||
@ -94,7 +94,6 @@ protected:
|
||||
|
||||
char* _deviceUniqueId; // current Device unique name;
|
||||
CriticalSectionWrapper& _apiCs;
|
||||
int32_t _captureDelay; // Current capture delay. May be changed of platform dependent parts.
|
||||
VideoCaptureCapability _requestedCapability; // Should be set by platform dependent code in StartCapture.
|
||||
private:
|
||||
void UpdateFrameCount();
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
#include "webrtc/modules/video_capture/windows/device_info_ds.h"
|
||||
|
||||
#include "webrtc/modules/video_capture/video_capture_config.h"
|
||||
#include "webrtc/modules/video_capture/video_capture_delay.h"
|
||||
#include "webrtc/modules/video_capture/windows/help_functions_ds.h"
|
||||
#include "webrtc/system_wrappers/include/trace.h"
|
||||
|
||||
@ -22,24 +21,6 @@ namespace webrtc
|
||||
{
|
||||
namespace videocapturemodule
|
||||
{
|
||||
const int32_t NoWindowsCaptureDelays = 1;
|
||||
const DelayValues WindowsCaptureDelays[NoWindowsCaptureDelays] = {
|
||||
"Microsoft LifeCam Cinema",
|
||||
"usb#vid_045e&pid_075d",
|
||||
{
|
||||
{640,480,125},
|
||||
{640,360,117},
|
||||
{424,240,111},
|
||||
{352,288,111},
|
||||
{320,240,116},
|
||||
{176,144,101},
|
||||
{160,120,109},
|
||||
{1280,720,166},
|
||||
{960,544,126},
|
||||
{800,448,120},
|
||||
{800,600,127}
|
||||
},
|
||||
};
|
||||
|
||||
// static
|
||||
DeviceInfoDS* DeviceInfoDS::Create()
|
||||
@ -658,13 +639,6 @@ int32_t DeviceInfoDS::CreateCapabilityMap(
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the expected capture delay from the static list
|
||||
capability.expectedCaptureDelay
|
||||
= GetExpectedCaptureDelay(WindowsCaptureDelays,
|
||||
NoWindowsCaptureDelays,
|
||||
productId,
|
||||
capability.width,
|
||||
capability.height);
|
||||
_captureCapabilities.push_back(capability);
|
||||
_captureCapabilitiesWindows.push_back(capability);
|
||||
WEBRTC_TRACE( webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
|
||||
|
||||
@ -233,8 +233,6 @@ int32_t VideoCaptureDS::SetCameraOutput(
|
||||
{
|
||||
capability.maxFPS = 30;
|
||||
}
|
||||
// Store the new expected capture delay
|
||||
_captureDelay = capability.expectedCaptureDelay;
|
||||
|
||||
// Convert it to the windows capability index since they are not nexessary
|
||||
// the same
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user