WebRtc_Word32 -> int32_t in video_capture/
BUG=314 Review URL: https://webrtc-codereview.appspot.com/1298005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3811 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ddf94e71e5
commit
dfc5bb9c97
@ -30,7 +30,7 @@ void DeviceInfoAndroid::SetAndroidCaptureClasses(jclass capabilityClass) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoCaptureModule::DeviceInfo*
|
VideoCaptureModule::DeviceInfo*
|
||||||
VideoCaptureImpl::CreateDeviceInfo (const WebRtc_Word32 id) {
|
VideoCaptureImpl::CreateDeviceInfo (const int32_t id) {
|
||||||
videocapturemodule::DeviceInfoAndroid *deviceInfo =
|
videocapturemodule::DeviceInfoAndroid *deviceInfo =
|
||||||
new videocapturemodule::DeviceInfoAndroid(id);
|
new videocapturemodule::DeviceInfoAndroid(id);
|
||||||
if (deviceInfo && deviceInfo->Init() != 0) {
|
if (deviceInfo && deviceInfo->Init() != 0) {
|
||||||
@ -40,18 +40,18 @@ VideoCaptureImpl::CreateDeviceInfo (const WebRtc_Word32 id) {
|
|||||||
return deviceInfo;
|
return deviceInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceInfoAndroid::DeviceInfoAndroid(const WebRtc_Word32 id) :
|
DeviceInfoAndroid::DeviceInfoAndroid(const int32_t id) :
|
||||||
DeviceInfoImpl(id) {
|
DeviceInfoImpl(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoAndroid::Init() {
|
int32_t DeviceInfoAndroid::Init() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceInfoAndroid::~DeviceInfoAndroid() {
|
DeviceInfoAndroid::~DeviceInfoAndroid() {
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 DeviceInfoAndroid::NumberOfDevices() {
|
uint32_t DeviceInfoAndroid::NumberOfDevices() {
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
jclass javaCmDevInfoClass;
|
jclass javaCmDevInfoClass;
|
||||||
jobject javaCmDevInfoObject;
|
jobject javaCmDevInfoObject;
|
||||||
@ -83,19 +83,19 @@ WebRtc_UWord32 DeviceInfoAndroid::NumberOfDevices() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoAndroid::GetDeviceName(
|
int32_t DeviceInfoAndroid::GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* /*productUniqueIdUTF8*/,
|
char* /*productUniqueIdUTF8*/,
|
||||||
WebRtc_UWord32 /*productUniqueIdUTF8Length*/) {
|
uint32_t /*productUniqueIdUTF8Length*/) {
|
||||||
|
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
jclass javaCmDevInfoClass;
|
jclass javaCmDevInfoClass;
|
||||||
jobject javaCmDevInfoObject;
|
jobject javaCmDevInfoObject;
|
||||||
WebRtc_Word32 result = 0;
|
int32_t result = 0;
|
||||||
bool attached = false;
|
bool attached = false;
|
||||||
if (VideoCaptureAndroid::AttachAndUseAndroidDeviceInfoObjects(
|
if (VideoCaptureAndroid::AttachAndUseAndroidDeviceInfoObjects(
|
||||||
env,
|
env,
|
||||||
@ -122,7 +122,7 @@ WebRtc_Word32 DeviceInfoAndroid::GetDeviceName(
|
|||||||
,&isCopy);
|
,&isCopy);
|
||||||
const jsize javaDeviceNameCharLength =
|
const jsize javaDeviceNameCharLength =
|
||||||
env->GetStringUTFLength((jstring) javaDeviceNameObj);
|
env->GetStringUTFLength((jstring) javaDeviceNameObj);
|
||||||
if ((WebRtc_UWord32) javaDeviceNameCharLength <
|
if ((uint32_t) javaDeviceNameCharLength <
|
||||||
deviceUniqueIdUTF8Length) {
|
deviceUniqueIdUTF8Length) {
|
||||||
memcpy(deviceUniqueIdUTF8,
|
memcpy(deviceUniqueIdUTF8,
|
||||||
javaDeviceNameChar,
|
javaDeviceNameChar,
|
||||||
@ -134,7 +134,7 @@ WebRtc_Word32 DeviceInfoAndroid::GetDeviceName(
|
|||||||
__FUNCTION__);
|
__FUNCTION__);
|
||||||
result = -1;
|
result = -1;
|
||||||
}
|
}
|
||||||
if ((WebRtc_UWord32) javaDeviceNameCharLength < deviceNameLength) {
|
if ((uint32_t) javaDeviceNameCharLength < deviceNameLength) {
|
||||||
memcpy(deviceNameUTF8,
|
memcpy(deviceNameUTF8,
|
||||||
javaDeviceNameChar,
|
javaDeviceNameChar,
|
||||||
javaDeviceNameCharLength + 1);
|
javaDeviceNameCharLength + 1);
|
||||||
@ -159,7 +159,7 @@ WebRtc_Word32 DeviceInfoAndroid::GetDeviceName(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoAndroid::CreateCapabilityMap(
|
int32_t DeviceInfoAndroid::CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8) {
|
const char* deviceUniqueIdUTF8) {
|
||||||
MapItem* item = NULL;
|
MapItem* item = NULL;
|
||||||
while ((item = _captureCapabilities.Last())) {
|
while ((item = _captureCapabilities.Last())) {
|
||||||
@ -264,7 +264,7 @@ WebRtc_Word32 DeviceInfoAndroid::CreateCapabilityMap(
|
|||||||
return _captureCapabilities.Size();
|
return _captureCapabilities.Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoAndroid::GetOrientation(
|
int32_t DeviceInfoAndroid::GetOrientation(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
VideoCaptureRotation& orientation) {
|
VideoCaptureRotation& orientation) {
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
@ -301,7 +301,7 @@ WebRtc_Word32 DeviceInfoAndroid::GetOrientation(
|
|||||||
capureIdString);
|
capureIdString);
|
||||||
VideoCaptureAndroid::ReleaseAndroidDeviceInfoObjects(attached);
|
VideoCaptureAndroid::ReleaseAndroidDeviceInfoObjects(attached);
|
||||||
|
|
||||||
WebRtc_Word32 retValue = 0;
|
int32_t retValue = 0;
|
||||||
switch (jorientation) {
|
switch (jorientation) {
|
||||||
case -1: // Error
|
case -1: // Error
|
||||||
orientation = kCameraRotate0;
|
orientation = kCameraRotate0;
|
||||||
|
@ -30,28 +30,28 @@ class DeviceInfoAndroid : public DeviceInfoImpl {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static void SetAndroidCaptureClasses(jclass capabilityClass);
|
static void SetAndroidCaptureClasses(jclass capabilityClass);
|
||||||
DeviceInfoAndroid(const WebRtc_Word32 id);
|
DeviceInfoAndroid(const int32_t id);
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
virtual ~DeviceInfoAndroid();
|
virtual ~DeviceInfoAndroid();
|
||||||
virtual WebRtc_UWord32 NumberOfDevices();
|
virtual uint32_t NumberOfDevices();
|
||||||
virtual WebRtc_Word32 GetDeviceName(
|
virtual int32_t GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8 = 0,
|
char* productUniqueIdUTF8 = 0,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length = 0);
|
uint32_t productUniqueIdUTF8Length = 0);
|
||||||
virtual WebRtc_Word32 CreateCapabilityMap(const char* deviceUniqueIdUTF8);
|
virtual int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
virtual int32_t DisplayCaptureSettingsDialogBox(
|
||||||
const char* /*deviceUniqueIdUTF8*/,
|
const char* /*deviceUniqueIdUTF8*/,
|
||||||
const char* /*dialogTitleUTF8*/,
|
const char* /*dialogTitleUTF8*/,
|
||||||
void* /*parentWindow*/,
|
void* /*parentWindow*/,
|
||||||
WebRtc_UWord32 /*positionX*/,
|
uint32_t /*positionX*/,
|
||||||
WebRtc_UWord32 /*positionY*/) { return -1; }
|
uint32_t /*positionY*/) { return -1; }
|
||||||
virtual WebRtc_Word32 GetOrientation(const char* deviceUniqueIdUTF8,
|
virtual int32_t GetOrientation(const char* deviceUniqueIdUTF8,
|
||||||
VideoCaptureRotation& orientation);
|
VideoCaptureRotation& orientation);
|
||||||
private:
|
private:
|
||||||
bool IsDeviceNameMatches(const char* name, const char* deviceUniqueIdUTF8);
|
bool IsDeviceNameMatches(const char* name, const char* deviceUniqueIdUTF8);
|
||||||
enum {_expectedCaptureDelay = 190};
|
enum {_expectedCaptureDelay = 190};
|
||||||
|
@ -21,7 +21,7 @@ namespace webrtc
|
|||||||
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
||||||
// TODO(leozwang) These SetAndroidVM apis will be refactored, thus we only
|
// TODO(leozwang) These SetAndroidVM apis will be refactored, thus we only
|
||||||
// keep and reference java vm.
|
// keep and reference java vm.
|
||||||
WebRtc_Word32 SetCaptureAndroidVM(void* javaVM, void* javaContext) {
|
int32_t SetCaptureAndroidVM(void* javaVM, void* javaContext) {
|
||||||
return videocapturemodule::VideoCaptureAndroid::SetAndroidObjects(
|
return videocapturemodule::VideoCaptureAndroid::SetAndroidObjects(
|
||||||
javaVM,
|
javaVM,
|
||||||
javaContext);
|
javaContext);
|
||||||
@ -32,7 +32,7 @@ namespace videocapturemodule
|
|||||||
{
|
{
|
||||||
|
|
||||||
VideoCaptureModule* VideoCaptureImpl::Create(
|
VideoCaptureModule* VideoCaptureImpl::Create(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const char* deviceUniqueIdUTF8) {
|
const char* deviceUniqueIdUTF8) {
|
||||||
|
|
||||||
RefCountImpl<videocapturemodule::VideoCaptureAndroid>* implementation =
|
RefCountImpl<videocapturemodule::VideoCaptureAndroid>* implementation =
|
||||||
@ -64,8 +64,8 @@ jobject VideoCaptureAndroid::g_javaContext = NULL;
|
|||||||
/*
|
/*
|
||||||
* Register references to Java Capture class.
|
* Register references to Java Capture class.
|
||||||
*/
|
*/
|
||||||
WebRtc_Word32 VideoCaptureAndroid::SetAndroidObjects(void* javaVM,
|
int32_t VideoCaptureAndroid::SetAndroidObjects(void* javaVM,
|
||||||
void* javaContext) {
|
void* javaContext) {
|
||||||
|
|
||||||
g_jvm = static_cast<JavaVM*> (javaVM);
|
g_jvm = static_cast<JavaVM*> (javaVM);
|
||||||
g_javaContext = static_cast<jobject> (javaContext);
|
g_javaContext = static_cast<jobject> (javaContext);
|
||||||
@ -232,7 +232,7 @@ WebRtc_Word32 VideoCaptureAndroid::SetAndroidObjects(void* javaVM,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureAndroid::AttachAndUseAndroidDeviceInfoObjects(
|
int32_t VideoCaptureAndroid::AttachAndUseAndroidDeviceInfoObjects(
|
||||||
JNIEnv*& env,
|
JNIEnv*& env,
|
||||||
jclass& javaCmDevInfoClass,
|
jclass& javaCmDevInfoClass,
|
||||||
jobject& javaCmDevInfoObject,
|
jobject& javaCmDevInfoObject,
|
||||||
@ -263,7 +263,7 @@ WebRtc_Word32 VideoCaptureAndroid::AttachAndUseAndroidDeviceInfoObjects(
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureAndroid::ReleaseAndroidDeviceInfoObjects(
|
int32_t VideoCaptureAndroid::ReleaseAndroidDeviceInfoObjects(
|
||||||
bool attached) {
|
bool attached) {
|
||||||
if (attached && g_jvm->DetachCurrentThread() < 0) {
|
if (attached && g_jvm->DetachCurrentThread() < 0) {
|
||||||
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCapture, -1,
|
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCapture, -1,
|
||||||
@ -290,14 +290,14 @@ void JNICALL VideoCaptureAndroid::ProvideCameraFrame(JNIEnv * env,
|
|||||||
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture,
|
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture,
|
||||||
-1, "%s: IncomingFrame %d", __FUNCTION__,length);
|
-1, "%s: IncomingFrame %d", __FUNCTION__,length);
|
||||||
jbyte* cameraFrame= env->GetByteArrayElements(javaCameraFrame,NULL);
|
jbyte* cameraFrame= env->GetByteArrayElements(javaCameraFrame,NULL);
|
||||||
captureModule->IncomingFrame((WebRtc_UWord8*) cameraFrame,
|
captureModule->IncomingFrame((uint8_t*) cameraFrame,
|
||||||
length,captureModule->_frameInfo,0);
|
length,captureModule->_frameInfo,0);
|
||||||
env->ReleaseByteArrayElements(javaCameraFrame,cameraFrame,JNI_ABORT);
|
env->ReleaseByteArrayElements(javaCameraFrame,cameraFrame,JNI_ABORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VideoCaptureAndroid::VideoCaptureAndroid(const WebRtc_Word32 id)
|
VideoCaptureAndroid::VideoCaptureAndroid(const int32_t id)
|
||||||
: VideoCaptureImpl(id), _capInfo(id), _javaCaptureObj(NULL),
|
: VideoCaptureImpl(id), _capInfo(id), _javaCaptureObj(NULL),
|
||||||
_captureStarted(false) {
|
_captureStarted(false) {
|
||||||
WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCapture, -1,
|
WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCapture, -1,
|
||||||
@ -310,8 +310,8 @@ VideoCaptureAndroid::VideoCaptureAndroid(const WebRtc_Word32 id)
|
|||||||
// Initializes needed Java resources like the JNI interface to
|
// Initializes needed Java resources like the JNI interface to
|
||||||
// VideoCaptureAndroid.java
|
// VideoCaptureAndroid.java
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
WebRtc_Word32 VideoCaptureAndroid::Init(const WebRtc_Word32 id,
|
int32_t VideoCaptureAndroid::Init(const int32_t id,
|
||||||
const char* deviceUniqueIdUTF8) {
|
const char* deviceUniqueIdUTF8) {
|
||||||
const int nameLength = strlen(deviceUniqueIdUTF8);
|
const int nameLength = strlen(deviceUniqueIdUTF8);
|
||||||
if (nameLength >= kVideoCaptureUniqueNameLength) {
|
if (nameLength >= kVideoCaptureUniqueNameLength) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -468,14 +468,14 @@ VideoCaptureAndroid::~VideoCaptureAndroid() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureAndroid::StartCapture(
|
int32_t VideoCaptureAndroid::StartCapture(
|
||||||
const VideoCaptureCapability& capability) {
|
const VideoCaptureCapability& capability) {
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
||||||
"%s: ", __FUNCTION__);
|
"%s: ", __FUNCTION__);
|
||||||
|
|
||||||
bool isAttached = false;
|
bool isAttached = false;
|
||||||
WebRtc_Word32 result = 0;
|
int32_t result = 0;
|
||||||
// get the JNI env for this thread
|
// get the JNI env for this thread
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
if (g_jvm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
|
if (g_jvm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
|
||||||
@ -538,13 +538,13 @@ WebRtc_Word32 VideoCaptureAndroid::StartCapture(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureAndroid::StopCapture() {
|
int32_t VideoCaptureAndroid::StopCapture() {
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
||||||
"%s: ", __FUNCTION__);
|
"%s: ", __FUNCTION__);
|
||||||
|
|
||||||
bool isAttached = false;
|
bool isAttached = false;
|
||||||
WebRtc_Word32 result = 0;
|
int32_t result = 0;
|
||||||
// get the JNI env for this thread
|
// get the JNI env for this thread
|
||||||
JNIEnv *env = NULL;
|
JNIEnv *env = NULL;
|
||||||
if (g_jvm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
|
if (g_jvm->GetEnv((void**) &env, JNI_VERSION_1_4) != JNI_OK) {
|
||||||
@ -598,7 +598,7 @@ bool VideoCaptureAndroid::CaptureStarted() {
|
|||||||
return _captureStarted;
|
return _captureStarted;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureAndroid::CaptureSettings(
|
int32_t VideoCaptureAndroid::CaptureSettings(
|
||||||
VideoCaptureCapability& settings) {
|
VideoCaptureCapability& settings) {
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
WEBRTC_TRACE(webrtc::kTraceStateInfo, webrtc::kTraceVideoCapture, -1,
|
||||||
@ -607,7 +607,7 @@ WebRtc_Word32 VideoCaptureAndroid::CaptureSettings(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureAndroid::SetCaptureRotation(
|
int32_t VideoCaptureAndroid::SetCaptureRotation(
|
||||||
VideoCaptureRotation rotation) {
|
VideoCaptureRotation rotation) {
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
if (VideoCaptureImpl::SetCaptureRotation(rotation) == 0) {
|
if (VideoCaptureImpl::SetCaptureRotation(rotation) == 0) {
|
||||||
|
@ -22,25 +22,24 @@ namespace videocapturemodule {
|
|||||||
|
|
||||||
class VideoCaptureAndroid : public VideoCaptureImpl {
|
class VideoCaptureAndroid : public VideoCaptureImpl {
|
||||||
public:
|
public:
|
||||||
static WebRtc_Word32 SetAndroidObjects(void* javaVM, void* javaContext);
|
static int32_t SetAndroidObjects(void* javaVM, void* javaContext);
|
||||||
static WebRtc_Word32 AttachAndUseAndroidDeviceInfoObjects(
|
static int32_t AttachAndUseAndroidDeviceInfoObjects(
|
||||||
JNIEnv*& env,
|
JNIEnv*& env,
|
||||||
jclass& javaCmDevInfoClass,
|
jclass& javaCmDevInfoClass,
|
||||||
jobject& javaCmDevInfoObject,
|
jobject& javaCmDevInfoObject,
|
||||||
bool& attached);
|
bool& attached);
|
||||||
static WebRtc_Word32 ReleaseAndroidDeviceInfoObjects(bool attached);
|
static int32_t ReleaseAndroidDeviceInfoObjects(bool attached);
|
||||||
|
|
||||||
VideoCaptureAndroid(const WebRtc_Word32 id);
|
VideoCaptureAndroid(const int32_t id);
|
||||||
virtual WebRtc_Word32 Init(const WebRtc_Word32 id,
|
virtual int32_t Init(const int32_t id, const char* deviceUniqueIdUTF8);
|
||||||
const char* deviceUniqueIdUTF8);
|
|
||||||
|
|
||||||
|
|
||||||
virtual WebRtc_Word32 StartCapture(
|
virtual int32_t StartCapture(
|
||||||
const VideoCaptureCapability& capability);
|
const VideoCaptureCapability& capability);
|
||||||
virtual WebRtc_Word32 StopCapture();
|
virtual int32_t StopCapture();
|
||||||
virtual bool CaptureStarted();
|
virtual bool CaptureStarted();
|
||||||
virtual WebRtc_Word32 CaptureSettings(VideoCaptureCapability& settings);
|
virtual int32_t CaptureSettings(VideoCaptureCapability& settings);
|
||||||
virtual WebRtc_Word32 SetCaptureRotation(VideoCaptureRotation rotation);
|
virtual int32_t SetCaptureRotation(VideoCaptureRotation rotation);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~VideoCaptureAndroid();
|
virtual ~VideoCaptureAndroid();
|
||||||
|
@ -21,7 +21,7 @@ namespace webrtc
|
|||||||
{
|
{
|
||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
DeviceInfoImpl::DeviceInfoImpl(const WebRtc_Word32 id)
|
DeviceInfoImpl::DeviceInfoImpl(const int32_t id)
|
||||||
: _id(id), _apiLock(*RWLockWrapper::CreateRWLock()), _lastUsedDeviceName(NULL),
|
: _id(id), _apiLock(*RWLockWrapper::CreateRWLock()), _lastUsedDeviceName(NULL),
|
||||||
_lastUsedDeviceNameLength(0)
|
_lastUsedDeviceNameLength(0)
|
||||||
{
|
{
|
||||||
@ -42,7 +42,7 @@ DeviceInfoImpl::~DeviceInfoImpl(void)
|
|||||||
|
|
||||||
delete &_apiLock;
|
delete &_apiLock;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 DeviceInfoImpl::NumberOfCapabilities(
|
int32_t DeviceInfoImpl::NumberOfCapabilities(
|
||||||
const char* deviceUniqueIdUTF8)
|
const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -73,13 +73,13 @@ WebRtc_Word32 DeviceInfoImpl::NumberOfCapabilities(
|
|||||||
_apiLock.ReleaseLockShared();
|
_apiLock.ReleaseLockShared();
|
||||||
WriteLockScoped cs2(_apiLock);
|
WriteLockScoped cs2(_apiLock);
|
||||||
|
|
||||||
WebRtc_Word32 ret = CreateCapabilityMap(deviceUniqueIdUTF8);
|
int32_t ret = CreateCapabilityMap(deviceUniqueIdUTF8);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8,
|
int32_t DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8,
|
||||||
const WebRtc_UWord32 deviceCapabilityNumber,
|
const uint32_t deviceCapabilityNumber,
|
||||||
VideoCaptureCapability& capability)
|
VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!deviceUniqueIdUTF8)
|
if (!deviceUniqueIdUTF8)
|
||||||
@ -143,7 +143,7 @@ WebRtc_Word32 DeviceInfoImpl::GetCapability(const char* deviceUniqueIdUTF8,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoImpl::GetBestMatchedCapability(
|
int32_t DeviceInfoImpl::GetBestMatchedCapability(
|
||||||
const char*deviceUniqueIdUTF8,
|
const char*deviceUniqueIdUTF8,
|
||||||
const VideoCaptureCapability& requested,
|
const VideoCaptureCapability& requested,
|
||||||
VideoCaptureCapability& resulting)
|
VideoCaptureCapability& resulting)
|
||||||
@ -175,16 +175,16 @@ WebRtc_Word32 DeviceInfoImpl::GetBestMatchedCapability(
|
|||||||
_apiLock.AcquireLockShared();
|
_apiLock.AcquireLockShared();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 bestformatIndex = -1;
|
int32_t bestformatIndex = -1;
|
||||||
WebRtc_Word32 bestWidth = 0;
|
int32_t bestWidth = 0;
|
||||||
WebRtc_Word32 bestHeight = 0;
|
int32_t bestHeight = 0;
|
||||||
WebRtc_Word32 bestFrameRate = 0;
|
int32_t bestFrameRate = 0;
|
||||||
RawVideoType bestRawType = kVideoUnknown;
|
RawVideoType bestRawType = kVideoUnknown;
|
||||||
webrtc::VideoCodecType bestCodecType = webrtc::kVideoCodecUnknown;
|
webrtc::VideoCodecType bestCodecType = webrtc::kVideoCodecUnknown;
|
||||||
|
|
||||||
const WebRtc_Word32 numberOfCapabilies = _captureCapabilities.Size();
|
const int32_t numberOfCapabilies = _captureCapabilities.Size();
|
||||||
|
|
||||||
for (WebRtc_Word32 tmp = 0; tmp < numberOfCapabilies; ++tmp) // Loop through all capabilities
|
for (int32_t tmp = 0; tmp < numberOfCapabilies; ++tmp) // Loop through all capabilities
|
||||||
{
|
{
|
||||||
MapItem* item = _captureCapabilities.Find(tmp);
|
MapItem* item = _captureCapabilities.Find(tmp);
|
||||||
if (!item)
|
if (!item)
|
||||||
@ -193,13 +193,13 @@ WebRtc_Word32 DeviceInfoImpl::GetBestMatchedCapability(
|
|||||||
VideoCaptureCapability& capability = *static_cast<VideoCaptureCapability*>
|
VideoCaptureCapability& capability = *static_cast<VideoCaptureCapability*>
|
||||||
(item->GetItem());
|
(item->GetItem());
|
||||||
|
|
||||||
const WebRtc_Word32 diffWidth = capability.width - requested.width;
|
const int32_t diffWidth = capability.width - requested.width;
|
||||||
const WebRtc_Word32 diffHeight = capability.height - requested.height;
|
const int32_t diffHeight = capability.height - requested.height;
|
||||||
const WebRtc_Word32 diffFrameRate = capability.maxFPS - requested.maxFPS;
|
const int32_t diffFrameRate = capability.maxFPS - requested.maxFPS;
|
||||||
|
|
||||||
const WebRtc_Word32 currentbestDiffWith = bestWidth - requested.width;
|
const int32_t currentbestDiffWith = bestWidth - requested.width;
|
||||||
const WebRtc_Word32 currentbestDiffHeight = bestHeight - requested.height;
|
const int32_t currentbestDiffHeight = bestHeight - requested.height;
|
||||||
const WebRtc_Word32 currentbestDiffFrameRate = bestFrameRate - requested.maxFPS;
|
const int32_t currentbestDiffFrameRate = bestFrameRate - requested.maxFPS;
|
||||||
|
|
||||||
if ((diffHeight >= 0 && diffHeight <= abs(currentbestDiffHeight)) // Height better or equalt that previouse.
|
if ((diffHeight >= 0 && diffHeight <= abs(currentbestDiffHeight)) // Height better or equalt that previouse.
|
||||||
|| (currentbestDiffHeight < 0 && diffHeight >= currentbestDiffHeight))
|
|| (currentbestDiffHeight < 0 && diffHeight >= currentbestDiffHeight))
|
||||||
@ -311,16 +311,16 @@ WebRtc_Word32 DeviceInfoImpl::GetBestMatchedCapability(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the expected Capture delay*/
|
/* Returns the expected Capture delay*/
|
||||||
WebRtc_Word32 DeviceInfoImpl::GetExpectedCaptureDelay(
|
int32_t DeviceInfoImpl::GetExpectedCaptureDelay(
|
||||||
const DelayValues delayValues[],
|
const DelayValues delayValues[],
|
||||||
const WebRtc_UWord32 sizeOfDelayValues,
|
const uint32_t sizeOfDelayValues,
|
||||||
const char* productId,
|
const char* productId,
|
||||||
const WebRtc_UWord32 width,
|
const uint32_t width,
|
||||||
const WebRtc_UWord32 height)
|
const uint32_t height)
|
||||||
{
|
{
|
||||||
WebRtc_Word32 bestDelay = kDefaultCaptureDelay;
|
int32_t bestDelay = kDefaultCaptureDelay;
|
||||||
|
|
||||||
for (WebRtc_UWord32 device = 0; device < sizeOfDelayValues; ++device)
|
for (uint32_t device = 0; device < sizeOfDelayValues; ++device)
|
||||||
{
|
{
|
||||||
if (delayValues[device].productId && strncmp((char*) productId,
|
if (delayValues[device].productId && strncmp((char*) productId,
|
||||||
(char*) delayValues[device].productId,
|
(char*) delayValues[device].productId,
|
||||||
@ -328,19 +328,19 @@ WebRtc_Word32 DeviceInfoImpl::GetExpectedCaptureDelay(
|
|||||||
{
|
{
|
||||||
// We have found the camera
|
// We have found the camera
|
||||||
|
|
||||||
WebRtc_Word32 bestWidth = 0;
|
int32_t bestWidth = 0;
|
||||||
WebRtc_Word32 bestHeight = 0;
|
int32_t bestHeight = 0;
|
||||||
|
|
||||||
//Loop through all tested sizes and find one that seems fitting
|
//Loop through all tested sizes and find one that seems fitting
|
||||||
for (WebRtc_UWord32 delayIndex = 0; delayIndex < NoOfDelayValues; ++delayIndex)
|
for (uint32_t delayIndex = 0; delayIndex < NoOfDelayValues; ++delayIndex)
|
||||||
{
|
{
|
||||||
const DelayValue& currentValue = delayValues[device].delayValues[delayIndex];
|
const DelayValue& currentValue = delayValues[device].delayValues[delayIndex];
|
||||||
|
|
||||||
const WebRtc_Word32 diffWidth = currentValue.width - width;
|
const int32_t diffWidth = currentValue.width - width;
|
||||||
const WebRtc_Word32 diffHeight = currentValue.height - height;
|
const int32_t diffHeight = currentValue.height - height;
|
||||||
|
|
||||||
const WebRtc_Word32 currentbestDiffWith = bestWidth - width;
|
const int32_t currentbestDiffWith = bestWidth - width;
|
||||||
const WebRtc_Word32 currentbestDiffHeight = bestHeight - height;
|
const int32_t currentbestDiffHeight = bestHeight - height;
|
||||||
|
|
||||||
if ((diffHeight >= 0 && diffHeight <= abs(currentbestDiffHeight)) // Height better or equal than previous.
|
if ((diffHeight >= 0 && diffHeight <= abs(currentbestDiffHeight)) // Height better or equal than previous.
|
||||||
|| (currentbestDiffHeight < 0 && diffHeight >= currentbestDiffHeight))
|
|| (currentbestDiffHeight < 0 && diffHeight >= currentbestDiffHeight))
|
||||||
@ -388,8 +388,8 @@ WebRtc_Word32 DeviceInfoImpl::GetExpectedCaptureDelay(
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Default implementation. This should be overridden by Mobile implementations.
|
//Default implementation. This should be overridden by Mobile implementations.
|
||||||
WebRtc_Word32 DeviceInfoImpl::GetOrientation(const char* deviceUniqueIdUTF8,
|
int32_t DeviceInfoImpl::GetOrientation(const char* deviceUniqueIdUTF8,
|
||||||
VideoCaptureRotation& orientation)
|
VideoCaptureRotation& orientation)
|
||||||
{
|
{
|
||||||
orientation = kCameraRotate0;
|
orientation = kCameraRotate0;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -24,44 +24,44 @@ namespace videocapturemodule
|
|||||||
class DeviceInfoImpl: public VideoCaptureModule::DeviceInfo
|
class DeviceInfoImpl: public VideoCaptureModule::DeviceInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceInfoImpl(const WebRtc_Word32 id);
|
DeviceInfoImpl(const int32_t id);
|
||||||
virtual ~DeviceInfoImpl(void);
|
virtual ~DeviceInfoImpl(void);
|
||||||
virtual WebRtc_Word32 NumberOfCapabilities(const char* deviceUniqueIdUTF8);
|
virtual int32_t NumberOfCapabilities(const char* deviceUniqueIdUTF8);
|
||||||
virtual WebRtc_Word32 GetCapability(
|
virtual int32_t GetCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const WebRtc_UWord32 deviceCapabilityNumber,
|
const uint32_t deviceCapabilityNumber,
|
||||||
VideoCaptureCapability& capability);
|
VideoCaptureCapability& capability);
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetBestMatchedCapability(
|
virtual int32_t GetBestMatchedCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const VideoCaptureCapability& requested,
|
const VideoCaptureCapability& requested,
|
||||||
VideoCaptureCapability& resulting);
|
VideoCaptureCapability& resulting);
|
||||||
virtual WebRtc_Word32 GetOrientation(
|
virtual int32_t GetOrientation(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
VideoCaptureRotation& orientation);
|
VideoCaptureRotation& orientation);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* Initialize this object*/
|
/* Initialize this object*/
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init()=0;
|
virtual int32_t Init()=0;
|
||||||
/*
|
/*
|
||||||
* Fills the member variable _captureCapabilities with capabilities for the given device name.
|
* Fills the member variable _captureCapabilities with capabilities for the given device name.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 CreateCapabilityMap(const char* deviceUniqueIdUTF8)=0;
|
virtual int32_t CreateCapabilityMap(const char* deviceUniqueIdUTF8)=0;
|
||||||
|
|
||||||
/* Returns the expected Capture delay*/
|
/* Returns the expected Capture delay*/
|
||||||
WebRtc_Word32 GetExpectedCaptureDelay(const DelayValues delayValues[],
|
int32_t GetExpectedCaptureDelay(const DelayValues delayValues[],
|
||||||
const WebRtc_UWord32 sizeOfDelayValues,
|
const uint32_t sizeOfDelayValues,
|
||||||
const char* productId,
|
const char* productId,
|
||||||
const WebRtc_UWord32 width,
|
const uint32_t width,
|
||||||
const WebRtc_UWord32 height);
|
const uint32_t height);
|
||||||
protected:
|
protected:
|
||||||
// Data members
|
// Data members
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
MapWrapper _captureCapabilities;
|
MapWrapper _captureCapabilities;
|
||||||
RWLockWrapper& _apiLock;
|
RWLockWrapper& _apiLock;
|
||||||
char* _lastUsedDeviceName;
|
char* _lastUsedDeviceName;
|
||||||
WebRtc_UWord32 _lastUsedDeviceNameLength;
|
uint32_t _lastUsedDeviceNameLength;
|
||||||
};
|
};
|
||||||
} //namespace videocapturemodule
|
} //namespace videocapturemodule
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -17,34 +17,34 @@ namespace videocapturemodule {
|
|||||||
|
|
||||||
class ExternalDeviceInfo : public DeviceInfoImpl {
|
class ExternalDeviceInfo : public DeviceInfoImpl {
|
||||||
public:
|
public:
|
||||||
ExternalDeviceInfo(const WebRtc_Word32 id)
|
ExternalDeviceInfo(const int32_t id)
|
||||||
: DeviceInfoImpl(id) {
|
: DeviceInfoImpl(id) {
|
||||||
}
|
}
|
||||||
virtual ~ExternalDeviceInfo() {}
|
virtual ~ExternalDeviceInfo() {}
|
||||||
virtual WebRtc_UWord32 NumberOfDevices() { return 0; }
|
virtual uint32_t NumberOfDevices() { return 0; }
|
||||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
virtual int32_t DisplayCaptureSettingsDialogBox(
|
||||||
const char* /*deviceUniqueIdUTF8*/,
|
const char* /*deviceUniqueIdUTF8*/,
|
||||||
const char* /*dialogTitleUTF8*/,
|
const char* /*dialogTitleUTF8*/,
|
||||||
void* /*parentWindow*/,
|
void* /*parentWindow*/,
|
||||||
WebRtc_UWord32 /*positionX*/,
|
uint32_t /*positionX*/,
|
||||||
WebRtc_UWord32 /*positionY*/) { return -1; }
|
uint32_t /*positionY*/) { return -1; }
|
||||||
virtual WebRtc_Word32 GetDeviceName(
|
virtual int32_t GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8=0,
|
char* productUniqueIdUTF8=0,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length=0) {
|
uint32_t productUniqueIdUTF8Length=0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
virtual WebRtc_Word32 CreateCapabilityMap(
|
virtual int32_t CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8) { return 0; }
|
const char* deviceUniqueIdUTF8) { return 0; }
|
||||||
virtual WebRtc_Word32 Init() { return 0; }
|
virtual int32_t Init() { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
||||||
const WebRtc_Word32 id) {
|
const int32_t id) {
|
||||||
return new ExternalDeviceInfo(id);
|
return new ExternalDeviceInfo(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ namespace webrtc {
|
|||||||
namespace videocapturemodule {
|
namespace videocapturemodule {
|
||||||
|
|
||||||
VideoCaptureModule* VideoCaptureImpl::Create(
|
VideoCaptureModule* VideoCaptureImpl::Create(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
const char* deviceUniqueIdUTF8) {
|
const char* deviceUniqueIdUTF8) {
|
||||||
RefCountImpl<VideoCaptureImpl>* implementation =
|
RefCountImpl<VideoCaptureImpl>* implementation =
|
||||||
new RefCountImpl<VideoCaptureImpl>(id);
|
new RefCountImpl<VideoCaptureImpl>(id);
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
#if defined(WEBRTC_ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
|
||||||
WebRtc_Word32 SetCaptureAndroidVM(void* javaVM, void* javaContext);
|
int32_t SetCaptureAndroidVM(void* javaVM, void* javaContext);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class VideoCaptureModule: public RefCountedModule {
|
class VideoCaptureModule: public RefCountedModule {
|
||||||
@ -25,7 +25,7 @@ class VideoCaptureModule: public RefCountedModule {
|
|||||||
// Interface for receiving information about available camera devices.
|
// Interface for receiving information about available camera devices.
|
||||||
class DeviceInfo {
|
class DeviceInfo {
|
||||||
public:
|
public:
|
||||||
virtual WebRtc_UWord32 NumberOfDevices() = 0;
|
virtual uint32_t NumberOfDevices() = 0;
|
||||||
|
|
||||||
// Returns the available capture devices.
|
// Returns the available capture devices.
|
||||||
// deviceNumber - Index of capture device.
|
// deviceNumber - Index of capture device.
|
||||||
@ -34,93 +34,91 @@ class VideoCaptureModule: public RefCountedModule {
|
|||||||
// Otherwise same as deviceNameUTF8.
|
// Otherwise same as deviceNameUTF8.
|
||||||
// productUniqueIdUTF8 - Unique product id if it exist.
|
// productUniqueIdUTF8 - Unique product id if it exist.
|
||||||
// Null terminated otherwise.
|
// Null terminated otherwise.
|
||||||
virtual WebRtc_Word32 GetDeviceName(
|
virtual int32_t GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8 = 0,
|
char* productUniqueIdUTF8 = 0,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length = 0) = 0;
|
uint32_t productUniqueIdUTF8Length = 0) = 0;
|
||||||
|
|
||||||
|
|
||||||
// Returns the number of capabilities this device.
|
// Returns the number of capabilities this device.
|
||||||
virtual WebRtc_Word32 NumberOfCapabilities(
|
virtual int32_t NumberOfCapabilities(
|
||||||
const char* deviceUniqueIdUTF8) = 0;
|
const char* deviceUniqueIdUTF8) = 0;
|
||||||
|
|
||||||
// Gets the capabilities of the named device.
|
// Gets the capabilities of the named device.
|
||||||
virtual WebRtc_Word32 GetCapability(
|
virtual int32_t GetCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const WebRtc_UWord32 deviceCapabilityNumber,
|
const uint32_t deviceCapabilityNumber,
|
||||||
VideoCaptureCapability& capability) = 0;
|
VideoCaptureCapability& capability) = 0;
|
||||||
|
|
||||||
// Gets clockwise angle the captured frames should be rotated in order
|
// Gets clockwise angle the captured frames should be rotated in order
|
||||||
// to be displayed correctly on a normally rotated display.
|
// to be displayed correctly on a normally rotated display.
|
||||||
virtual WebRtc_Word32 GetOrientation(
|
virtual int32_t GetOrientation(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
VideoCaptureRotation& orientation) = 0;
|
VideoCaptureRotation& orientation) = 0;
|
||||||
|
|
||||||
// Gets the capability that best matches the requested width, height and
|
// Gets the capability that best matches the requested width, height and
|
||||||
// frame rate.
|
// frame rate.
|
||||||
// Returns the deviceCapabilityNumber on success.
|
// Returns the deviceCapabilityNumber on success.
|
||||||
virtual WebRtc_Word32 GetBestMatchedCapability(
|
virtual int32_t GetBestMatchedCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const VideoCaptureCapability& requested,
|
const VideoCaptureCapability& requested,
|
||||||
VideoCaptureCapability& resulting) = 0;
|
VideoCaptureCapability& resulting) = 0;
|
||||||
|
|
||||||
// Display OS /capture device specific settings dialog
|
// Display OS /capture device specific settings dialog
|
||||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
virtual int32_t DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8,
|
const char* dialogTitleUTF8,
|
||||||
void* parentWindow,
|
void* parentWindow,
|
||||||
WebRtc_UWord32 positionX,
|
uint32_t positionX,
|
||||||
WebRtc_UWord32 positionY) = 0;
|
uint32_t positionY) = 0;
|
||||||
|
|
||||||
virtual ~DeviceInfo() {}
|
virtual ~DeviceInfo() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class VideoCaptureEncodeInterface {
|
class VideoCaptureEncodeInterface {
|
||||||
public:
|
public:
|
||||||
virtual WebRtc_Word32 ConfigureEncoder(const VideoCodec& codec,
|
virtual int32_t ConfigureEncoder(const VideoCodec& codec,
|
||||||
WebRtc_UWord32 maxPayloadSize) = 0;
|
uint32_t maxPayloadSize) = 0;
|
||||||
// Inform the encoder about the new target bit rate.
|
// Inform the encoder about the new target bit rate.
|
||||||
// - newBitRate : New target bit rate in Kbit/s.
|
// - newBitRate : New target bit rate in Kbit/s.
|
||||||
// - frameRate : The target frame rate.
|
// - frameRate : The target frame rate.
|
||||||
virtual WebRtc_Word32 SetRates(WebRtc_Word32 newBitRate,
|
virtual int32_t SetRates(int32_t newBitRate, int32_t frameRate) = 0;
|
||||||
WebRtc_Word32 frameRate) = 0;
|
|
||||||
// Inform the encoder about the packet loss and the round-trip time.
|
// Inform the encoder about the packet loss and the round-trip time.
|
||||||
// - packetLoss : Fraction lost
|
// - packetLoss : Fraction lost
|
||||||
// (loss rate in percent = 100 * packetLoss / 255).
|
// (loss rate in percent = 100 * packetLoss / 255).
|
||||||
// - rtt : Round-trip time in milliseconds.
|
// - rtt : Round-trip time in milliseconds.
|
||||||
virtual WebRtc_Word32 SetChannelParameters(WebRtc_UWord32 packetLoss,
|
virtual int32_t SetChannelParameters(uint32_t packetLoss, int rtt) = 0;
|
||||||
int rtt) = 0;
|
|
||||||
|
|
||||||
// Encode the next frame as key frame.
|
// Encode the next frame as key frame.
|
||||||
virtual WebRtc_Word32 EncodeFrameType(const FrameType type) = 0;
|
virtual int32_t EncodeFrameType(const FrameType type) = 0;
|
||||||
protected:
|
protected:
|
||||||
virtual ~VideoCaptureEncodeInterface() {
|
virtual ~VideoCaptureEncodeInterface() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Register capture data callback
|
// Register capture data callback
|
||||||
virtual WebRtc_Word32 RegisterCaptureDataCallback(
|
virtual int32_t RegisterCaptureDataCallback(
|
||||||
VideoCaptureDataCallback& dataCallback) = 0;
|
VideoCaptureDataCallback& dataCallback) = 0;
|
||||||
|
|
||||||
// Remove capture data callback
|
// Remove capture data callback
|
||||||
virtual WebRtc_Word32 DeRegisterCaptureDataCallback() = 0;
|
virtual int32_t DeRegisterCaptureDataCallback() = 0;
|
||||||
|
|
||||||
// Register capture callback.
|
// Register capture callback.
|
||||||
virtual WebRtc_Word32 RegisterCaptureCallback(
|
virtual int32_t RegisterCaptureCallback(
|
||||||
VideoCaptureFeedBack& callBack) = 0;
|
VideoCaptureFeedBack& callBack) = 0;
|
||||||
|
|
||||||
// Remove capture callback.
|
// Remove capture callback.
|
||||||
virtual WebRtc_Word32 DeRegisterCaptureCallback() = 0;
|
virtual int32_t DeRegisterCaptureCallback() = 0;
|
||||||
|
|
||||||
// Start capture device
|
// Start capture device
|
||||||
virtual WebRtc_Word32 StartCapture(
|
virtual int32_t StartCapture(
|
||||||
const VideoCaptureCapability& capability) = 0;
|
const VideoCaptureCapability& capability) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 StopCapture() = 0;
|
virtual int32_t StopCapture() = 0;
|
||||||
|
|
||||||
// Returns the name of the device used by this module.
|
// Returns the name of the device used by this module.
|
||||||
virtual const char* CurrentDeviceName() const = 0;
|
virtual const char* CurrentDeviceName() const = 0;
|
||||||
@ -129,26 +127,26 @@ class VideoCaptureModule: public RefCountedModule {
|
|||||||
virtual bool CaptureStarted() = 0;
|
virtual bool CaptureStarted() = 0;
|
||||||
|
|
||||||
// Gets the current configuration.
|
// Gets the current configuration.
|
||||||
virtual WebRtc_Word32 CaptureSettings(VideoCaptureCapability& settings) = 0;
|
virtual int32_t CaptureSettings(VideoCaptureCapability& settings) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetCaptureDelay(WebRtc_Word32 delayMS) = 0;
|
virtual int32_t SetCaptureDelay(int32_t delayMS) = 0;
|
||||||
|
|
||||||
// Returns the current CaptureDelay. Only valid when the camera is running.
|
// Returns the current CaptureDelay. Only valid when the camera is running.
|
||||||
virtual WebRtc_Word32 CaptureDelay() = 0;
|
virtual int32_t CaptureDelay() = 0;
|
||||||
|
|
||||||
// Set the rotation of the captured frames.
|
// Set the rotation of the captured frames.
|
||||||
// If the rotation is set to the same as returned by
|
// If the rotation is set to the same as returned by
|
||||||
// DeviceInfo::GetOrientation the captured frames are
|
// DeviceInfo::GetOrientation the captured frames are
|
||||||
// displayed correctly if rendered.
|
// displayed correctly if rendered.
|
||||||
virtual WebRtc_Word32 SetCaptureRotation(VideoCaptureRotation rotation) = 0;
|
virtual int32_t SetCaptureRotation(VideoCaptureRotation rotation) = 0;
|
||||||
|
|
||||||
// Gets a pointer to an encode interface if the capture device supports the
|
// Gets a pointer to an encode interface if the capture device supports the
|
||||||
// requested type and size. NULL otherwise.
|
// requested type and size. NULL otherwise.
|
||||||
virtual VideoCaptureEncodeInterface* GetEncodeInterface(
|
virtual VideoCaptureEncodeInterface* GetEncodeInterface(
|
||||||
const VideoCodec& codec) = 0;
|
const VideoCodec& codec) = 0;
|
||||||
|
|
||||||
virtual WebRtc_Word32 EnableFrameRateCallback(const bool enable) = 0;
|
virtual int32_t EnableFrameRateCallback(const bool enable) = 0;
|
||||||
virtual WebRtc_Word32 EnableNoPictureAlarm(const bool enable) = 0;
|
virtual int32_t EnableNoPictureAlarm(const bool enable) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~VideoCaptureModule() {};
|
virtual ~VideoCaptureModule() {};
|
||||||
|
@ -37,10 +37,10 @@ enum VideoCaptureRotation
|
|||||||
|
|
||||||
struct VideoCaptureCapability
|
struct VideoCaptureCapability
|
||||||
{
|
{
|
||||||
WebRtc_Word32 width;
|
int32_t width;
|
||||||
WebRtc_Word32 height;
|
int32_t height;
|
||||||
WebRtc_Word32 maxFPS;
|
int32_t maxFPS;
|
||||||
WebRtc_Word32 expectedCaptureDelay;
|
int32_t expectedCaptureDelay;
|
||||||
RawVideoType rawType;
|
RawVideoType rawType;
|
||||||
VideoCodecType codecType;
|
VideoCodecType codecType;
|
||||||
bool interlaced;
|
bool interlaced;
|
||||||
@ -117,12 +117,12 @@ struct VideoFrameI420
|
|||||||
class VideoCaptureExternal
|
class VideoCaptureExternal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual WebRtc_Word32 IncomingFrame(WebRtc_UWord8* videoFrame,
|
virtual int32_t IncomingFrame(uint8_t* videoFrame,
|
||||||
WebRtc_Word32 videoFrameLength,
|
int32_t videoFrameLength,
|
||||||
const VideoCaptureCapability& frameInfo,
|
const VideoCaptureCapability& frameInfo,
|
||||||
WebRtc_Word64 captureTime = 0) = 0;
|
int64_t captureTime = 0) = 0;
|
||||||
virtual WebRtc_Word32 IncomingFrameI420(const VideoFrameI420& video_frame,
|
virtual int32_t IncomingFrameI420(const VideoFrameI420& video_frame,
|
||||||
WebRtc_Word64 captureTime = 0) = 0;
|
int64_t captureTime = 0) = 0;
|
||||||
protected:
|
protected:
|
||||||
~VideoCaptureExternal() {}
|
~VideoCaptureExternal() {}
|
||||||
};
|
};
|
||||||
@ -131,13 +131,13 @@ protected:
|
|||||||
class VideoCaptureDataCallback
|
class VideoCaptureDataCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void OnIncomingCapturedFrame(const WebRtc_Word32 id,
|
virtual void OnIncomingCapturedFrame(const int32_t id,
|
||||||
I420VideoFrame& videoFrame) = 0;
|
I420VideoFrame& videoFrame) = 0;
|
||||||
virtual void OnIncomingCapturedEncodedFrame(const WebRtc_Word32 id,
|
virtual void OnIncomingCapturedEncodedFrame(const int32_t id,
|
||||||
VideoFrame& videoFrame,
|
VideoFrame& videoFrame,
|
||||||
VideoCodecType codecType) = 0;
|
VideoCodecType codecType) = 0;
|
||||||
virtual void OnCaptureDelayChanged(const WebRtc_Word32 id,
|
virtual void OnCaptureDelayChanged(const int32_t id,
|
||||||
const WebRtc_Word32 delay) = 0;
|
const int32_t delay) = 0;
|
||||||
protected:
|
protected:
|
||||||
virtual ~VideoCaptureDataCallback(){}
|
virtual ~VideoCaptureDataCallback(){}
|
||||||
};
|
};
|
||||||
@ -145,9 +145,9 @@ protected:
|
|||||||
class VideoCaptureFeedBack
|
class VideoCaptureFeedBack
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void OnCaptureFrameRate(const WebRtc_Word32 id,
|
virtual void OnCaptureFrameRate(const int32_t id,
|
||||||
const WebRtc_UWord32 frameRate) = 0;
|
const uint32_t frameRate) = 0;
|
||||||
virtual void OnNoPictureAlarm(const WebRtc_Word32 id,
|
virtual void OnNoPictureAlarm(const int32_t id,
|
||||||
const VideoCaptureAlarm alarm) = 0;
|
const VideoCaptureAlarm alarm) = 0;
|
||||||
protected:
|
protected:
|
||||||
virtual ~VideoCaptureFeedBack(){}
|
virtual ~VideoCaptureFeedBack(){}
|
||||||
|
@ -24,20 +24,20 @@ class VideoCaptureFactory {
|
|||||||
// id - unique identifier of this video capture module object.
|
// id - unique identifier of this video capture module object.
|
||||||
// deviceUniqueIdUTF8 - name of the device.
|
// deviceUniqueIdUTF8 - name of the device.
|
||||||
// Available names can be found by using GetDeviceName
|
// Available names can be found by using GetDeviceName
|
||||||
static VideoCaptureModule* Create(const WebRtc_Word32 id,
|
static VideoCaptureModule* Create(const int32_t id,
|
||||||
const char* deviceUniqueIdUTF8);
|
const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
// Create a video capture module object used for external capture.
|
// Create a video capture module object used for external capture.
|
||||||
// id - unique identifier of this video capture module object
|
// id - unique identifier of this video capture module object
|
||||||
// externalCapture - [out] interface to call when a new frame is captured.
|
// externalCapture - [out] interface to call when a new frame is captured.
|
||||||
static VideoCaptureModule* Create(const WebRtc_Word32 id,
|
static VideoCaptureModule* Create(const int32_t id,
|
||||||
VideoCaptureExternal*& externalCapture);
|
VideoCaptureExternal*& externalCapture);
|
||||||
|
|
||||||
static VideoCaptureModule::DeviceInfo* CreateDeviceInfo(
|
static VideoCaptureModule::DeviceInfo* CreateDeviceInfo(
|
||||||
const WebRtc_Word32 id);
|
const int32_t id);
|
||||||
|
|
||||||
#ifdef WEBRTC_ANDROID
|
#ifdef WEBRTC_ANDROID
|
||||||
static WebRtc_Word32 SetAndroidObjects(void* javaVM, void* javaContext);
|
static int32_t SetAndroidObjects(void* javaVM, void* javaContext);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -30,7 +30,7 @@ namespace webrtc
|
|||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
VideoCaptureModule::DeviceInfo*
|
VideoCaptureModule::DeviceInfo*
|
||||||
VideoCaptureImpl::CreateDeviceInfo(const WebRtc_Word32 id)
|
VideoCaptureImpl::CreateDeviceInfo(const int32_t id)
|
||||||
{
|
{
|
||||||
videocapturemodule::DeviceInfoLinux *deviceInfo =
|
videocapturemodule::DeviceInfoLinux *deviceInfo =
|
||||||
new videocapturemodule::DeviceInfoLinux(id);
|
new videocapturemodule::DeviceInfoLinux(id);
|
||||||
@ -42,12 +42,12 @@ VideoCaptureImpl::CreateDeviceInfo(const WebRtc_Word32 id)
|
|||||||
return deviceInfo;
|
return deviceInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceInfoLinux::DeviceInfoLinux(const WebRtc_Word32 id)
|
DeviceInfoLinux::DeviceInfoLinux(const int32_t id)
|
||||||
: DeviceInfoImpl(id)
|
: DeviceInfoImpl(id)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoLinux::Init()
|
int32_t DeviceInfoLinux::Init()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -56,11 +56,11 @@ DeviceInfoLinux::~DeviceInfoLinux()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 DeviceInfoLinux::NumberOfDevices()
|
uint32_t DeviceInfoLinux::NumberOfDevices()
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideoCapture, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideoCapture, _id, "%s", __FUNCTION__);
|
||||||
|
|
||||||
WebRtc_UWord32 count = 0;
|
uint32_t count = 0;
|
||||||
char device[20];
|
char device[20];
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
|
|
||||||
@ -78,19 +78,19 @@ WebRtc_UWord32 DeviceInfoLinux::NumberOfDevices()
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoLinux::GetDeviceName(
|
int32_t DeviceInfoLinux::GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* /*productUniqueIdUTF8*/,
|
char* /*productUniqueIdUTF8*/,
|
||||||
WebRtc_UWord32 /*productUniqueIdUTF8Length*/)
|
uint32_t /*productUniqueIdUTF8Length*/)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideoCapture, _id, "%s", __FUNCTION__);
|
WEBRTC_TRACE(webrtc::kTraceApiCall, webrtc::kTraceVideoCapture, _id, "%s", __FUNCTION__);
|
||||||
|
|
||||||
// Travel through /dev/video [0-63]
|
// Travel through /dev/video [0-63]
|
||||||
WebRtc_UWord32 count = 0;
|
uint32_t count = 0;
|
||||||
char device[20];
|
char device[20];
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
@ -160,15 +160,15 @@ WebRtc_Word32 DeviceInfoLinux::GetDeviceName(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoLinux::CreateCapabilityMap(
|
int32_t DeviceInfoLinux::CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8)
|
const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
char device[32];
|
char device[32];
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
const WebRtc_Word32 deviceUniqueIdUTF8Length =
|
const int32_t deviceUniqueIdUTF8Length =
|
||||||
(WebRtc_Word32) strlen((char*) deviceUniqueIdUTF8);
|
(int32_t) strlen((char*) deviceUniqueIdUTF8);
|
||||||
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength)
|
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, "Device name too long");
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id, "Device name too long");
|
||||||
@ -250,7 +250,7 @@ bool DeviceInfoLinux::IsDeviceNameMatches(const char* name,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoLinux::FillCapabilityMap(int fd)
|
int32_t DeviceInfoLinux::FillCapabilityMap(int fd)
|
||||||
{
|
{
|
||||||
|
|
||||||
// set image format
|
// set image format
|
||||||
|
@ -21,29 +21,29 @@ namespace videocapturemodule
|
|||||||
class DeviceInfoLinux: public DeviceInfoImpl
|
class DeviceInfoLinux: public DeviceInfoImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceInfoLinux(const WebRtc_Word32 id);
|
DeviceInfoLinux(const int32_t id);
|
||||||
virtual ~DeviceInfoLinux();
|
virtual ~DeviceInfoLinux();
|
||||||
virtual WebRtc_UWord32 NumberOfDevices();
|
virtual uint32_t NumberOfDevices();
|
||||||
virtual WebRtc_Word32 GetDeviceName(
|
virtual int32_t GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8=0,
|
char* productUniqueIdUTF8=0,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length=0);
|
uint32_t productUniqueIdUTF8Length=0);
|
||||||
/*
|
/*
|
||||||
* Fills the membervariable _captureCapabilities with capabilites for the given device name.
|
* Fills the membervariable _captureCapabilities with capabilites for the given device name.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 CreateCapabilityMap (const char* deviceUniqueIdUTF8);
|
virtual int32_t CreateCapabilityMap (const char* deviceUniqueIdUTF8);
|
||||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
virtual int32_t DisplayCaptureSettingsDialogBox(
|
||||||
const char* /*deviceUniqueIdUTF8*/,
|
const char* /*deviceUniqueIdUTF8*/,
|
||||||
const char* /*dialogTitleUTF8*/,
|
const char* /*dialogTitleUTF8*/,
|
||||||
void* /*parentWindow*/,
|
void* /*parentWindow*/,
|
||||||
WebRtc_UWord32 /*positionX*/,
|
uint32_t /*positionX*/,
|
||||||
WebRtc_UWord32 /*positionY*/) { return -1;}
|
uint32_t /*positionY*/) { return -1;}
|
||||||
WebRtc_Word32 FillCapabilityMap(int fd);
|
int32_t FillCapabilityMap(int fd);
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool IsDeviceNameMatches(const char* name, const char* deviceUniqueIdUTF8);
|
bool IsDeviceNameMatches(const char* name, const char* deviceUniqueIdUTF8);
|
||||||
|
@ -31,7 +31,7 @@ namespace webrtc
|
|||||||
{
|
{
|
||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
VideoCaptureModule* VideoCaptureImpl::Create(const WebRtc_Word32 id,
|
VideoCaptureModule* VideoCaptureImpl::Create(const int32_t id,
|
||||||
const char* deviceUniqueId)
|
const char* deviceUniqueId)
|
||||||
{
|
{
|
||||||
RefCountImpl<videocapturemodule::VideoCaptureModuleV4L2>* implementation =
|
RefCountImpl<videocapturemodule::VideoCaptureModuleV4L2>* implementation =
|
||||||
@ -46,7 +46,7 @@ VideoCaptureModule* VideoCaptureImpl::Create(const WebRtc_Word32 id,
|
|||||||
return implementation;
|
return implementation;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoCaptureModuleV4L2::VideoCaptureModuleV4L2(const WebRtc_Word32 id)
|
VideoCaptureModuleV4L2::VideoCaptureModuleV4L2(const int32_t id)
|
||||||
: VideoCaptureImpl(id),
|
: VideoCaptureImpl(id),
|
||||||
_captureThread(NULL),
|
_captureThread(NULL),
|
||||||
_captureCritSect(CriticalSectionWrapper::CreateCriticalSection()),
|
_captureCritSect(CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
@ -62,7 +62,7 @@ VideoCaptureModuleV4L2::VideoCaptureModuleV4L2(const WebRtc_Word32 id)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureModuleV4L2::Init(const char* deviceUniqueIdUTF8)
|
int32_t VideoCaptureModuleV4L2::Init(const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
int len = strlen((const char*) deviceUniqueIdUTF8);
|
int len = strlen((const char*) deviceUniqueIdUTF8);
|
||||||
_deviceUniqueId = new (std::nothrow) char[len + 1];
|
_deviceUniqueId = new (std::nothrow) char[len + 1];
|
||||||
@ -121,7 +121,7 @@ VideoCaptureModuleV4L2::~VideoCaptureModuleV4L2()
|
|||||||
close(_deviceFd);
|
close(_deviceFd);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureModuleV4L2::StartCapture(
|
int32_t VideoCaptureModuleV4L2::StartCapture(
|
||||||
const VideoCaptureCapability& capability)
|
const VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
if (_captureStarted)
|
if (_captureStarted)
|
||||||
@ -298,7 +298,7 @@ WebRtc_Word32 VideoCaptureModuleV4L2::StartCapture(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureModuleV4L2::StopCapture()
|
int32_t VideoCaptureModuleV4L2::StopCapture()
|
||||||
{
|
{
|
||||||
if (_captureThread) {
|
if (_captureThread) {
|
||||||
// Make sure the capture thread stop stop using the critsect.
|
// Make sure the capture thread stop stop using the critsect.
|
||||||
@ -487,7 +487,7 @@ bool VideoCaptureModuleV4L2::CaptureProcess()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureModuleV4L2::CaptureSettings(VideoCaptureCapability& settings)
|
int32_t VideoCaptureModuleV4L2::CaptureSettings(VideoCaptureCapability& settings)
|
||||||
{
|
{
|
||||||
settings.width = _currentWidth;
|
settings.width = _currentWidth;
|
||||||
settings.height = _currentHeight;
|
settings.height = _currentHeight;
|
||||||
|
@ -23,13 +23,13 @@ namespace videocapturemodule
|
|||||||
class VideoCaptureModuleV4L2: public VideoCaptureImpl
|
class VideoCaptureModuleV4L2: public VideoCaptureImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoCaptureModuleV4L2(WebRtc_Word32 id);
|
VideoCaptureModuleV4L2(int32_t id);
|
||||||
virtual ~VideoCaptureModuleV4L2();
|
virtual ~VideoCaptureModuleV4L2();
|
||||||
virtual WebRtc_Word32 Init(const char* deviceUniqueId);
|
virtual int32_t Init(const char* deviceUniqueId);
|
||||||
virtual WebRtc_Word32 StartCapture(const VideoCaptureCapability& capability);
|
virtual int32_t StartCapture(const VideoCaptureCapability& capability);
|
||||||
virtual WebRtc_Word32 StopCapture();
|
virtual int32_t StopCapture();
|
||||||
virtual bool CaptureStarted();
|
virtual bool CaptureStarted();
|
||||||
virtual WebRtc_Word32 CaptureSettings(VideoCaptureCapability& settings);
|
virtual int32_t CaptureSettings(VideoCaptureCapability& settings);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum {kNoOfV4L2Bufffers=4};
|
enum {kNoOfV4L2Bufffers=4};
|
||||||
@ -42,13 +42,13 @@ private:
|
|||||||
ThreadWrapper* _captureThread;
|
ThreadWrapper* _captureThread;
|
||||||
CriticalSectionWrapper* _captureCritSect;
|
CriticalSectionWrapper* _captureCritSect;
|
||||||
|
|
||||||
WebRtc_Word32 _deviceId;
|
int32_t _deviceId;
|
||||||
WebRtc_Word32 _deviceFd;
|
int32_t _deviceFd;
|
||||||
|
|
||||||
WebRtc_Word32 _buffersAllocatedByDevice;
|
int32_t _buffersAllocatedByDevice;
|
||||||
WebRtc_Word32 _currentWidth;
|
int32_t _currentWidth;
|
||||||
WebRtc_Word32 _currentHeight;
|
int32_t _currentHeight;
|
||||||
WebRtc_Word32 _currentFrameRate;
|
int32_t _currentFrameRate;
|
||||||
bool _captureStarted;
|
bool _captureStarted;
|
||||||
RawVideoType _captureVideoType;
|
RawVideoType _captureVideoType;
|
||||||
struct Buffer
|
struct Buffer
|
||||||
|
@ -32,7 +32,7 @@ namespace videocapturemodule
|
|||||||
class VideoCaptureMacQTKit : public VideoCaptureImpl
|
class VideoCaptureMacQTKit : public VideoCaptureImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoCaptureMacQTKit(const WebRtc_Word32 id);
|
VideoCaptureMacQTKit(const int32_t id);
|
||||||
virtual ~VideoCaptureMacQTKit();
|
virtual ~VideoCaptureMacQTKit();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -45,37 +45,36 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void Destroy(VideoCaptureModule* module);
|
static void Destroy(VideoCaptureModule* module);
|
||||||
|
|
||||||
WebRtc_Word32 Init(const WebRtc_Word32 id,
|
int32_t Init(const int32_t id, const char* deviceUniqueIdUTF8);
|
||||||
const char* deviceUniqueIdUTF8);
|
|
||||||
|
|
||||||
|
|
||||||
// Start/Stop
|
// Start/Stop
|
||||||
virtual WebRtc_Word32 StartCapture(
|
virtual int32_t StartCapture(
|
||||||
const VideoCaptureCapability& capability);
|
const VideoCaptureCapability& capability);
|
||||||
virtual WebRtc_Word32 StopCapture();
|
virtual int32_t StopCapture();
|
||||||
|
|
||||||
// Properties of the set device
|
// Properties of the set device
|
||||||
|
|
||||||
virtual bool CaptureStarted();
|
virtual bool CaptureStarted();
|
||||||
|
|
||||||
WebRtc_Word32 CaptureSettings(VideoCaptureCapability& settings);
|
int32_t CaptureSettings(VideoCaptureCapability& settings);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Help functions
|
// Help functions
|
||||||
WebRtc_Word32 SetCameraOutput();
|
int32_t SetCameraOutput();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VideoCaptureMacQTKitObjC* _captureDevice;
|
VideoCaptureMacQTKitObjC* _captureDevice;
|
||||||
VideoCaptureMacQTKitInfoObjC* _captureInfo;
|
VideoCaptureMacQTKitInfoObjC* _captureInfo;
|
||||||
bool _isCapturing;
|
bool _isCapturing;
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
WebRtc_Word32 _captureWidth;
|
int32_t _captureWidth;
|
||||||
WebRtc_Word32 _captureHeight;
|
int32_t _captureHeight;
|
||||||
WebRtc_Word32 _captureFrameRate;
|
int32_t _captureFrameRate;
|
||||||
char _currentDeviceNameUTF8[MAX_NAME_LENGTH];
|
char _currentDeviceNameUTF8[MAX_NAME_LENGTH];
|
||||||
char _currentDeviceUniqueIdUTF8[MAX_NAME_LENGTH];
|
char _currentDeviceUniqueIdUTF8[MAX_NAME_LENGTH];
|
||||||
char _currentDeviceProductUniqueIDUTF8[MAX_NAME_LENGTH];
|
char _currentDeviceProductUniqueIDUTF8[MAX_NAME_LENGTH];
|
||||||
WebRtc_Word32 _frameCount;
|
int32_t _frameCount;
|
||||||
};
|
};
|
||||||
} // namespace videocapturemodule
|
} // namespace videocapturemodule
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -21,7 +21,7 @@ namespace webrtc
|
|||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
|
|
||||||
VideoCaptureMacQTKit::VideoCaptureMacQTKit(const WebRtc_Word32 id) :
|
VideoCaptureMacQTKit::VideoCaptureMacQTKit(const int32_t id) :
|
||||||
VideoCaptureImpl(id),
|
VideoCaptureImpl(id),
|
||||||
_captureDevice(NULL),
|
_captureDevice(NULL),
|
||||||
_captureInfo(NULL),
|
_captureInfo(NULL),
|
||||||
@ -55,14 +55,14 @@ VideoCaptureMacQTKit::~VideoCaptureMacQTKit()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKit::Init(
|
int32_t VideoCaptureMacQTKit::Init(
|
||||||
const WebRtc_Word32 id, const char* iDeviceUniqueIdUTF8)
|
const int32_t id, const char* iDeviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
|
|
||||||
|
|
||||||
const WebRtc_Word32 nameLength =
|
const int32_t nameLength =
|
||||||
(WebRtc_Word32) strlen((char*)iDeviceUniqueIdUTF8);
|
(int32_t) strlen((char*)iDeviceUniqueIdUTF8);
|
||||||
if(nameLength>kVideoCaptureUniqueNameLength)
|
if(nameLength>kVideoCaptureUniqueNameLength)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ WebRtc_Word32 VideoCaptureMacQTKit::Init(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKit::StartCapture(
|
int32_t VideoCaptureMacQTKit::StartCapture(
|
||||||
const VideoCaptureCapability& capability)
|
const VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ WebRtc_Word32 VideoCaptureMacQTKit::StartCapture(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKit::StopCapture()
|
int32_t VideoCaptureMacQTKit::StopCapture()
|
||||||
{
|
{
|
||||||
[_captureDevice stopCapture];
|
[_captureDevice stopCapture];
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ bool VideoCaptureMacQTKit::CaptureStarted()
|
|||||||
return _isCapturing;
|
return _isCapturing;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKit::CaptureSettings(VideoCaptureCapability& settings)
|
int32_t VideoCaptureMacQTKit::CaptureSettings(VideoCaptureCapability& settings)
|
||||||
{
|
{
|
||||||
settings.width = _captureWidth;
|
settings.width = _captureWidth;
|
||||||
settings.height = _captureHeight;
|
settings.height = _captureHeight;
|
||||||
|
@ -29,12 +29,12 @@ class VideoCaptureMacQTKitInfo: public DeviceInfoImpl
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VideoCaptureMacQTKitInfo(const WebRtc_Word32 id);
|
VideoCaptureMacQTKitInfo(const int32_t id);
|
||||||
virtual ~VideoCaptureMacQTKitInfo();
|
virtual ~VideoCaptureMacQTKitInfo();
|
||||||
|
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
|
|
||||||
virtual WebRtc_UWord32 NumberOfDevices();
|
virtual uint32_t NumberOfDevices();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the available capture devices.
|
* Returns the available capture devices.
|
||||||
@ -45,32 +45,32 @@ public:
|
|||||||
* productUniqueIdUTF8 - unique product id if it exist. Null terminated
|
* productUniqueIdUTF8 - unique product id if it exist. Null terminated
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 GetDeviceName(
|
virtual int32_t GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
|
uint32_t deviceNumber, char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength, char* deviceUniqueIdUTF8,
|
uint32_t deviceNameLength, char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8 = 0,
|
char* productUniqueIdUTF8 = 0,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length = 0);
|
uint32_t productUniqueIdUTF8Length = 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the number of capabilities for this device
|
* Returns the number of capabilities for this device
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 NumberOfCapabilities(
|
virtual int32_t NumberOfCapabilities(
|
||||||
const char* deviceUniqueIdUTF8);
|
const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Gets the capabilities of the named device
|
* Gets the capabilities of the named device
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 GetCapability(
|
virtual int32_t GetCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const WebRtc_UWord32 deviceCapabilityNumber,
|
const uint32_t deviceCapabilityNumber,
|
||||||
VideoCaptureCapability& capability);
|
VideoCaptureCapability& capability);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Gets the capability that best matches the requested width, height and frame rate.
|
* Gets the capability that best matches the requested width, height and frame rate.
|
||||||
* Returns the deviceCapabilityNumber on success.
|
* Returns the deviceCapabilityNumber on success.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 GetBestMatchedCapability(
|
virtual int32_t GetBestMatchedCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const VideoCaptureCapability& requested,
|
const VideoCaptureCapability& requested,
|
||||||
VideoCaptureCapability& resulting);
|
VideoCaptureCapability& resulting);
|
||||||
@ -78,13 +78,13 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Display OS /capture device specific settings dialog
|
* Display OS /capture device specific settings dialog
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
virtual int32_t DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8, void* parentWindow,
|
const char* dialogTitleUTF8, void* parentWindow,
|
||||||
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY);
|
uint32_t positionX, uint32_t positionY);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual WebRtc_Word32 CreateCapabilityMap(
|
virtual int32_t CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8);
|
const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
VideoCaptureMacQTKitInfoObjC* _captureInfo;
|
VideoCaptureMacQTKitInfoObjC* _captureInfo;
|
||||||
|
@ -19,7 +19,7 @@ namespace webrtc
|
|||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
|
|
||||||
VideoCaptureMacQTKitInfo::VideoCaptureMacQTKitInfo(const WebRtc_Word32 id) :
|
VideoCaptureMacQTKitInfo::VideoCaptureMacQTKitInfo(const int32_t id) :
|
||||||
DeviceInfoImpl(id)
|
DeviceInfoImpl(id)
|
||||||
{
|
{
|
||||||
_captureInfo = [[VideoCaptureMacQTKitInfoObjC alloc] init];
|
_captureInfo = [[VideoCaptureMacQTKitInfoObjC alloc] init];
|
||||||
@ -31,26 +31,26 @@ VideoCaptureMacQTKitInfo::~VideoCaptureMacQTKitInfo()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKitInfo::Init()
|
int32_t VideoCaptureMacQTKitInfo::Init()
|
||||||
{
|
{
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoCaptureMacQTKitInfo::NumberOfDevices()
|
uint32_t VideoCaptureMacQTKitInfo::NumberOfDevices()
|
||||||
{
|
{
|
||||||
|
|
||||||
WebRtc_UWord32 captureDeviceCount =
|
uint32_t captureDeviceCount =
|
||||||
[[_captureInfo getCaptureDeviceCount]intValue];
|
[[_captureInfo getCaptureDeviceCount]intValue];
|
||||||
return captureDeviceCount;
|
return captureDeviceCount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKitInfo::GetDeviceName(
|
int32_t VideoCaptureMacQTKitInfo::GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
|
uint32_t deviceNumber, char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength, char* deviceUniqueIdUTF8,
|
uint32_t deviceNameLength, char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
|
uint32_t deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
uint32_t productUniqueIdUTF8Length)
|
||||||
{
|
{
|
||||||
int errNum = [[_captureInfo getDeviceNamesFromIndex:deviceNumber
|
int errNum = [[_captureInfo getDeviceNamesFromIndex:deviceNumber
|
||||||
DefaultName:deviceNameUTF8 WithLength:deviceNameLength
|
DefaultName:deviceNameUTF8 WithLength:deviceNameLength
|
||||||
@ -61,7 +61,7 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::GetDeviceName(
|
|||||||
return errNum;
|
return errNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKitInfo::NumberOfCapabilities(
|
int32_t VideoCaptureMacQTKitInfo::NumberOfCapabilities(
|
||||||
const char* deviceUniqueIdUTF8)
|
const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
|
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
|
||||||
@ -73,9 +73,9 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::NumberOfCapabilities(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKitInfo::GetCapability(
|
int32_t VideoCaptureMacQTKitInfo::GetCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const WebRtc_UWord32 deviceCapabilityNumber,
|
const uint32_t deviceCapabilityNumber,
|
||||||
VideoCaptureCapability& capability)
|
VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
|
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
|
||||||
@ -87,7 +87,7 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::GetCapability(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKitInfo::GetBestMatchedCapability(
|
int32_t VideoCaptureMacQTKitInfo::GetBestMatchedCapability(
|
||||||
const char*deviceUniqueIdUTF8,
|
const char*deviceUniqueIdUTF8,
|
||||||
const VideoCaptureCapability& requested, VideoCaptureCapability& resulting)
|
const VideoCaptureCapability& requested, VideoCaptureCapability& resulting)
|
||||||
{
|
{
|
||||||
@ -99,10 +99,10 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::GetBestMatchedCapability(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKitInfo::DisplayCaptureSettingsDialogBox(
|
int32_t VideoCaptureMacQTKitInfo::DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8, void* parentWindow,
|
const char* dialogTitleUTF8, void* parentWindow,
|
||||||
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY)
|
uint32_t positionX, uint32_t positionY)
|
||||||
{
|
{
|
||||||
|
|
||||||
return [[_captureInfo
|
return [[_captureInfo
|
||||||
@ -112,7 +112,7 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::DisplayCaptureSettingsDialogBox(
|
|||||||
intValue];
|
intValue];
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQTKitInfo::CreateCapabilityMap(
|
int32_t VideoCaptureMacQTKitInfo::CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8)
|
const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
|
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
|
||||||
|
@ -48,19 +48,19 @@
|
|||||||
|
|
||||||
- (NSNumber*)getCaptureDeviceCount;
|
- (NSNumber*)getCaptureDeviceCount;
|
||||||
|
|
||||||
- (NSNumber*)getDeviceNamesFromIndex:(WebRtc_UWord32)index
|
- (NSNumber*)getDeviceNamesFromIndex:(uint32_t)index
|
||||||
DefaultName:(char*)deviceName
|
DefaultName:(char*)deviceName
|
||||||
WithLength:(WebRtc_UWord32)deviceNameLength
|
WithLength:(uint32_t)deviceNameLength
|
||||||
AndUniqueID:(char*)deviceUniqueID
|
AndUniqueID:(char*)deviceUniqueID
|
||||||
WithLength:(WebRtc_UWord32)deviceUniqueIDLength
|
WithLength:(uint32_t)deviceUniqueIDLength
|
||||||
AndProductID:(char*)deviceProductID
|
AndProductID:(char*)deviceProductID
|
||||||
WithLength:(WebRtc_UWord32)deviceProductIDLength;
|
WithLength:(uint32_t)deviceProductIDLength;
|
||||||
|
|
||||||
- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:
|
- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:
|
||||||
(const char*)deviceUniqueIdUTF8
|
(const char*)deviceUniqueIdUTF8
|
||||||
AndTitle:(const char*)dialogTitleUTF8
|
AndTitle:(const char*)dialogTitleUTF8
|
||||||
AndParentWindow:(void*) parentWindow AtX:(WebRtc_UWord32)positionX
|
AndParentWindow:(void*) parentWindow AtX:(uint32_t)positionX
|
||||||
AndY:(WebRtc_UWord32) positionY;
|
AndY:(uint32_t) positionY;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_QTKIT_VIDEO_CAPTURE_QTKIT_INFO_OBJC_H_
|
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_QTKIT_VIDEO_CAPTURE_QTKIT_INFO_OBJC_H_
|
||||||
|
@ -52,8 +52,8 @@ using namespace webrtc;
|
|||||||
- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:(const char*)deviceUniqueIdUTF8
|
- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:(const char*)deviceUniqueIdUTF8
|
||||||
AndTitle:(const char*)dialogTitleUTF8
|
AndTitle:(const char*)dialogTitleUTF8
|
||||||
AndParentWindow:(void*) parentWindow
|
AndParentWindow:(void*) parentWindow
|
||||||
AtX:(WebRtc_UWord32)positionX
|
AtX:(uint32_t)positionX
|
||||||
AndY:(WebRtc_UWord32) positionY
|
AndY:(uint32_t) positionY
|
||||||
{
|
{
|
||||||
NSString* strTitle = [NSString stringWithFormat:@"%s", dialogTitleUTF8];
|
NSString* strTitle = [NSString stringWithFormat:@"%s", dialogTitleUTF8];
|
||||||
NSString* strButton = @"Alright";
|
NSString* strButton = @"Alright";
|
||||||
@ -73,20 +73,20 @@ using namespace webrtc;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (NSNumber*)getDeviceNamesFromIndex:(WebRtc_UWord32)index
|
- (NSNumber*)getDeviceNamesFromIndex:(uint32_t)index
|
||||||
DefaultName:(char*)deviceName
|
DefaultName:(char*)deviceName
|
||||||
WithLength:(WebRtc_UWord32)deviceNameLength
|
WithLength:(uint32_t)deviceNameLength
|
||||||
AndUniqueID:(char*)deviceUniqueID
|
AndUniqueID:(char*)deviceUniqueID
|
||||||
WithLength:(WebRtc_UWord32)deviceUniqueIDLength
|
WithLength:(uint32_t)deviceUniqueIDLength
|
||||||
AndProductID:(char*)deviceProductID
|
AndProductID:(char*)deviceProductID
|
||||||
WithLength:(WebRtc_UWord32)deviceProductIDLength
|
WithLength:(uint32_t)deviceProductIDLength
|
||||||
{
|
{
|
||||||
if(NO == _OSSupportedInfo)
|
if(NO == _OSSupportedInfo)
|
||||||
{
|
{
|
||||||
return [NSNumber numberWithInt:0];
|
return [NSNumber numberWithInt:0];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(index >= (WebRtc_UWord32)_captureDeviceCountInfo)
|
if(index >= (uint32_t)_captureDeviceCountInfo)
|
||||||
{
|
{
|
||||||
return [NSNumber numberWithInt:-1];
|
return [NSNumber numberWithInt:-1];
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
namespace webrtc
|
namespace webrtc
|
||||||
{
|
{
|
||||||
|
|
||||||
VideoCaptureMacQuickTime::VideoCaptureMacQuickTime(WebRtc_Word32 iID) :
|
VideoCaptureMacQuickTime::VideoCaptureMacQuickTime(int32_t iID) :
|
||||||
VideoCaptureImpl(iID), // super class constructor
|
VideoCaptureImpl(iID), // super class constructor
|
||||||
_id(iID),
|
_id(iID),
|
||||||
_isCapturing(false),
|
_isCapturing(false),
|
||||||
@ -64,12 +64,12 @@ VideoCaptureMacQuickTime::~VideoCaptureMacQuickTime()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTime::Init(
|
int32_t VideoCaptureMacQuickTime::Init(
|
||||||
const WebRtc_Word32 id, const char* deviceUniqueIdUTF8)
|
const int32_t id, const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_Word32 nameLength =
|
const int32_t nameLength =
|
||||||
(WebRtc_Word32) strlen((char*) deviceUniqueIdUTF8);
|
(int32_t) strlen((char*) deviceUniqueIdUTF8);
|
||||||
if (nameLength > kVideoCaptureUniqueNameLength)
|
if (nameLength > kVideoCaptureUniqueNameLength)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ WebRtc_Word32 VideoCaptureMacQuickTime::Init(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTime::StartCapture(
|
int32_t VideoCaptureMacQuickTime::StartCapture(
|
||||||
const VideoCaptureCapability& capability)
|
const VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id, "%s:%d "
|
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id, "%s:%d "
|
||||||
@ -175,7 +175,7 @@ WebRtc_Word32 VideoCaptureMacQuickTime::StartCapture(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTime::StopCapture()
|
int32_t VideoCaptureMacQuickTime::StopCapture()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (VideoCaptureStop() == -1)
|
if (VideoCaptureStop() == -1)
|
||||||
@ -191,7 +191,7 @@ bool VideoCaptureMacQuickTime::CaptureStarted()
|
|||||||
return _isCapturing;
|
return _isCapturing;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTime::CaptureSettings(
|
int32_t VideoCaptureMacQuickTime::CaptureSettings(
|
||||||
VideoCaptureCapability& settings)
|
VideoCaptureCapability& settings)
|
||||||
{
|
{
|
||||||
settings.width = _captureCapability.width;
|
settings.width = _captureCapability.width;
|
||||||
@ -1003,9 +1003,9 @@ int VideoCaptureMacQuickTime::SendFrame(SGChannel /*sgChannel*/, char* data,
|
|||||||
// Will be set to true if we don't recognize the size and/or video
|
// Will be set to true if we don't recognize the size and/or video
|
||||||
// format.
|
// format.
|
||||||
bool convertFrame = false;
|
bool convertFrame = false;
|
||||||
WebRtc_Word32 width = 352;
|
int32_t width = 352;
|
||||||
WebRtc_Word32 height = 288;
|
int32_t height = 288;
|
||||||
WebRtc_Word32 frameSize = 0;
|
int32_t frameSize = 0;
|
||||||
|
|
||||||
VideoCaptureCapability captureCapability;
|
VideoCaptureCapability captureCapability;
|
||||||
captureCapability.width = width;
|
captureCapability.width = width;
|
||||||
@ -1042,8 +1042,8 @@ int VideoCaptureMacQuickTime::SendFrame(SGChannel /*sgChannel*/, char* data,
|
|||||||
== _captureCapability.height)
|
== _captureCapability.height)
|
||||||
{
|
{
|
||||||
// Ok format and size, send the frame to super class
|
// Ok format and size, send the frame to super class
|
||||||
IncomingFrame((WebRtc_UWord8*) data,
|
IncomingFrame((uint8_t*) data,
|
||||||
(WebRtc_Word32) frameSize, captureCapability,
|
(int32_t) frameSize, captureCapability,
|
||||||
TickTime::MillisecondTimestamp());
|
TickTime::MillisecondTimestamp());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1078,8 +1078,8 @@ int VideoCaptureMacQuickTime::SendFrame(SGChannel /*sgChannel*/, char* data,
|
|||||||
Ptr capturedFrame = GetPixBaseAddr(pixMap);
|
Ptr capturedFrame = GetPixBaseAddr(pixMap);
|
||||||
|
|
||||||
// Send the converted frame out to super class
|
// Send the converted frame out to super class
|
||||||
IncomingFrame((WebRtc_UWord8*) data,
|
IncomingFrame((uint8_t*) data,
|
||||||
(WebRtc_Word32) frameSize, captureCapability,
|
(int32_t) frameSize, captureCapability,
|
||||||
TickTime::MillisecondTimestamp());
|
TickTime::MillisecondTimestamp());
|
||||||
|
|
||||||
// Unlock the image data to get ready for the next frame.
|
// Unlock the image data to get ready for the next frame.
|
||||||
@ -1133,10 +1133,10 @@ int VideoCaptureMacQuickTime::SendFrame(SGChannel /*sgChannel*/, char* data,
|
|||||||
int height = (*rgbPixMap)->bounds.bottom;
|
int height = (*rgbPixMap)->bounds.bottom;
|
||||||
|
|
||||||
// 16 is for YUY2 format.
|
// 16 is for YUY2 format.
|
||||||
WebRtc_Word32 frameSize = (width * height * 16) >> 3;
|
int32_t frameSize = (width * height * 16) >> 3;
|
||||||
|
|
||||||
// Ok format and size, send the frame to super class
|
// Ok format and size, send the frame to super class
|
||||||
IncomingFrame((WebRtc_UWord8*) data, (WebRtc_Word32) frameSize,
|
IncomingFrame((uint8_t*) data, (int32_t) frameSize,
|
||||||
captureCapability, TickTime::MillisecondTimestamp());
|
captureCapability, TickTime::MillisecondTimestamp());
|
||||||
|
|
||||||
UnlockPixels(rgbPixMap);
|
UnlockPixels(rgbPixMap);
|
||||||
|
@ -18,116 +18,114 @@
|
|||||||
|
|
||||||
#include <QuickTime/QuickTime.h>
|
#include <QuickTime/QuickTime.h>
|
||||||
|
|
||||||
|
|
||||||
#include "../../device_info_impl.h"
|
#include "../../device_info_impl.h"
|
||||||
#include "../../video_capture_impl.h"
|
#include "../../video_capture_impl.h"
|
||||||
#include "list_wrapper.h"
|
#include "list_wrapper.h"
|
||||||
|
|
||||||
|
|
||||||
#define START_CODEC_WIDTH 352
|
#define START_CODEC_WIDTH 352
|
||||||
#define START_CODEC_HEIGHT 288
|
#define START_CODEC_HEIGHT 288
|
||||||
#define SLEEP(x) usleep(x * 1000);
|
#define SLEEP(x) usleep(x * 1000);
|
||||||
|
|
||||||
namespace webrtc
|
namespace webrtc {
|
||||||
{
|
|
||||||
class CriticalSectionWrapper;
|
class CriticalSectionWrapper;
|
||||||
class EventWrapper;
|
class EventWrapper;
|
||||||
class ThreadWrapper;
|
class ThreadWrapper;
|
||||||
|
|
||||||
class VideoCaptureMacQuickTime : public VideoCaptureImpl
|
class VideoCaptureMacQuickTime : public VideoCaptureImpl {
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
VideoCaptureMacQuickTime(const WebRtc_Word32 id);
|
VideoCaptureMacQuickTime(const int32_t id);
|
||||||
virtual ~VideoCaptureMacQuickTime();
|
virtual ~VideoCaptureMacQuickTime();
|
||||||
|
|
||||||
static void Destroy(VideoCaptureModule* module);
|
static void Destroy(VideoCaptureModule* module);
|
||||||
|
|
||||||
WebRtc_Word32 Init(const WebRtc_Word32 id,
|
int32_t Init(const int32_t id, const uint8_t* deviceUniqueIdUTF8);
|
||||||
const WebRtc_UWord8* deviceUniqueIdUTF8);
|
virtual int32_t StartCapture(const VideoCaptureCapability& capability);
|
||||||
virtual WebRtc_Word32 StartCapture(
|
virtual int32_t StopCapture();
|
||||||
const VideoCaptureCapability& capability);
|
virtual bool CaptureStarted();
|
||||||
virtual WebRtc_Word32 StopCapture();
|
virtual int32_t CaptureSettings(VideoCaptureCapability& settings);
|
||||||
virtual bool CaptureStarted();
|
|
||||||
virtual WebRtc_Word32 CaptureSettings(VideoCaptureCapability& settings);
|
|
||||||
|
|
||||||
// TODO: remove?
|
// TODO: remove?
|
||||||
int VideoCaptureInitThreadContext();
|
int VideoCaptureInitThreadContext();
|
||||||
int VideoCaptureTerminate();
|
int VideoCaptureTerminate();
|
||||||
int VideoCaptureSetCaptureDevice(const char* deviceName, int size);
|
int VideoCaptureSetCaptureDevice(const char* deviceName, int size);
|
||||||
int UpdateCaptureSettings(int channel, webrtc::VideoCodec& inst, bool def);
|
int UpdateCaptureSettings(int channel, webrtc::VideoCodec& inst, bool def);
|
||||||
int VideoCaptureRun();
|
int VideoCaptureRun();
|
||||||
int VideoCaptureStop();
|
int VideoCaptureStop();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
private: // functions
|
private: // functions
|
||||||
|
|
||||||
struct VideoCaptureMacName
|
struct VideoCaptureMacName {
|
||||||
{
|
VideoCaptureMacName();
|
||||||
VideoCaptureMacName();
|
|
||||||
|
|
||||||
enum { kVideoCaptureMacNameMaxSize = 64};
|
enum {
|
||||||
char _name[kVideoCaptureMacNameMaxSize];
|
kVideoCaptureMacNameMaxSize = 64
|
||||||
CFIndex _size;
|
|
||||||
};
|
};
|
||||||
|
char _name[kVideoCaptureMacNameMaxSize];
|
||||||
|
CFIndex _size;
|
||||||
|
};
|
||||||
|
|
||||||
// Timeout value [ms] if we want to create a new device list or not
|
// Timeout value [ms] if we want to create a new device list or not
|
||||||
enum { kVideoCaptureDeviceListTimeout = 5000};
|
enum {
|
||||||
// Temporary constant allowing this size from builtin iSight webcams.
|
kVideoCaptureDeviceListTimeout = 5000
|
||||||
enum { kYuy2_1280_1024_length = 2621440};
|
};
|
||||||
|
// Temporary constant allowing this size from builtin iSight webcams.
|
||||||
|
enum {
|
||||||
|
kYuy2_1280_1024_length = 2621440
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Capture device callback
|
// Capture device callback
|
||||||
static OSErr SendProcess(SGChannel sgChannel, Ptr p, long len, long *offset,
|
static OSErr SendProcess(SGChannel sgChannel, Ptr p, long len, long* offset,
|
||||||
long chRefCon, TimeValue time, short writeType,
|
long chRefCon, TimeValue time, short writeType,
|
||||||
long refCon);
|
long refCon);
|
||||||
int SendFrame(SGChannel sgChannel, char* data, long length, TimeValue time);
|
int SendFrame(SGChannel sgChannel, char* data, long length, TimeValue time);
|
||||||
|
|
||||||
// Capture device functions
|
// Capture device functions
|
||||||
int CreateLocalGWorld(int width, int height);
|
int CreateLocalGWorld(int width, int height);
|
||||||
int RemoveLocalGWorld();
|
int RemoveLocalGWorld();
|
||||||
int ConnectCaptureDevice();
|
int ConnectCaptureDevice();
|
||||||
int DisconnectCaptureDevice();
|
int DisconnectCaptureDevice();
|
||||||
virtual bool IsCaptureDeviceSelected();
|
virtual bool IsCaptureDeviceSelected();
|
||||||
|
|
||||||
// Process to make sure the capture device won't stop
|
// Process to make sure the capture device won't stop
|
||||||
static bool GrabberUpdateThread(void*);
|
static bool GrabberUpdateThread(void*);
|
||||||
bool GrabberUpdateProcess();
|
bool GrabberUpdateProcess();
|
||||||
|
|
||||||
// Starts and stops the capture
|
// Starts and stops the capture
|
||||||
int StartQuickTimeCapture();
|
int StartQuickTimeCapture();
|
||||||
int StopQuickTimeCapture(bool* wasCapturing = NULL);
|
int StopQuickTimeCapture(bool* wasCapturing = NULL);
|
||||||
|
|
||||||
static CFIndex PascalStringToCString(const unsigned char* pascalString,
|
static CFIndex PascalStringToCString(const unsigned char* pascalString,
|
||||||
char* cString,
|
char* cString, CFIndex bufferSize);
|
||||||
CFIndex bufferSize);
|
|
||||||
|
|
||||||
private: // variables
|
private : // variables
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
bool _isCapturing;
|
bool _isCapturing;
|
||||||
VideoCaptureCapability _captureCapability;
|
VideoCaptureCapability _captureCapability;
|
||||||
CriticalSectionWrapper* _grabberCritsect;
|
CriticalSectionWrapper* _grabberCritsect;
|
||||||
CriticalSectionWrapper* _videoMacCritsect;
|
CriticalSectionWrapper* _videoMacCritsect;
|
||||||
bool _terminated;
|
bool _terminated;
|
||||||
webrtc::ThreadWrapper* _grabberUpdateThread;
|
webrtc::ThreadWrapper* _grabberUpdateThread;
|
||||||
webrtc::EventWrapper* _grabberUpdateEvent;
|
webrtc::EventWrapper* _grabberUpdateEvent;
|
||||||
SeqGrabComponent _captureGrabber;
|
SeqGrabComponent _captureGrabber;
|
||||||
Component _captureDevice;
|
Component _captureDevice;
|
||||||
char _captureDeviceDisplayName[64];
|
char _captureDeviceDisplayName[64];
|
||||||
RawVideoType _captureVideoType;
|
RawVideoType _captureVideoType;
|
||||||
bool _captureIsInitialized;
|
bool _captureIsInitialized;
|
||||||
GWorldPtr _gWorld;
|
GWorldPtr _gWorld;
|
||||||
SGChannel _captureChannel;
|
SGChannel _captureChannel;
|
||||||
ImageSequence _captureSequence;
|
ImageSequence _captureSequence;
|
||||||
bool _sgPrepared;
|
bool _sgPrepared;
|
||||||
bool _sgStarted;
|
bool _sgStarted;
|
||||||
int _trueCaptureWidth;
|
int _trueCaptureWidth;
|
||||||
int _trueCaptureHeight;
|
int _trueCaptureHeight;
|
||||||
ListWrapper _captureDeviceList;
|
ListWrapper _captureDeviceList;
|
||||||
unsigned long _captureDeviceListTime;
|
unsigned long _captureDeviceListTime;
|
||||||
ListWrapper _captureCapabilityList;
|
ListWrapper _captureCapabilityList;
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_QUICKTIME_VIDEO_CAPTURE_QUICK_TIME_H_
|
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_QUICKTIME_VIDEO_CAPTURE_QUICK_TIME_H_
|
||||||
|
@ -26,7 +26,7 @@ namespace webrtc
|
|||||||
{
|
{
|
||||||
|
|
||||||
VideoCaptureMacQuickTimeInfo::VideoCaptureMacQuickTimeInfo(
|
VideoCaptureMacQuickTimeInfo::VideoCaptureMacQuickTimeInfo(
|
||||||
const WebRtc_Word32 iID) :
|
const int32_t iID) :
|
||||||
DeviceInfoImpl(iID), _id(iID),
|
DeviceInfoImpl(iID), _id(iID),
|
||||||
_grabberCritsect(CriticalSectionWrapper::CreateCriticalSection())
|
_grabberCritsect(CriticalSectionWrapper::CreateCriticalSection())
|
||||||
{
|
{
|
||||||
@ -36,13 +36,13 @@ VideoCaptureMacQuickTimeInfo::~VideoCaptureMacQuickTimeInfo()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::Init()
|
int32_t VideoCaptureMacQuickTimeInfo::Init()
|
||||||
{
|
{
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoCaptureMacQuickTimeInfo::NumberOfDevices()
|
uint32_t VideoCaptureMacQuickTimeInfo::NumberOfDevices()
|
||||||
{
|
{
|
||||||
int numOfDevices = 0;
|
int numOfDevices = 0;
|
||||||
|
|
||||||
@ -62,11 +62,11 @@ WebRtc_UWord32 VideoCaptureMacQuickTimeInfo::NumberOfDevices()
|
|||||||
return numOfDevices;
|
return numOfDevices;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetDeviceName(
|
int32_t VideoCaptureMacQuickTimeInfo::GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
|
uint32_t deviceNumber, char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameUTF8Length, char* deviceUniqueIdUTF8,
|
uint32_t deviceNameUTF8Length, char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
|
uint32_t deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
uint32_t productUniqueIdUTF8Length)
|
||||||
{
|
{
|
||||||
|
|
||||||
int numOfDevices = 0; // not needed for this function
|
int numOfDevices = 0; // not needed for this function
|
||||||
@ -76,7 +76,7 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetDeviceName(
|
|||||||
productUniqueIdUTF8Length, numOfDevices);
|
productUniqueIdUTF8Length, numOfDevices);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::NumberOfCapabilities(
|
int32_t VideoCaptureMacQuickTimeInfo::NumberOfCapabilities(
|
||||||
const char* deviceUniqueIdUTF8)
|
const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
||||||
@ -84,9 +84,9 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::NumberOfCapabilities(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetCapability(
|
int32_t VideoCaptureMacQuickTimeInfo::GetCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const WebRtc_UWord32 deviceCapabilityNumber,
|
const uint32_t deviceCapabilityNumber,
|
||||||
VideoCaptureCapability& capability)
|
VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
||||||
@ -94,7 +94,7 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetCapability(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetBestMatchedCapability(
|
int32_t VideoCaptureMacQuickTimeInfo::GetBestMatchedCapability(
|
||||||
const char*deviceUniqueIdUTF8,
|
const char*deviceUniqueIdUTF8,
|
||||||
const VideoCaptureCapability& requested, VideoCaptureCapability& resulting)
|
const VideoCaptureCapability& requested, VideoCaptureCapability& resulting)
|
||||||
{
|
{
|
||||||
@ -103,15 +103,15 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetBestMatchedCapability(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::DisplayCaptureSettingsDialogBox(
|
int32_t VideoCaptureMacQuickTimeInfo::DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8, void* parentWindow,
|
const char* dialogTitleUTF8, void* parentWindow,
|
||||||
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY)
|
uint32_t positionX, uint32_t positionY)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::CreateCapabilityMap(
|
int32_t VideoCaptureMacQuickTimeInfo::CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8)
|
const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
|
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
|
||||||
@ -120,10 +120,10 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::CreateCapabilityMap(
|
|||||||
}
|
}
|
||||||
|
|
||||||
int VideoCaptureMacQuickTimeInfo::GetCaptureDevices(
|
int VideoCaptureMacQuickTimeInfo::GetCaptureDevices(
|
||||||
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
|
uint32_t deviceNumber, char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameUTF8Length, char* deviceUniqueIdUTF8,
|
uint32_t deviceNameUTF8Length, char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
|
uint32_t deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length, int& numberOfDevices)
|
uint32_t productUniqueIdUTF8Length, int& numberOfDevices)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,15 +36,15 @@ class VideoCaptureMacQuickTimeInfo: public DeviceInfoImpl
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static DeviceInfo* Create(const WebRtc_Word32 id);
|
static DeviceInfo* Create(const int32_t id);
|
||||||
static void Destroy(DeviceInfo* deviceInfo);
|
static void Destroy(DeviceInfo* deviceInfo);
|
||||||
|
|
||||||
VideoCaptureMacQuickTimeInfo(const WebRtc_Word32 id);
|
VideoCaptureMacQuickTimeInfo(const int32_t id);
|
||||||
virtual ~VideoCaptureMacQuickTimeInfo();
|
virtual ~VideoCaptureMacQuickTimeInfo();
|
||||||
|
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
|
|
||||||
virtual WebRtc_UWord32 NumberOfDevices();
|
virtual uint32_t NumberOfDevices();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the available capture devices.
|
* Returns the available capture devices.
|
||||||
@ -55,12 +55,12 @@ public:
|
|||||||
* productUniqueIdUTF8 - unique product id if it exist. Null terminated
|
* productUniqueIdUTF8 - unique product id if it exist. Null terminated
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 GetDeviceName(
|
virtual int32_t GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
|
uint32_t deviceNumber, char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength, char* deviceUniqueIdUTF8,
|
uint32_t deviceNameLength, char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8 = 0,
|
char* productUniqueIdUTF8 = 0,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length = 0);
|
uint32_t productUniqueIdUTF8Length = 0);
|
||||||
|
|
||||||
|
|
||||||
// ************** The remaining public functions are not supported on Mac
|
// ************** The remaining public functions are not supported on Mac
|
||||||
@ -68,21 +68,21 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Returns the number of capabilities for this device
|
* Returns the number of capabilities for this device
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 NumberOfCapabilities(const char* deviceUniqueIdUTF8);
|
virtual int32_t NumberOfCapabilities(const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Gets the capabilities of the named device
|
* Gets the capabilities of the named device
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 GetCapability(
|
virtual int32_t GetCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const WebRtc_UWord32 deviceCapabilityNumber,
|
const uint32_t deviceCapabilityNumber,
|
||||||
VideoCaptureCapability& capability);
|
VideoCaptureCapability& capability);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Gets the capability that best matches the requested width, height and frame rate.
|
* Gets the capability that best matches the requested width, height and frame rate.
|
||||||
* Returns the deviceCapabilityNumber on success.
|
* Returns the deviceCapabilityNumber on success.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 GetBestMatchedCapability(
|
virtual int32_t GetBestMatchedCapability(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const VideoCaptureCapability& requested,
|
const VideoCaptureCapability& requested,
|
||||||
VideoCaptureCapability& resulting);
|
VideoCaptureCapability& resulting);
|
||||||
@ -90,13 +90,13 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Display OS /capture device specific settings dialog
|
* Display OS /capture device specific settings dialog
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
virtual int32_t DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8, void* parentWindow,
|
const char* dialogTitleUTF8, void* parentWindow,
|
||||||
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY);
|
uint32_t positionX, uint32_t positionY);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual WebRtc_Word32 CreateCapabilityMap(
|
virtual int32_t CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8);
|
const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -125,13 +125,13 @@ private:
|
|||||||
private:
|
private:
|
||||||
// private methods
|
// private methods
|
||||||
|
|
||||||
int GetCaptureDevices(WebRtc_UWord32 deviceNumber,
|
int GetCaptureDevices(uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameUTF8Length,
|
uint32_t deviceNameUTF8Length,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length,
|
uint32_t productUniqueIdUTF8Length,
|
||||||
int& numberOfDevices);
|
int& numberOfDevices);
|
||||||
|
|
||||||
static CFIndex PascalStringToCString(const unsigned char* pascalString,
|
static CFIndex PascalStringToCString(const unsigned char* pascalString,
|
||||||
@ -139,7 +139,7 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// member vars
|
// member vars
|
||||||
WebRtc_Word32 _id;
|
int32_t _id;
|
||||||
bool _terminated;
|
bool _terminated;
|
||||||
CriticalSectionWrapper* _grabberCritsect;
|
CriticalSectionWrapper* _grabberCritsect;
|
||||||
webrtc::Trace* _trace;
|
webrtc::Trace* _trace;
|
||||||
@ -159,7 +159,7 @@ private:
|
|||||||
int _trueCaptureWidth;
|
int _trueCaptureWidth;
|
||||||
int _trueCaptureHeight;
|
int _trueCaptureHeight;
|
||||||
ListWrapper _captureDeviceList;
|
ListWrapper _captureDeviceList;
|
||||||
WebRtc_Word64 _captureDeviceListTime;
|
int64_t _captureDeviceListTime;
|
||||||
ListWrapper _captureCapabilityList;
|
ListWrapper _captureCapabilityList;
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -106,14 +106,14 @@ bool CheckQTVersion()
|
|||||||
* Returns version of the module and its components
|
* Returns version of the module and its components
|
||||||
*
|
*
|
||||||
* version - buffer to which the version will be written
|
* version - buffer to which the version will be written
|
||||||
* remainingBufferInBytes - remaining number of WebRtc_Word8 in the version
|
* remainingBufferInBytes - remaining number of int8_t in the version
|
||||||
* buffer
|
* buffer
|
||||||
* position - position of the next empty WebRtc_Word8 in the
|
* position - position of the next empty int8_t in the
|
||||||
* version buffer
|
* version buffer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
VideoCaptureModule* VideoCaptureImpl::Create(
|
VideoCaptureModule* VideoCaptureImpl::Create(
|
||||||
const WebRtc_Word32 id, const char* deviceUniqueIdUTF8)
|
const int32_t id, const char* deviceUniqueIdUTF8)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (webrtc::videocapturemodule::CheckOSVersion() == false)
|
if (webrtc::videocapturemodule::CheckOSVersion() == false)
|
||||||
@ -206,7 +206,7 @@ VideoCaptureModule* VideoCaptureImpl::Create(
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
VideoCaptureModule::DeviceInfo*
|
VideoCaptureModule::DeviceInfo*
|
||||||
VideoCaptureImpl::CreateDeviceInfo(const WebRtc_Word32 id)
|
VideoCaptureImpl::CreateDeviceInfo(const int32_t id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ using webrtc::VideoCaptureModule;
|
|||||||
#define WAIT_(ex, timeout, res) \
|
#define WAIT_(ex, timeout, res) \
|
||||||
do { \
|
do { \
|
||||||
res = (ex); \
|
res = (ex); \
|
||||||
WebRtc_Word64 start = TickTime::MillisecondTimestamp(); \
|
int64_t start = TickTime::MillisecondTimestamp(); \
|
||||||
while (!res && TickTime::MillisecondTimestamp() < start + timeout) { \
|
while (!res && TickTime::MillisecondTimestamp() < start + timeout) { \
|
||||||
SleepMs(5); \
|
SleepMs(5); \
|
||||||
res = (ex); \
|
res = (ex); \
|
||||||
@ -154,7 +154,7 @@ class TestVideoCaptureCallback : public VideoCaptureDataCallback {
|
|||||||
printf("No of timing warnings %d\n", timing_warnings_);
|
printf("No of timing warnings %d\n", timing_warnings_);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnIncomingCapturedFrame(const WebRtc_Word32 id,
|
virtual void OnIncomingCapturedFrame(const int32_t id,
|
||||||
webrtc::I420VideoFrame& videoFrame) {
|
webrtc::I420VideoFrame& videoFrame) {
|
||||||
CriticalSectionScoped cs(capture_cs_.get());
|
CriticalSectionScoped cs(capture_cs_.get());
|
||||||
|
|
||||||
@ -186,15 +186,15 @@ class TestVideoCaptureCallback : public VideoCaptureDataCallback {
|
|||||||
last_render_time_ms_ = videoFrame.render_time_ms();
|
last_render_time_ms_ = videoFrame.render_time_ms();
|
||||||
last_frame_.CopyFrame(videoFrame);
|
last_frame_.CopyFrame(videoFrame);
|
||||||
}
|
}
|
||||||
virtual void OnIncomingCapturedEncodedFrame(const WebRtc_Word32 id,
|
virtual void OnIncomingCapturedEncodedFrame(const int32_t id,
|
||||||
webrtc::VideoFrame& videoFrame,
|
webrtc::VideoFrame& videoFrame,
|
||||||
webrtc::VideoCodecType codecType)
|
webrtc::VideoCodecType codecType)
|
||||||
{
|
{
|
||||||
assert(!"NOTIMPLEMENTED");
|
assert(!"NOTIMPLEMENTED");
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnCaptureDelayChanged(const WebRtc_Word32 id,
|
virtual void OnCaptureDelayChanged(const int32_t id,
|
||||||
const WebRtc_Word32 delay) {
|
const int32_t delay) {
|
||||||
CriticalSectionScoped cs(capture_cs_.get());
|
CriticalSectionScoped cs(capture_cs_.get());
|
||||||
capture_delay_ = delay;
|
capture_delay_ = delay;
|
||||||
}
|
}
|
||||||
@ -243,7 +243,7 @@ class TestVideoCaptureCallback : public VideoCaptureDataCallback {
|
|||||||
scoped_ptr<CriticalSectionWrapper> capture_cs_;
|
scoped_ptr<CriticalSectionWrapper> capture_cs_;
|
||||||
VideoCaptureCapability capability_;
|
VideoCaptureCapability capability_;
|
||||||
int capture_delay_;
|
int capture_delay_;
|
||||||
WebRtc_Word64 last_render_time_ms_;
|
int64_t last_render_time_ms_;
|
||||||
int incoming_frames_;
|
int incoming_frames_;
|
||||||
int timing_warnings_;
|
int timing_warnings_;
|
||||||
webrtc::I420VideoFrame last_frame_;
|
webrtc::I420VideoFrame last_frame_;
|
||||||
@ -258,13 +258,13 @@ class TestVideoCaptureFeedBack : public VideoCaptureFeedBack {
|
|||||||
alarm_(webrtc::Cleared) {
|
alarm_(webrtc::Cleared) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnCaptureFrameRate(const WebRtc_Word32 id,
|
virtual void OnCaptureFrameRate(const int32_t id,
|
||||||
const WebRtc_UWord32 frameRate) {
|
const uint32_t frameRate) {
|
||||||
CriticalSectionScoped cs(capture_cs_.get());
|
CriticalSectionScoped cs(capture_cs_.get());
|
||||||
frame_rate_ = frameRate;
|
frame_rate_ = frameRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnNoPictureAlarm(const WebRtc_Word32 id,
|
virtual void OnNoPictureAlarm(const int32_t id,
|
||||||
const VideoCaptureAlarm reported_alarm) {
|
const VideoCaptureAlarm reported_alarm) {
|
||||||
CriticalSectionScoped cs(capture_cs_.get());
|
CriticalSectionScoped cs(capture_cs_.get());
|
||||||
alarm_ = reported_alarm;
|
alarm_ = reported_alarm;
|
||||||
@ -332,7 +332,7 @@ class VideoCaptureTest : public testing::Test {
|
|||||||
|
|
||||||
TEST_F(VideoCaptureTest, CreateDelete) {
|
TEST_F(VideoCaptureTest, CreateDelete) {
|
||||||
for (int i = 0; i < 5; ++i) {
|
for (int i = 0; i < 5; ++i) {
|
||||||
WebRtc_Word64 start_time = TickTime::MillisecondTimestamp();
|
int64_t start_time = TickTime::MillisecondTimestamp();
|
||||||
TestVideoCaptureCallback capture_observer;
|
TestVideoCaptureCallback capture_observer;
|
||||||
webrtc::scoped_refptr<VideoCaptureModule> module(OpenVideoCaptureDevice(
|
webrtc::scoped_refptr<VideoCaptureModule> module(OpenVideoCaptureDevice(
|
||||||
0, &capture_observer));
|
0, &capture_observer));
|
||||||
@ -358,7 +358,7 @@ TEST_F(VideoCaptureTest, CreateDelete) {
|
|||||||
|
|
||||||
EXPECT_GT(capture_observer.capture_delay(), 0);
|
EXPECT_GT(capture_observer.capture_delay(), 0);
|
||||||
|
|
||||||
WebRtc_Word64 stop_time = TickTime::MillisecondTimestamp();
|
int64_t stop_time = TickTime::MillisecondTimestamp();
|
||||||
EXPECT_EQ(0, module->StopCapture());
|
EXPECT_EQ(0, module->StopCapture());
|
||||||
EXPECT_FALSE(module->CaptureStarted());
|
EXPECT_FALSE(module->CaptureStarted());
|
||||||
|
|
||||||
@ -581,7 +581,7 @@ TEST_F(VideoCaptureExternalTest, DISABLED_TestExternalCaptureI420) {
|
|||||||
|
|
||||||
// Test frame rate and no picture alarm.
|
// Test frame rate and no picture alarm.
|
||||||
TEST_F(VideoCaptureExternalTest , FrameRate) {
|
TEST_F(VideoCaptureExternalTest , FrameRate) {
|
||||||
WebRtc_Word64 testTime = 3;
|
int64_t testTime = 3;
|
||||||
TickTime startTime = TickTime::Now();
|
TickTime startTime = TickTime::Now();
|
||||||
|
|
||||||
while ((TickTime::Now() - startTime).Milliseconds() < testTime * 1000) {
|
while ((TickTime::Now() - startTime).Milliseconds() < testTime * 1000) {
|
||||||
|
@ -18,9 +18,9 @@ namespace videocapturemodule
|
|||||||
|
|
||||||
struct DelayValue
|
struct DelayValue
|
||||||
{
|
{
|
||||||
WebRtc_Word32 width;
|
int32_t width;
|
||||||
WebRtc_Word32 height;
|
int32_t height;
|
||||||
WebRtc_Word32 delay;
|
int32_t delay;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum { NoOfDelayValues = 40 };
|
enum { NoOfDelayValues = 40 };
|
||||||
|
@ -14,18 +14,18 @@
|
|||||||
namespace webrtc
|
namespace webrtc
|
||||||
{
|
{
|
||||||
|
|
||||||
VideoCaptureModule* VideoCaptureFactory::Create(const WebRtc_Word32 id,
|
VideoCaptureModule* VideoCaptureFactory::Create(const int32_t id,
|
||||||
const char* deviceUniqueIdUTF8) {
|
const char* deviceUniqueIdUTF8) {
|
||||||
return videocapturemodule::VideoCaptureImpl::Create(id, deviceUniqueIdUTF8);
|
return videocapturemodule::VideoCaptureImpl::Create(id, deviceUniqueIdUTF8);
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoCaptureModule* VideoCaptureFactory::Create(const WebRtc_Word32 id,
|
VideoCaptureModule* VideoCaptureFactory::Create(const int32_t id,
|
||||||
VideoCaptureExternal*& externalCapture) {
|
VideoCaptureExternal*& externalCapture) {
|
||||||
return videocapturemodule::VideoCaptureImpl::Create(id, externalCapture);
|
return videocapturemodule::VideoCaptureImpl::Create(id, externalCapture);
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoCaptureModule::DeviceInfo* VideoCaptureFactory::CreateDeviceInfo(
|
VideoCaptureModule::DeviceInfo* VideoCaptureFactory::CreateDeviceInfo(
|
||||||
const WebRtc_Word32 id) {
|
const int32_t id) {
|
||||||
return videocapturemodule::VideoCaptureImpl::CreateDeviceInfo(id);
|
return videocapturemodule::VideoCaptureImpl::CreateDeviceInfo(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace webrtc
|
|||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
VideoCaptureModule* VideoCaptureImpl::Create(
|
VideoCaptureModule* VideoCaptureImpl::Create(
|
||||||
const WebRtc_Word32 id,
|
const int32_t id,
|
||||||
VideoCaptureExternal*& externalCapture)
|
VideoCaptureExternal*& externalCapture)
|
||||||
{
|
{
|
||||||
RefCountImpl<VideoCaptureImpl>* implementation =
|
RefCountImpl<VideoCaptureImpl>* implementation =
|
||||||
@ -40,25 +40,25 @@ const char* VideoCaptureImpl::CurrentDeviceName() const
|
|||||||
return _deviceUniqueId;
|
return _deviceUniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::ChangeUniqueId(const WebRtc_Word32 id)
|
int32_t VideoCaptureImpl::ChangeUniqueId(const int32_t id)
|
||||||
{
|
{
|
||||||
_id = id;
|
_id = id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns the number of milliseconds until the module want a worker thread to call Process
|
// returns the number of milliseconds until the module want a worker thread to call Process
|
||||||
WebRtc_Word32 VideoCaptureImpl::TimeUntilNextProcess()
|
int32_t VideoCaptureImpl::TimeUntilNextProcess()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_callBackCs);
|
CriticalSectionScoped cs(&_callBackCs);
|
||||||
|
|
||||||
WebRtc_Word32 timeToNormalProcess = kProcessInterval
|
int32_t timeToNormalProcess = kProcessInterval
|
||||||
- (WebRtc_Word32)((TickTime::Now() - _lastProcessTime).Milliseconds());
|
- (int32_t)((TickTime::Now() - _lastProcessTime).Milliseconds());
|
||||||
|
|
||||||
return timeToNormalProcess;
|
return timeToNormalProcess;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process any pending tasks such as timeouts
|
// Process any pending tasks such as timeouts
|
||||||
WebRtc_Word32 VideoCaptureImpl::Process()
|
int32_t VideoCaptureImpl::Process()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_callBackCs);
|
CriticalSectionScoped cs(&_callBackCs);
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ WebRtc_Word32 VideoCaptureImpl::Process()
|
|||||||
{
|
{
|
||||||
if (_frameRateCallBack && _captureCallBack)
|
if (_frameRateCallBack && _captureCallBack)
|
||||||
{
|
{
|
||||||
const WebRtc_UWord32 frameRate = CalculateFrameRate(now);
|
const uint32_t frameRate = CalculateFrameRate(now);
|
||||||
_captureCallBack->OnCaptureFrameRate(_id, frameRate);
|
_captureCallBack->OnCaptureFrameRate(_id, frameRate);
|
||||||
}
|
}
|
||||||
_lastFrameRateCallbackTime = now; // Can be set by EnableFrameRateCallback
|
_lastFrameRateCallbackTime = now; // Can be set by EnableFrameRateCallback
|
||||||
@ -105,7 +105,7 @@ WebRtc_Word32 VideoCaptureImpl::Process()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoCaptureImpl::VideoCaptureImpl(const WebRtc_Word32 id)
|
VideoCaptureImpl::VideoCaptureImpl(const int32_t id)
|
||||||
: _id(id), _deviceUniqueId(NULL), _apiCs(*CriticalSectionWrapper::CreateCriticalSection()),
|
: _id(id), _deviceUniqueId(NULL), _apiCs(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
_captureDelay(0), _requestedCapability(),
|
_captureDelay(0), _requestedCapability(),
|
||||||
_callBackCs(*CriticalSectionWrapper::CreateCriticalSection()),
|
_callBackCs(*CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
@ -136,7 +136,7 @@ VideoCaptureImpl::~VideoCaptureImpl()
|
|||||||
delete[] _deviceUniqueId;
|
delete[] _deviceUniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::RegisterCaptureDataCallback(
|
int32_t VideoCaptureImpl::RegisterCaptureDataCallback(
|
||||||
VideoCaptureDataCallback& dataCallBack)
|
VideoCaptureDataCallback& dataCallBack)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
@ -146,14 +146,14 @@ WebRtc_Word32 VideoCaptureImpl::RegisterCaptureDataCallback(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::DeRegisterCaptureDataCallback()
|
int32_t VideoCaptureImpl::DeRegisterCaptureDataCallback()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
CriticalSectionScoped cs2(&_callBackCs);
|
CriticalSectionScoped cs2(&_callBackCs);
|
||||||
_dataCallBack = NULL;
|
_dataCallBack = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 VideoCaptureImpl::RegisterCaptureCallback(VideoCaptureFeedBack& callBack)
|
int32_t VideoCaptureImpl::RegisterCaptureCallback(VideoCaptureFeedBack& callBack)
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
@ -161,7 +161,7 @@ WebRtc_Word32 VideoCaptureImpl::RegisterCaptureCallback(VideoCaptureFeedBack& ca
|
|||||||
_captureCallBack = &callBack;
|
_captureCallBack = &callBack;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 VideoCaptureImpl::DeRegisterCaptureCallback()
|
int32_t VideoCaptureImpl::DeRegisterCaptureCallback()
|
||||||
{
|
{
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
@ -170,20 +170,20 @@ WebRtc_Word32 VideoCaptureImpl::DeRegisterCaptureCallback()
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
WebRtc_Word32 VideoCaptureImpl::SetCaptureDelay(WebRtc_Word32 delayMS)
|
int32_t VideoCaptureImpl::SetCaptureDelay(int32_t delayMS)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
_captureDelay = delayMS;
|
_captureDelay = delayMS;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_Word32 VideoCaptureImpl::CaptureDelay()
|
int32_t VideoCaptureImpl::CaptureDelay()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
return _setCaptureDelay;
|
return _setCaptureDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::DeliverCapturedFrame(I420VideoFrame&
|
int32_t VideoCaptureImpl::DeliverCapturedFrame(I420VideoFrame& captureFrame,
|
||||||
captureFrame, WebRtc_Word64 capture_time) {
|
int64_t capture_time) {
|
||||||
UpdateFrameCount(); // frame count used for local frame rate callback.
|
UpdateFrameCount(); // frame count used for local frame rate callback.
|
||||||
|
|
||||||
const bool callOnCaptureDelayChanged = _setCaptureDelay != _captureDelay;
|
const bool callOnCaptureDelayChanged = _setCaptureDelay != _captureDelay;
|
||||||
@ -219,8 +219,8 @@ WebRtc_Word32 VideoCaptureImpl::DeliverCapturedFrame(I420VideoFrame&
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::DeliverEncodedCapturedFrame(
|
int32_t VideoCaptureImpl::DeliverEncodedCapturedFrame(
|
||||||
VideoFrame& captureFrame, WebRtc_Word64 capture_time,
|
VideoFrame& captureFrame, int64_t capture_time,
|
||||||
VideoCodecType codecType) {
|
VideoCodecType codecType) {
|
||||||
UpdateFrameCount(); // frame count used for local frame rate callback.
|
UpdateFrameCount(); // frame count used for local frame rate callback.
|
||||||
|
|
||||||
@ -254,11 +254,11 @@ WebRtc_Word32 VideoCaptureImpl::DeliverEncodedCapturedFrame(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
int32_t VideoCaptureImpl::IncomingFrame(
|
||||||
WebRtc_UWord8* videoFrame,
|
uint8_t* videoFrame,
|
||||||
WebRtc_Word32 videoFrameLength,
|
int32_t videoFrameLength,
|
||||||
const VideoCaptureCapability& frameInfo,
|
const VideoCaptureCapability& frameInfo,
|
||||||
WebRtc_Word64 captureTime/*=0*/)
|
int64_t captureTime/*=0*/)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceVideoCapture, _id,
|
WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceVideoCapture, _id,
|
||||||
"IncomingFrame width %d, height %d", (int) frameInfo.width,
|
"IncomingFrame width %d, height %d", (int) frameInfo.width,
|
||||||
@ -268,8 +268,8 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
|||||||
|
|
||||||
CriticalSectionScoped cs(&_callBackCs);
|
CriticalSectionScoped cs(&_callBackCs);
|
||||||
|
|
||||||
const WebRtc_Word32 width = frameInfo.width;
|
const int32_t width = frameInfo.width;
|
||||||
const WebRtc_Word32 height = frameInfo.height;
|
const int32_t height = frameInfo.height;
|
||||||
|
|
||||||
TRACE_EVENT1("webrtc", "VC::IncomingFrame", "capture_time", captureTime);
|
TRACE_EVENT1("webrtc", "VC::IncomingFrame", "capture_time", captureTime);
|
||||||
|
|
||||||
@ -340,8 +340,8 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
|||||||
frameInfo.codecType);
|
frameInfo.codecType);
|
||||||
}
|
}
|
||||||
|
|
||||||
const WebRtc_UWord32 processTime =
|
const uint32_t processTime =
|
||||||
(WebRtc_UWord32)(TickTime::Now() - startProcessTime).Milliseconds();
|
(uint32_t)(TickTime::Now() - startProcessTime).Milliseconds();
|
||||||
if (processTime > 10) // If the process time is too long MJPG will not work well.
|
if (processTime > 10) // If the process time is too long MJPG will not work well.
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCapture, _id,
|
WEBRTC_TRACE(webrtc::kTraceWarning, webrtc::kTraceVideoCapture, _id,
|
||||||
@ -352,8 +352,8 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrame(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::IncomingFrameI420(
|
int32_t VideoCaptureImpl::IncomingFrameI420(
|
||||||
const VideoFrameI420& video_frame, WebRtc_Word64 captureTime) {
|
const VideoFrameI420& video_frame, int64_t captureTime) {
|
||||||
|
|
||||||
CriticalSectionScoped cs(&_callBackCs);
|
CriticalSectionScoped cs(&_callBackCs);
|
||||||
int size_y = video_frame.height * video_frame.y_pitch;
|
int size_y = video_frame.height * video_frame.y_pitch;
|
||||||
@ -377,8 +377,7 @@ WebRtc_Word32 VideoCaptureImpl::IncomingFrameI420(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::SetCaptureRotation(VideoCaptureRotation
|
int32_t VideoCaptureImpl::SetCaptureRotation(VideoCaptureRotation rotation) {
|
||||||
rotation) {
|
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
CriticalSectionScoped cs2(&_callBackCs);
|
CriticalSectionScoped cs2(&_callBackCs);
|
||||||
switch (rotation){
|
switch (rotation){
|
||||||
@ -398,7 +397,7 @@ WebRtc_Word32 VideoCaptureImpl::SetCaptureRotation(VideoCaptureRotation
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::EnableFrameRateCallback(const bool enable)
|
int32_t VideoCaptureImpl::EnableFrameRateCallback(const bool enable)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
CriticalSectionScoped cs2(&_callBackCs);
|
CriticalSectionScoped cs2(&_callBackCs);
|
||||||
@ -410,7 +409,7 @@ WebRtc_Word32 VideoCaptureImpl::EnableFrameRateCallback(const bool enable)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureImpl::EnableNoPictureAlarm(const bool enable)
|
int32_t VideoCaptureImpl::EnableNoPictureAlarm(const bool enable)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
CriticalSectionScoped cs2(&_callBackCs);
|
CriticalSectionScoped cs2(&_callBackCs);
|
||||||
@ -435,10 +434,10 @@ void VideoCaptureImpl::UpdateFrameCount()
|
|||||||
_incomingFrameTimes[0] = TickTime::Now();
|
_incomingFrameTimes[0] = TickTime::Now();
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 VideoCaptureImpl::CalculateFrameRate(const TickTime& now)
|
uint32_t VideoCaptureImpl::CalculateFrameRate(const TickTime& now)
|
||||||
{
|
{
|
||||||
WebRtc_Word32 num = 0;
|
int32_t num = 0;
|
||||||
WebRtc_Word32 nrOfFrames = 0;
|
int32_t nrOfFrames = 0;
|
||||||
for (num = 1; num < (kFrameRateCountHistorySize - 1); num++)
|
for (num = 1; num < (kFrameRateCountHistorySize - 1); num++)
|
||||||
{
|
{
|
||||||
if (_incomingFrameTimes[num].Ticks() <= 0
|
if (_incomingFrameTimes[num].Ticks() <= 0
|
||||||
@ -453,10 +452,10 @@ WebRtc_UWord32 VideoCaptureImpl::CalculateFrameRate(const TickTime& now)
|
|||||||
}
|
}
|
||||||
if (num > 1)
|
if (num > 1)
|
||||||
{
|
{
|
||||||
WebRtc_Word64 diff = (now - _incomingFrameTimes[num - 1]).Milliseconds();
|
int64_t diff = (now - _incomingFrameTimes[num - 1]).Milliseconds();
|
||||||
if (diff > 0)
|
if (diff > 0)
|
||||||
{
|
{
|
||||||
return WebRtc_UWord32((nrOfFrames * 1000.0f / diff) + 0.5f);
|
return uint32_t((nrOfFrames * 1000.0f / diff) + 0.5f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
* id - unique identifier of this video capture module object
|
* id - unique identifier of this video capture module object
|
||||||
* deviceUniqueIdUTF8 - name of the device. Available names can be found by using GetDeviceName
|
* deviceUniqueIdUTF8 - name of the device. Available names can be found by using GetDeviceName
|
||||||
*/
|
*/
|
||||||
static VideoCaptureModule* Create(const WebRtc_Word32 id,
|
static VideoCaptureModule* Create(const int32_t id,
|
||||||
const char* deviceUniqueIdUTF8);
|
const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -46,72 +46,72 @@ public:
|
|||||||
* id - unique identifier of this video capture module object
|
* id - unique identifier of this video capture module object
|
||||||
* externalCapture - [out] interface to call when a new frame is captured.
|
* externalCapture - [out] interface to call when a new frame is captured.
|
||||||
*/
|
*/
|
||||||
static VideoCaptureModule* Create(const WebRtc_Word32 id,
|
static VideoCaptureModule* Create(const int32_t id,
|
||||||
VideoCaptureExternal*& externalCapture);
|
VideoCaptureExternal*& externalCapture);
|
||||||
|
|
||||||
static DeviceInfo* CreateDeviceInfo(const WebRtc_Word32 id);
|
static DeviceInfo* CreateDeviceInfo(const int32_t id);
|
||||||
|
|
||||||
// Implements Module declared functions.
|
// Implements Module declared functions.
|
||||||
virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id);
|
virtual int32_t ChangeUniqueId(const int32_t id);
|
||||||
|
|
||||||
//Call backs
|
//Call backs
|
||||||
virtual WebRtc_Word32 RegisterCaptureDataCallback(VideoCaptureDataCallback& dataCallback);
|
virtual int32_t RegisterCaptureDataCallback(VideoCaptureDataCallback& dataCallback);
|
||||||
virtual WebRtc_Word32 DeRegisterCaptureDataCallback();
|
virtual int32_t DeRegisterCaptureDataCallback();
|
||||||
virtual WebRtc_Word32 RegisterCaptureCallback(VideoCaptureFeedBack& callBack);
|
virtual int32_t RegisterCaptureCallback(VideoCaptureFeedBack& callBack);
|
||||||
virtual WebRtc_Word32 DeRegisterCaptureCallback();
|
virtual int32_t DeRegisterCaptureCallback();
|
||||||
|
|
||||||
virtual WebRtc_Word32 SetCaptureDelay(WebRtc_Word32 delayMS);
|
virtual int32_t SetCaptureDelay(int32_t delayMS);
|
||||||
virtual WebRtc_Word32 CaptureDelay();
|
virtual int32_t CaptureDelay();
|
||||||
virtual WebRtc_Word32 SetCaptureRotation(VideoCaptureRotation rotation);
|
virtual int32_t SetCaptureRotation(VideoCaptureRotation rotation);
|
||||||
|
|
||||||
virtual WebRtc_Word32 EnableFrameRateCallback(const bool enable);
|
virtual int32_t EnableFrameRateCallback(const bool enable);
|
||||||
virtual WebRtc_Word32 EnableNoPictureAlarm(const bool enable);
|
virtual int32_t EnableNoPictureAlarm(const bool enable);
|
||||||
|
|
||||||
virtual const char* CurrentDeviceName() const;
|
virtual const char* CurrentDeviceName() const;
|
||||||
|
|
||||||
// Module handling
|
// Module handling
|
||||||
virtual WebRtc_Word32 TimeUntilNextProcess();
|
virtual int32_t TimeUntilNextProcess();
|
||||||
virtual WebRtc_Word32 Process();
|
virtual int32_t Process();
|
||||||
|
|
||||||
// Implement VideoCaptureExternal
|
// Implement VideoCaptureExternal
|
||||||
virtual WebRtc_Word32 IncomingFrame(WebRtc_UWord8* videoFrame,
|
virtual int32_t IncomingFrame(uint8_t* videoFrame,
|
||||||
WebRtc_Word32 videoFrameLength,
|
int32_t videoFrameLength,
|
||||||
const VideoCaptureCapability& frameInfo,
|
const VideoCaptureCapability& frameInfo,
|
||||||
WebRtc_Word64 captureTime = 0);
|
int64_t captureTime = 0);
|
||||||
virtual WebRtc_Word32 IncomingFrameI420(
|
virtual int32_t IncomingFrameI420(
|
||||||
const VideoFrameI420& video_frame,
|
const VideoFrameI420& video_frame,
|
||||||
WebRtc_Word64 captureTime = 0);
|
int64_t captureTime = 0);
|
||||||
|
|
||||||
// Platform dependent
|
// Platform dependent
|
||||||
virtual WebRtc_Word32 StartCapture(const VideoCaptureCapability& capability)
|
virtual int32_t StartCapture(const VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
_requestedCapability = capability;
|
_requestedCapability = capability;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
virtual WebRtc_Word32 StopCapture() { return -1; }
|
virtual int32_t StopCapture() { return -1; }
|
||||||
virtual bool CaptureStarted() {return false; }
|
virtual bool CaptureStarted() {return false; }
|
||||||
virtual WebRtc_Word32 CaptureSettings(VideoCaptureCapability& /*settings*/)
|
virtual int32_t CaptureSettings(VideoCaptureCapability& /*settings*/)
|
||||||
{ return -1; }
|
{ return -1; }
|
||||||
VideoCaptureEncodeInterface* GetEncodeInterface(const VideoCodec& /*codec*/)
|
VideoCaptureEncodeInterface* GetEncodeInterface(const VideoCodec& /*codec*/)
|
||||||
{ return NULL; }
|
{ return NULL; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
VideoCaptureImpl(const WebRtc_Word32 id);
|
VideoCaptureImpl(const int32_t id);
|
||||||
virtual ~VideoCaptureImpl();
|
virtual ~VideoCaptureImpl();
|
||||||
WebRtc_Word32 DeliverCapturedFrame(I420VideoFrame& captureFrame,
|
int32_t DeliverCapturedFrame(I420VideoFrame& captureFrame,
|
||||||
WebRtc_Word64 capture_time);
|
int64_t capture_time);
|
||||||
WebRtc_Word32 DeliverEncodedCapturedFrame(VideoFrame& captureFrame,
|
int32_t DeliverEncodedCapturedFrame(VideoFrame& captureFrame,
|
||||||
WebRtc_Word64 capture_time,
|
int64_t capture_time,
|
||||||
VideoCodecType codec_type);
|
VideoCodecType codec_type);
|
||||||
|
|
||||||
WebRtc_Word32 _id; // Module ID
|
int32_t _id; // Module ID
|
||||||
char* _deviceUniqueId; // current Device unique name;
|
char* _deviceUniqueId; // current Device unique name;
|
||||||
CriticalSectionWrapper& _apiCs;
|
CriticalSectionWrapper& _apiCs;
|
||||||
WebRtc_Word32 _captureDelay; // Current capture delay. May be changed of platform dependent parts.
|
int32_t _captureDelay; // Current capture delay. May be changed of platform dependent parts.
|
||||||
VideoCaptureCapability _requestedCapability; // Should be set by platform dependent code in StartCapture.
|
VideoCaptureCapability _requestedCapability; // Should be set by platform dependent code in StartCapture.
|
||||||
private:
|
private:
|
||||||
void UpdateFrameCount();
|
void UpdateFrameCount();
|
||||||
WebRtc_UWord32 CalculateFrameRate(const TickTime& now);
|
uint32_t CalculateFrameRate(const TickTime& now);
|
||||||
|
|
||||||
CriticalSectionWrapper& _callBackCs;
|
CriticalSectionWrapper& _callBackCs;
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ private:
|
|||||||
bool _noPictureAlarmCallBack; //true if EnableNoPictureAlarm
|
bool _noPictureAlarmCallBack; //true if EnableNoPictureAlarm
|
||||||
VideoCaptureAlarm _captureAlarm; // current value of the noPictureAlarm
|
VideoCaptureAlarm _captureAlarm; // current value of the noPictureAlarm
|
||||||
|
|
||||||
WebRtc_Word32 _setCaptureDelay; // The currently used capture delay
|
int32_t _setCaptureDelay; // The currently used capture delay
|
||||||
VideoCaptureDataCallback* _dataCallBack;
|
VideoCaptureDataCallback* _dataCallBack;
|
||||||
VideoCaptureFeedBack* _captureCallBack;
|
VideoCaptureFeedBack* _captureCallBack;
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ private:
|
|||||||
VideoFrame _capture_encoded_frame;
|
VideoFrame _capture_encoded_frame;
|
||||||
|
|
||||||
// Used to make sure incoming timestamp is increasing for every frame.
|
// Used to make sure incoming timestamp is increasing for every frame.
|
||||||
WebRtc_Word64 last_capture_time_;
|
int64_t last_capture_time_;
|
||||||
};
|
};
|
||||||
} // namespace videocapturemodule
|
} // namespace videocapturemodule
|
||||||
} //namespace webrtc
|
} //namespace webrtc
|
||||||
|
@ -23,7 +23,7 @@ namespace webrtc
|
|||||||
{
|
{
|
||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
const WebRtc_Word32 NoWindowsCaptureDelays = 1;
|
const int32_t NoWindowsCaptureDelays = 1;
|
||||||
const DelayValues WindowsCaptureDelays[NoWindowsCaptureDelays] = {
|
const DelayValues WindowsCaptureDelays[NoWindowsCaptureDelays] = {
|
||||||
"Microsoft LifeCam Cinema",
|
"Microsoft LifeCam Cinema",
|
||||||
"usb#vid_045e&pid_075d",
|
"usb#vid_045e&pid_075d",
|
||||||
@ -43,7 +43,7 @@ const DelayValues WindowsCaptureDelays[NoWindowsCaptureDelays] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// static
|
// static
|
||||||
DeviceInfoDS* DeviceInfoDS::Create(const WebRtc_Word32 id)
|
DeviceInfoDS* DeviceInfoDS::Create(const int32_t id)
|
||||||
{
|
{
|
||||||
DeviceInfoDS* dsInfo = new DeviceInfoDS(id);
|
DeviceInfoDS* dsInfo = new DeviceInfoDS(id);
|
||||||
if (!dsInfo || dsInfo->Init() != 0)
|
if (!dsInfo || dsInfo->Init() != 0)
|
||||||
@ -54,7 +54,7 @@ DeviceInfoDS* DeviceInfoDS::Create(const WebRtc_Word32 id)
|
|||||||
return dsInfo;
|
return dsInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceInfoDS::DeviceInfoDS(const WebRtc_Word32 id)
|
DeviceInfoDS::DeviceInfoDS(const int32_t id)
|
||||||
: DeviceInfoImpl(id), _dsDevEnum(NULL), _dsMonikerDevEnum(NULL),
|
: DeviceInfoImpl(id), _dsDevEnum(NULL), _dsMonikerDevEnum(NULL),
|
||||||
_CoUninitializeIsRequired(true)
|
_CoUninitializeIsRequired(true)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ DeviceInfoDS::~DeviceInfoDS()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoDS::Init()
|
int32_t DeviceInfoDS::Init()
|
||||||
{
|
{
|
||||||
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
|
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
|
||||||
IID_ICreateDevEnum, (void **) &_dsDevEnum);
|
IID_ICreateDevEnum, (void **) &_dsDevEnum);
|
||||||
@ -120,39 +120,39 @@ WebRtc_Word32 DeviceInfoDS::Init()
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
WebRtc_UWord32 DeviceInfoDS::NumberOfDevices()
|
uint32_t DeviceInfoDS::NumberOfDevices()
|
||||||
{
|
{
|
||||||
ReadLockScoped cs(_apiLock);
|
ReadLockScoped cs(_apiLock);
|
||||||
return GetDeviceInfo(0, 0, 0, 0, 0, 0, 0);
|
return GetDeviceInfo(0, 0, 0, 0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoDS::GetDeviceName(
|
int32_t DeviceInfoDS::GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
uint32_t productUniqueIdUTF8Length)
|
||||||
{
|
{
|
||||||
ReadLockScoped cs(_apiLock);
|
ReadLockScoped cs(_apiLock);
|
||||||
const WebRtc_Word32 result = GetDeviceInfo(deviceNumber, deviceNameUTF8,
|
const int32_t result = GetDeviceInfo(deviceNumber, deviceNameUTF8,
|
||||||
deviceNameLength,
|
deviceNameLength,
|
||||||
deviceUniqueIdUTF8,
|
deviceUniqueIdUTF8,
|
||||||
deviceUniqueIdUTF8Length,
|
deviceUniqueIdUTF8Length,
|
||||||
productUniqueIdUTF8,
|
productUniqueIdUTF8,
|
||||||
productUniqueIdUTF8Length);
|
productUniqueIdUTF8Length);
|
||||||
return result > (WebRtc_Word32) deviceNumber ? 0 : -1;
|
return result > (int32_t) deviceNumber ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoDS::GetDeviceInfo(
|
int32_t DeviceInfoDS::GetDeviceInfo(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
uint32_t productUniqueIdUTF8Length)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -275,11 +275,11 @@ WebRtc_Word32 DeviceInfoDS::GetDeviceInfo(
|
|||||||
IBaseFilter * DeviceInfoDS::GetDeviceFilter(
|
IBaseFilter * DeviceInfoDS::GetDeviceFilter(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
uint32_t productUniqueIdUTF8Length)
|
||||||
{
|
{
|
||||||
|
|
||||||
const WebRtc_Word32 deviceUniqueIdUTF8Length =
|
const int32_t deviceUniqueIdUTF8Length =
|
||||||
(WebRtc_Word32) strlen((char*) deviceUniqueIdUTF8); // UTF8 is also NULL terminated
|
(int32_t) strlen((char*) deviceUniqueIdUTF8); // UTF8 is also NULL terminated
|
||||||
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength)
|
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
||||||
@ -366,8 +366,8 @@ IBaseFilter * DeviceInfoDS::GetDeviceFilter(
|
|||||||
return captureFilter;
|
return captureFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoDS::GetWindowsCapability(
|
int32_t DeviceInfoDS::GetWindowsCapability(
|
||||||
const WebRtc_Word32 capabilityIndex,
|
const int32_t capabilityIndex,
|
||||||
VideoCaptureCapabilityWindows& windowsCapability)
|
VideoCaptureCapabilityWindows& windowsCapability)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -386,7 +386,7 @@ WebRtc_Word32 DeviceInfoDS::GetWindowsCapability(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
int32_t DeviceInfoDS::CreateCapabilityMap(
|
||||||
const char* deviceUniqueIdUTF8)
|
const char* deviceUniqueIdUTF8)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -400,8 +400,8 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
|||||||
_captureCapabilities.Erase(item);
|
_captureCapabilities.Erase(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
const WebRtc_Word32 deviceUniqueIdUTF8Length =
|
const int32_t deviceUniqueIdUTF8Length =
|
||||||
(WebRtc_Word32) strlen((char*) deviceUniqueIdUTF8);
|
(int32_t) strlen((char*) deviceUniqueIdUTF8);
|
||||||
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength)
|
if (deviceUniqueIdUTF8Length > kVideoCaptureUniqueNameLength)
|
||||||
{
|
{
|
||||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
||||||
@ -473,7 +473,7 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 index = 0; // Index in created _capabilities map
|
int32_t index = 0; // Index in created _capabilities map
|
||||||
// Check if the device support formattype == FORMAT_VideoInfo2 and FORMAT_VideoInfo.
|
// Check if the device support formattype == FORMAT_VideoInfo2 and FORMAT_VideoInfo.
|
||||||
// Prefer FORMAT_VideoInfo since some cameras (ZureCam) has been seen having problem with MJPEG and FORMAT_VideoInfo2
|
// Prefer FORMAT_VideoInfo since some cameras (ZureCam) has been seen having problem with MJPEG and FORMAT_VideoInfo2
|
||||||
// Interlace flag is only supported in FORMAT_VideoInfo2
|
// Interlace flag is only supported in FORMAT_VideoInfo2
|
||||||
@ -481,7 +481,7 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
|||||||
bool supportFORMAT_VideoInfo = false;
|
bool supportFORMAT_VideoInfo = false;
|
||||||
bool foundInterlacedFormat = false;
|
bool foundInterlacedFormat = false;
|
||||||
GUID preferedVideoFormat = FORMAT_VideoInfo;
|
GUID preferedVideoFormat = FORMAT_VideoInfo;
|
||||||
for (WebRtc_Word32 tmp = 0; tmp < count; ++tmp)
|
for (int32_t tmp = 0; tmp < count; ++tmp)
|
||||||
{
|
{
|
||||||
hr = streamConfig->GetStreamCaps(tmp, &pmt,
|
hr = streamConfig->GetStreamCaps(tmp, &pmt,
|
||||||
reinterpret_cast<BYTE*> (&caps));
|
reinterpret_cast<BYTE*> (&caps));
|
||||||
@ -521,7 +521,7 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (WebRtc_Word32 tmp = 0; tmp < count; ++tmp)
|
for (int32_t tmp = 0; tmp < count; ++tmp)
|
||||||
{
|
{
|
||||||
hr = streamConfig->GetStreamCaps(tmp, &pmt,
|
hr = streamConfig->GetStreamCaps(tmp, &pmt,
|
||||||
reinterpret_cast<BYTE*> (&caps));
|
reinterpret_cast<BYTE*> (&caps));
|
||||||
@ -542,7 +542,7 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
|||||||
|
|
||||||
VideoCaptureCapabilityWindows* capability =
|
VideoCaptureCapabilityWindows* capability =
|
||||||
new VideoCaptureCapabilityWindows();
|
new VideoCaptureCapabilityWindows();
|
||||||
WebRtc_Word64 avgTimePerFrame = 0;
|
int64_t avgTimePerFrame = 0;
|
||||||
|
|
||||||
if (pmt->formattype == FORMAT_VideoInfo)
|
if (pmt->formattype == FORMAT_VideoInfo)
|
||||||
{
|
{
|
||||||
@ -712,7 +712,7 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
|||||||
*/
|
*/
|
||||||
void DeviceInfoDS::GetProductId(const char* devicePath,
|
void DeviceInfoDS::GetProductId(const char* devicePath,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
uint32_t productUniqueIdUTF8Length)
|
||||||
{
|
{
|
||||||
*productUniqueIdUTF8 = '\0';
|
*productUniqueIdUTF8 = '\0';
|
||||||
char* startPos = strstr((char*) devicePath, "\\\\?\\");
|
char* startPos = strstr((char*) devicePath, "\\\\?\\");
|
||||||
@ -735,7 +735,7 @@ void DeviceInfoDS::GetProductId(const char* devicePath,
|
|||||||
}
|
}
|
||||||
// Find the second occurrence.
|
// Find the second occurrence.
|
||||||
pos = strchr(pos + 1, '&');
|
pos = strchr(pos + 1, '&');
|
||||||
WebRtc_UWord32 bytesToCopy = (WebRtc_UWord32)(pos - startPos);
|
uint32_t bytesToCopy = (uint32_t)(pos - startPos);
|
||||||
if (pos && (bytesToCopy <= productUniqueIdUTF8Length) && bytesToCopy
|
if (pos && (bytesToCopy <= productUniqueIdUTF8Length) && bytesToCopy
|
||||||
<= kVideoCaptureProductIdLength)
|
<= kVideoCaptureProductIdLength)
|
||||||
{
|
{
|
||||||
@ -750,12 +750,12 @@ void DeviceInfoDS::GetProductId(const char* devicePath,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoDS::DisplayCaptureSettingsDialogBox(
|
int32_t DeviceInfoDS::DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8,
|
const char* dialogTitleUTF8,
|
||||||
void* parentWindow,
|
void* parentWindow,
|
||||||
WebRtc_UWord32 positionX,
|
uint32_t positionX,
|
||||||
WebRtc_UWord32 positionY)
|
uint32_t positionY)
|
||||||
{
|
{
|
||||||
ReadLockScoped cs(_apiLock);
|
ReadLockScoped cs(_apiLock);
|
||||||
HWND window = (HWND) parentWindow;
|
HWND window = (HWND) parentWindow;
|
||||||
|
@ -24,7 +24,7 @@ namespace videocapturemodule
|
|||||||
{
|
{
|
||||||
struct VideoCaptureCapabilityWindows: public VideoCaptureCapability
|
struct VideoCaptureCapabilityWindows: public VideoCaptureCapability
|
||||||
{
|
{
|
||||||
WebRtc_UWord32 directShowCapabilityIndex;
|
uint32_t directShowCapabilityIndex;
|
||||||
bool supportFrameRateControl;
|
bool supportFrameRateControl;
|
||||||
VideoCaptureCapabilityWindows()
|
VideoCaptureCapabilityWindows()
|
||||||
{
|
{
|
||||||
@ -37,36 +37,36 @@ class DeviceInfoDS: public DeviceInfoImpl
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// Factory function.
|
// Factory function.
|
||||||
static DeviceInfoDS* Create(const WebRtc_Word32 id);
|
static DeviceInfoDS* Create(const int32_t id);
|
||||||
|
|
||||||
DeviceInfoDS(const WebRtc_Word32 id);
|
DeviceInfoDS(const int32_t id);
|
||||||
virtual ~DeviceInfoDS();
|
virtual ~DeviceInfoDS();
|
||||||
|
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
virtual WebRtc_UWord32 NumberOfDevices();
|
virtual uint32_t NumberOfDevices();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the available capture devices.
|
* Returns the available capture devices.
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
GetDeviceName(WebRtc_UWord32 deviceNumber,
|
GetDeviceName(uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length);
|
uint32_t productUniqueIdUTF8Length);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Display OS /capture device specific settings dialog
|
* Display OS /capture device specific settings dialog
|
||||||
*/
|
*/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
DisplayCaptureSettingsDialogBox(
|
DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8,
|
const char* dialogTitleUTF8,
|
||||||
void* parentWindow,
|
void* parentWindow,
|
||||||
WebRtc_UWord32 positionX,
|
uint32_t positionX,
|
||||||
WebRtc_UWord32 positionY);
|
uint32_t positionY);
|
||||||
|
|
||||||
// Windows specific
|
// Windows specific
|
||||||
|
|
||||||
@ -75,26 +75,26 @@ public:
|
|||||||
*/
|
*/
|
||||||
IBaseFilter * GetDeviceFilter(const char* deviceUniqueIdUTF8,
|
IBaseFilter * GetDeviceFilter(const char* deviceUniqueIdUTF8,
|
||||||
char* productUniqueIdUTF8 = NULL,
|
char* productUniqueIdUTF8 = NULL,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length = 0);
|
uint32_t productUniqueIdUTF8Length = 0);
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
GetWindowsCapability(const WebRtc_Word32 capabilityIndex,
|
GetWindowsCapability(const int32_t capabilityIndex,
|
||||||
VideoCaptureCapabilityWindows& windowsCapability);
|
VideoCaptureCapabilityWindows& windowsCapability);
|
||||||
|
|
||||||
static void GetProductId(const char* devicePath,
|
static void GetProductId(const char* devicePath,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length);
|
uint32_t productUniqueIdUTF8Length);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WebRtc_Word32 GetDeviceInfo(WebRtc_UWord32 deviceNumber,
|
int32_t GetDeviceInfo(uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length);
|
uint32_t productUniqueIdUTF8Length);
|
||||||
|
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
CreateCapabilityMap(const char* deviceUniqueIdUTF8);
|
CreateCapabilityMap(const char* deviceUniqueIdUTF8);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -13,37 +13,37 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace videocapturemodule {
|
namespace videocapturemodule {
|
||||||
|
|
||||||
DeviceInfoMF::DeviceInfoMF(const WebRtc_Word32 id) : DeviceInfoImpl(id) {
|
DeviceInfoMF::DeviceInfoMF(const int32_t id) : DeviceInfoImpl(id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceInfoMF::~DeviceInfoMF() {
|
DeviceInfoMF::~DeviceInfoMF() {
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoMF::Init() {
|
int32_t DeviceInfoMF::Init() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_UWord32 DeviceInfoMF::NumberOfDevices() {
|
uint32_t DeviceInfoMF::NumberOfDevices() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoMF::GetDeviceName(
|
int32_t DeviceInfoMF::GetDeviceName(
|
||||||
WebRtc_UWord32 deviceNumber,
|
uint32_t deviceNumber,
|
||||||
char* deviceNameUTF8,
|
char* deviceNameUTF8,
|
||||||
WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8,
|
char* deviceUniqueIdUTF8,
|
||||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
char* productUniqueIdUTF8,
|
char* productUniqueIdUTF8,
|
||||||
WebRtc_UWord32 productUniqueIdUTF8Length) {
|
uint32_t productUniqueIdUTF8Length) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 DeviceInfoMF::DisplayCaptureSettingsDialogBox(
|
int32_t DeviceInfoMF::DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8,
|
const char* deviceUniqueIdUTF8,
|
||||||
const char* dialogTitleUTF8,
|
const char* dialogTitleUTF8,
|
||||||
void* parentWindow,
|
void* parentWindow,
|
||||||
WebRtc_UWord32 positionX,
|
uint32_t positionX,
|
||||||
WebRtc_UWord32 positionY) {
|
uint32_t positionY) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,20 +19,22 @@ namespace videocapturemodule {
|
|||||||
// Provides video capture device information using the Media Foundation API.
|
// Provides video capture device information using the Media Foundation API.
|
||||||
class DeviceInfoMF : public DeviceInfoImpl {
|
class DeviceInfoMF : public DeviceInfoImpl {
|
||||||
public:
|
public:
|
||||||
explicit DeviceInfoMF(const WebRtc_Word32 id);
|
explicit DeviceInfoMF(const int32_t id);
|
||||||
virtual ~DeviceInfoMF();
|
virtual ~DeviceInfoMF();
|
||||||
|
|
||||||
WebRtc_Word32 Init();
|
int32_t Init();
|
||||||
virtual WebRtc_UWord32 NumberOfDevices();
|
virtual uint32_t NumberOfDevices();
|
||||||
|
|
||||||
virtual WebRtc_Word32 GetDeviceName(WebRtc_UWord32 deviceNumber,
|
virtual int32_t GetDeviceName(uint32_t deviceNumber, char* deviceNameUTF8,
|
||||||
char* deviceNameUTF8, WebRtc_UWord32 deviceNameLength,
|
uint32_t deviceNameLength,
|
||||||
char* deviceUniqueIdUTF8, WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
char* deviceUniqueIdUTF8,
|
||||||
char* productUniqueIdUTF8, WebRtc_UWord32 productUniqueIdUTF8Length);
|
uint32_t deviceUniqueIdUTF8Length,
|
||||||
|
char* productUniqueIdUTF8,
|
||||||
|
uint32_t productUniqueIdUTF8Length);
|
||||||
|
|
||||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
virtual int32_t DisplayCaptureSettingsDialogBox(
|
||||||
const char* deviceUniqueIdUTF8, const char* dialogTitleUTF8,
|
const char* deviceUniqueIdUTF8, const char* dialogTitleUTF8,
|
||||||
void* parentWindow, WebRtc_UWord32 positionX, WebRtc_UWord32 positionY);
|
void* parentWindow, uint32_t positionX, uint32_t positionY);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace videocapturemodule
|
} // namespace videocapturemodule
|
||||||
|
@ -34,7 +34,7 @@ typedef struct tagTHREADNAME_INFO
|
|||||||
DWORD dwFlags; // reserved for future use, must be zero
|
DWORD dwFlags; // reserved for future use, must be zero
|
||||||
} THREADNAME_INFO;
|
} THREADNAME_INFO;
|
||||||
|
|
||||||
CaptureInputPin::CaptureInputPin (WebRtc_Word32 moduleId,
|
CaptureInputPin::CaptureInputPin (int32_t moduleId,
|
||||||
IN TCHAR * szName,
|
IN TCHAR * szName,
|
||||||
IN CaptureSinkFilter* pFilter,
|
IN CaptureSinkFilter* pFilter,
|
||||||
IN CCritSec * pLock,
|
IN CCritSec * pLock,
|
||||||
@ -86,7 +86,7 @@ CaptureInputPin::GetMediaType (IN int iPosition, OUT CMediaType * pmt)
|
|||||||
pmt->SetFormatType(&FORMAT_VideoInfo);
|
pmt->SetFormatType(&FORMAT_VideoInfo);
|
||||||
pmt->SetTemporalCompression(FALSE);
|
pmt->SetTemporalCompression(FALSE);
|
||||||
|
|
||||||
WebRtc_Word32 positionOffset=1;
|
int32_t positionOffset=1;
|
||||||
if(_requestedCapability.codecType!=kVideoCodecUnknown)
|
if(_requestedCapability.codecType!=kVideoCodecUnknown)
|
||||||
{
|
{
|
||||||
positionOffset=0;
|
positionOffset=0;
|
||||||
@ -353,7 +353,7 @@ CaptureInputPin::Receive ( IN IMediaSample * pIMediaSample )
|
|||||||
|
|
||||||
if (SUCCEEDED (hr))
|
if (SUCCEEDED (hr))
|
||||||
{
|
{
|
||||||
const WebRtc_Word32 length = pIMediaSample->GetActualDataLength();
|
const int32_t length = pIMediaSample->GetActualDataLength();
|
||||||
|
|
||||||
unsigned char* pBuffer = NULL;
|
unsigned char* pBuffer = NULL;
|
||||||
if(S_OK != pIMediaSample->GetPointer(&pBuffer))
|
if(S_OK != pIMediaSample->GetPointer(&pBuffer))
|
||||||
@ -388,7 +388,7 @@ CaptureSinkFilter::CaptureSinkFilter (IN TCHAR * tszName,
|
|||||||
IN LPUNKNOWN punk,
|
IN LPUNKNOWN punk,
|
||||||
OUT HRESULT * phr,
|
OUT HRESULT * phr,
|
||||||
VideoCaptureExternal& captureObserver,
|
VideoCaptureExternal& captureObserver,
|
||||||
WebRtc_Word32 moduleId)
|
int32_t moduleId)
|
||||||
: CBaseFilter(tszName,punk,& m_crtFilter,CLSID_SINKFILTER),
|
: CBaseFilter(tszName,punk,& m_crtFilter,CLSID_SINKFILTER),
|
||||||
m_pInput(NULL),
|
m_pInput(NULL),
|
||||||
_captureObserver(captureObserver),
|
_captureObserver(captureObserver),
|
||||||
@ -484,7 +484,7 @@ void CaptureSinkFilter::SetFilterGraph(IGraphBuilder* graph)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CaptureSinkFilter::ProcessCapturedFrame(unsigned char* pBuffer,
|
void CaptureSinkFilter::ProcessCapturedFrame(unsigned char* pBuffer,
|
||||||
WebRtc_Word32 length,
|
int32_t length,
|
||||||
const VideoCaptureCapability& frameInfo)
|
const VideoCaptureCapability& frameInfo)
|
||||||
{
|
{
|
||||||
// we have the receiver lock
|
// we have the receiver lock
|
||||||
|
@ -29,18 +29,18 @@ class CaptureSinkFilter;
|
|||||||
class CaptureInputPin: public CBaseInputPin
|
class CaptureInputPin: public CBaseInputPin
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WebRtc_Word32 _moduleId;
|
int32_t _moduleId;
|
||||||
|
|
||||||
VideoCaptureCapability _requestedCapability;
|
VideoCaptureCapability _requestedCapability;
|
||||||
VideoCaptureCapability _resultingCapability;
|
VideoCaptureCapability _resultingCapability;
|
||||||
HANDLE _threadHandle;
|
HANDLE _threadHandle;
|
||||||
|
|
||||||
CaptureInputPin ( WebRtc_Word32 moduleId,
|
CaptureInputPin(int32_t moduleId,
|
||||||
IN TCHAR* szName,
|
IN TCHAR* szName,
|
||||||
IN CaptureSinkFilter* pFilter,
|
IN CaptureSinkFilter* pFilter,
|
||||||
IN CCritSec * pLock,
|
IN CCritSec * pLock,
|
||||||
OUT HRESULT * pHr,
|
OUT HRESULT * pHr,
|
||||||
IN LPCWSTR pszName);
|
IN LPCWSTR pszName);
|
||||||
virtual ~CaptureInputPin();
|
virtual ~CaptureInputPin();
|
||||||
|
|
||||||
HRESULT GetMediaType (IN int iPos, OUT CMediaType * pmt);
|
HRESULT GetMediaType (IN int iPos, OUT CMediaType * pmt);
|
||||||
@ -53,17 +53,17 @@ class CaptureSinkFilter: public CBaseFilter
|
|||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CaptureSinkFilter (IN TCHAR * tszName,
|
CaptureSinkFilter(IN TCHAR * tszName,
|
||||||
IN LPUNKNOWN punk,
|
IN LPUNKNOWN punk,
|
||||||
OUT HRESULT * phr,
|
OUT HRESULT * phr,
|
||||||
VideoCaptureExternal& captureObserver,
|
VideoCaptureExternal& captureObserver,
|
||||||
WebRtc_Word32 moduleId);
|
int32_t moduleId);
|
||||||
virtual ~CaptureSinkFilter();
|
virtual ~CaptureSinkFilter();
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
// class methods
|
// class methods
|
||||||
|
|
||||||
void ProcessCapturedFrame(unsigned char* pBuffer, WebRtc_Word32 length,
|
void ProcessCapturedFrame(unsigned char* pBuffer, int32_t length,
|
||||||
const VideoCaptureCapability& frameInfo);
|
const VideoCaptureCapability& frameInfo);
|
||||||
// explicit receiver lock aquisition and release
|
// explicit receiver lock aquisition and release
|
||||||
void LockReceive() { m_crtRecv.Lock();}
|
void LockReceive() { m_crtRecv.Lock();}
|
||||||
@ -93,7 +93,7 @@ private:
|
|||||||
CCritSec m_crtRecv; // receiver lock; always acquire before filter lock
|
CCritSec m_crtRecv; // receiver lock; always acquire before filter lock
|
||||||
CaptureInputPin * m_pInput;
|
CaptureInputPin * m_pInput;
|
||||||
VideoCaptureExternal& _captureObserver;
|
VideoCaptureExternal& _captureObserver;
|
||||||
WebRtc_Word32 _moduleId;
|
int32_t _moduleId;
|
||||||
};
|
};
|
||||||
} // namespace videocapturemodule
|
} // namespace videocapturemodule
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -22,7 +22,7 @@ namespace webrtc
|
|||||||
{
|
{
|
||||||
namespace videocapturemodule
|
namespace videocapturemodule
|
||||||
{
|
{
|
||||||
VideoCaptureDS::VideoCaptureDS(const WebRtc_Word32 id)
|
VideoCaptureDS::VideoCaptureDS(const int32_t id)
|
||||||
: VideoCaptureImpl(id), _dsInfo(id), _captureFilter(NULL),
|
: VideoCaptureImpl(id), _dsInfo(id), _captureFilter(NULL),
|
||||||
_graphBuilder(NULL), _mediaControl(NULL), _sinkFilter(NULL),
|
_graphBuilder(NULL), _mediaControl(NULL), _sinkFilter(NULL),
|
||||||
_inputSendPin(NULL), _outputCapturePin(NULL), _dvFilter(NULL),
|
_inputSendPin(NULL), _outputCapturePin(NULL), _dvFilter(NULL),
|
||||||
@ -59,11 +59,10 @@ VideoCaptureDS::~VideoCaptureDS()
|
|||||||
RELEASE_AND_CLEAR(_graphBuilder);
|
RELEASE_AND_CLEAR(_graphBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureDS::Init(const WebRtc_Word32 id,
|
int32_t VideoCaptureDS::Init(const int32_t id, const char* deviceUniqueIdUTF8)
|
||||||
const char* deviceUniqueIdUTF8)
|
|
||||||
{
|
{
|
||||||
const WebRtc_Word32 nameLength =
|
const int32_t nameLength =
|
||||||
(WebRtc_Word32) strlen((char*) deviceUniqueIdUTF8);
|
(int32_t) strlen((char*) deviceUniqueIdUTF8);
|
||||||
if (nameLength > kVideoCaptureUniqueNameLength)
|
if (nameLength > kVideoCaptureUniqueNameLength)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -150,7 +149,7 @@ WebRtc_Word32 VideoCaptureDS::Init(const WebRtc_Word32 id,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureDS::StartCapture(
|
int32_t VideoCaptureDS::StartCapture(
|
||||||
const VideoCaptureCapability& capability)
|
const VideoCaptureCapability& capability)
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
@ -174,7 +173,7 @@ WebRtc_Word32 VideoCaptureDS::StartCapture(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureDS::StopCapture()
|
int32_t VideoCaptureDS::StopCapture()
|
||||||
{
|
{
|
||||||
CriticalSectionScoped cs(&_apiCs);
|
CriticalSectionScoped cs(&_apiCs);
|
||||||
|
|
||||||
@ -201,20 +200,20 @@ bool VideoCaptureDS::CaptureStarted()
|
|||||||
return state == State_Running;
|
return state == State_Running;
|
||||||
|
|
||||||
}
|
}
|
||||||
WebRtc_Word32 VideoCaptureDS::CaptureSettings(
|
int32_t VideoCaptureDS::CaptureSettings(
|
||||||
VideoCaptureCapability& settings)
|
VideoCaptureCapability& settings)
|
||||||
{
|
{
|
||||||
settings = _requestedCapability;
|
settings = _requestedCapability;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureDS::SetCameraOutput(
|
int32_t VideoCaptureDS::SetCameraOutput(
|
||||||
const VideoCaptureCapability& requestedCapability)
|
const VideoCaptureCapability& requestedCapability)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Get the best matching capability
|
// Get the best matching capability
|
||||||
VideoCaptureCapability capability;
|
VideoCaptureCapability capability;
|
||||||
WebRtc_Word32 capabilityIndex;
|
int32_t capabilityIndex;
|
||||||
|
|
||||||
// Store the new requested size
|
// Store the new requested size
|
||||||
_requestedCapability = requestedCapability;
|
_requestedCapability = requestedCapability;
|
||||||
@ -326,7 +325,7 @@ WebRtc_Word32 VideoCaptureDS::SetCameraOutput(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureDS::DisconnectGraph()
|
int32_t VideoCaptureDS::DisconnectGraph()
|
||||||
{
|
{
|
||||||
HRESULT hr = _mediaControl->Stop();
|
HRESULT hr = _mediaControl->Stop();
|
||||||
hr += _graphBuilder->Disconnect(_outputCapturePin);
|
hr += _graphBuilder->Disconnect(_outputCapturePin);
|
||||||
|
@ -29,19 +29,18 @@ class CaptureSinkFilter;
|
|||||||
class VideoCaptureDS: public VideoCaptureImpl
|
class VideoCaptureDS: public VideoCaptureImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VideoCaptureDS(const WebRtc_Word32 id);
|
VideoCaptureDS(const int32_t id);
|
||||||
|
|
||||||
virtual WebRtc_Word32 Init(const WebRtc_Word32 id,
|
virtual int32_t Init(const int32_t id, const char* deviceUniqueIdUTF8);
|
||||||
const char* deviceUniqueIdUTF8);
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
*
|
*
|
||||||
* Start/Stop
|
* Start/Stop
|
||||||
*
|
*
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
virtual WebRtc_Word32
|
virtual int32_t
|
||||||
StartCapture(const VideoCaptureCapability& capability);
|
StartCapture(const VideoCaptureCapability& capability);
|
||||||
virtual WebRtc_Word32 StopCapture();
|
virtual int32_t StopCapture();
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -50,16 +49,16 @@ public:
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
virtual bool CaptureStarted();
|
virtual bool CaptureStarted();
|
||||||
virtual WebRtc_Word32 CaptureSettings(VideoCaptureCapability& settings);
|
virtual int32_t CaptureSettings(VideoCaptureCapability& settings);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~VideoCaptureDS();
|
virtual ~VideoCaptureDS();
|
||||||
|
|
||||||
// Help functions
|
// Help functions
|
||||||
|
|
||||||
WebRtc_Word32
|
int32_t
|
||||||
SetCameraOutput(const VideoCaptureCapability& requestedCapability);
|
SetCameraOutput(const VideoCaptureCapability& requestedCapability);
|
||||||
WebRtc_Word32 DisconnectGraph();
|
int32_t DisconnectGraph();
|
||||||
HRESULT VideoCaptureDS::ConnectDVCamera();
|
HRESULT VideoCaptureDS::ConnectDVCamera();
|
||||||
|
|
||||||
DeviceInfoDS _dsInfo;
|
DeviceInfoDS _dsInfo;
|
||||||
|
@ -17,12 +17,12 @@ namespace videocapturemodule {
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
||||||
const WebRtc_Word32 id) {
|
const int32_t id) {
|
||||||
// TODO(tommi): Use the Media Foundation version on Vista and up.
|
// TODO(tommi): Use the Media Foundation version on Vista and up.
|
||||||
return DeviceInfoDS::Create(id);
|
return DeviceInfoDS::Create(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoCaptureModule* VideoCaptureImpl::Create(const WebRtc_Word32 id,
|
VideoCaptureModule* VideoCaptureImpl::Create(const int32_t id,
|
||||||
const char* device_id) {
|
const char* device_id) {
|
||||||
if (device_id == NULL)
|
if (device_id == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -13,20 +13,19 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace videocapturemodule {
|
namespace videocapturemodule {
|
||||||
|
|
||||||
VideoCaptureMF::VideoCaptureMF(const WebRtc_Word32 id) : VideoCaptureImpl(id) {}
|
VideoCaptureMF::VideoCaptureMF(const int32_t id) : VideoCaptureImpl(id) {}
|
||||||
VideoCaptureMF::~VideoCaptureMF() {}
|
VideoCaptureMF::~VideoCaptureMF() {}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMF::Init(const WebRtc_Word32 id,
|
int32_t VideoCaptureMF::Init(const int32_t id, const char* device_id) {
|
||||||
const char* device_id) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMF::StartCapture(
|
int32_t VideoCaptureMF::StartCapture(
|
||||||
const VideoCaptureCapability& capability) {
|
const VideoCaptureCapability& capability) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMF::StopCapture() {
|
int32_t VideoCaptureMF::StopCapture() {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ bool VideoCaptureMF::CaptureStarted() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRtc_Word32 VideoCaptureMF::CaptureSettings(
|
int32_t VideoCaptureMF::CaptureSettings(
|
||||||
VideoCaptureCapability& settings) {
|
VideoCaptureCapability& settings) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -22,15 +22,15 @@ namespace videocapturemodule {
|
|||||||
// for supported platforms.
|
// for supported platforms.
|
||||||
class VideoCaptureMF : public VideoCaptureImpl {
|
class VideoCaptureMF : public VideoCaptureImpl {
|
||||||
public:
|
public:
|
||||||
explicit VideoCaptureMF(const WebRtc_Word32 id);
|
explicit VideoCaptureMF(const int32_t id);
|
||||||
|
|
||||||
WebRtc_Word32 Init(const WebRtc_Word32 id, const char* device_id);
|
int32_t Init(const int32_t id, const char* device_id);
|
||||||
|
|
||||||
// Overrides from VideoCaptureImpl.
|
// Overrides from VideoCaptureImpl.
|
||||||
virtual WebRtc_Word32 StartCapture(const VideoCaptureCapability& capability);
|
virtual int32_t StartCapture(const VideoCaptureCapability& capability);
|
||||||
virtual WebRtc_Word32 StopCapture();
|
virtual int32_t StopCapture();
|
||||||
virtual bool CaptureStarted();
|
virtual bool CaptureStarted();
|
||||||
virtual WebRtc_Word32 CaptureSettings(
|
virtual int32_t CaptureSettings(
|
||||||
VideoCaptureCapability& settings); // NOLINT
|
VideoCaptureCapability& settings); // NOLINT
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user