Change WebRtc_Word8 to char

Review URL: https://webrtc-codereview.appspot.com/405005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1775 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
leozwang@webrtc.org 2012-02-27 19:12:19 +00:00
parent cf1b6aec30
commit adb89f56e0
10 changed files with 73 additions and 72 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -46,7 +46,7 @@ public:
static void Destroy(VideoCaptureModule* module);
WebRtc_Word32 Init(const WebRtc_Word32 id,
const WebRtc_UWord8* deviceUniqueIdUTF8);
const char* deviceUniqueIdUTF8);
// Start/Stop
@ -72,9 +72,9 @@ private:
WebRtc_Word32 _captureWidth;
WebRtc_Word32 _captureHeight;
WebRtc_Word32 _captureFrameRate;
WebRtc_UWord8 _currentDeviceNameUTF8[MAX_NAME_LENGTH];
WebRtc_UWord8 _currentDeviceUniqueIdUTF8[MAX_NAME_LENGTH];
WebRtc_UWord8 _currentDeviceProductUniqueIDUTF8[MAX_NAME_LENGTH];
char _currentDeviceNameUTF8[MAX_NAME_LENGTH];
char _currentDeviceUniqueIdUTF8[MAX_NAME_LENGTH];
char _currentDeviceProductUniqueIDUTF8[MAX_NAME_LENGTH];
WebRtc_Word32 _frameCount;
};
} // namespace videocapturemodule

View File

@ -56,7 +56,7 @@ VideoCaptureMacQTKit::~VideoCaptureMacQTKit()
}
WebRtc_Word32 VideoCaptureMacQTKit::Init(
const WebRtc_Word32 id, const WebRtc_UWord8* iDeviceUniqueIdUTF8)
const WebRtc_Word32 id, const char* iDeviceUniqueIdUTF8)
{
CriticalSectionScoped cs(_apiCs);
@ -67,7 +67,7 @@ WebRtc_Word32 VideoCaptureMacQTKit::Init(
return -1;
// Store the device name
_deviceUniqueId = new WebRtc_UWord8[nameLength+1];
_deviceUniqueId = new char[nameLength+1];
memcpy(_deviceUniqueId, iDeviceUniqueIdUTF8,nameLength+1);
_captureDevice = [[VideoCaptureMacQTKitObjC alloc] init];
@ -108,9 +108,9 @@ WebRtc_Word32 VideoCaptureMacQTKit::Init(
}
const int NAME_LENGTH = 1024;
WebRtc_UWord8 deviceNameUTF8[1024] = "";
WebRtc_UWord8 deviceUniqueIdUTF8[1024] = "";
WebRtc_UWord8 deviceProductUniqueIDUTF8[1024] = "";
char deviceNameUTF8[1024] = "";
char deviceUniqueIdUTF8[1024] = "";
char deviceProductUniqueIDUTF8[1024] = "";
bool captureDeviceFound = false;
for(int index = 0; index < captureDeviceCount; index++){

View File

@ -46,23 +46,23 @@ public:
* otherwise.
*/
virtual WebRtc_Word32 GetDeviceName(
WebRtc_UWord32 deviceNumber, WebRtc_UWord8* deviceNameUTF8,
WebRtc_UWord32 deviceNameLength, WebRtc_UWord8* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
WebRtc_UWord32 deviceNameLength, char* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length,
WebRtc_UWord8* productUniqueIdUTF8 = 0,
char* productUniqueIdUTF8 = 0,
WebRtc_UWord32 productUniqueIdUTF8Length = 0);
/*
* Returns the number of capabilities for this device
*/
virtual WebRtc_Word32 NumberOfCapabilities(
const WebRtc_UWord8* deviceUniqueIdUTF8);
const char* deviceUniqueIdUTF8);
/*
* Gets the capabilities of the named device
*/
virtual WebRtc_Word32 GetCapability(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const char* deviceUniqueIdUTF8,
const WebRtc_UWord32 deviceCapabilityNumber,
VideoCaptureCapability& capability);
@ -71,7 +71,7 @@ public:
* Returns the deviceCapabilityNumber on success.
*/
virtual WebRtc_Word32 GetBestMatchedCapability(
const WebRtc_UWord8*deviceUniqueIdUTF8,
const char* deviceUniqueIdUTF8,
const VideoCaptureCapability& requested,
VideoCaptureCapability& resulting);
@ -79,13 +79,13 @@ public:
* Display OS /capture device specific settings dialog
*/
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const WebRtc_UWord8* dialogTitleUTF8, void* parentWindow,
const char* deviceUniqueIdUTF8,
const char* dialogTitleUTF8, void* parentWindow,
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY);
protected:
virtual WebRtc_Word32 CreateCapabilityMap(
const WebRtc_UWord8* deviceUniqueIdUTF8);
const char* deviceUniqueIdUTF8);
VideoCaptureMacQTKitInfoObjC* _captureInfo;
};

View File

@ -47,9 +47,9 @@ WebRtc_UWord32 VideoCaptureMacQTKitInfo::NumberOfDevices()
}
WebRtc_Word32 VideoCaptureMacQTKitInfo::GetDeviceName(
WebRtc_UWord32 deviceNumber, WebRtc_UWord8* deviceNameUTF8,
WebRtc_UWord32 deviceNameLength, WebRtc_UWord8* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length, WebRtc_UWord8* productUniqueIdUTF8,
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
WebRtc_UWord32 deviceNameLength, char* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
WebRtc_UWord32 productUniqueIdUTF8Length)
{
int errNum = [[_captureInfo getDeviceNamesFromIndex:deviceNumber
@ -62,7 +62,7 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::GetDeviceName(
}
WebRtc_Word32 VideoCaptureMacQTKitInfo::NumberOfCapabilities(
const WebRtc_UWord8* deviceUniqueIdUTF8)
const char* deviceUniqueIdUTF8)
{
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
// "analog". QTKit will do it's best to convert frames to what ever format
@ -74,7 +74,7 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::NumberOfCapabilities(
WebRtc_Word32 VideoCaptureMacQTKitInfo::GetCapability(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const char* deviceUniqueIdUTF8,
const WebRtc_UWord32 deviceCapabilityNumber,
VideoCaptureCapability& capability)
{
@ -88,7 +88,7 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::GetCapability(
WebRtc_Word32 VideoCaptureMacQTKitInfo::GetBestMatchedCapability(
const WebRtc_UWord8*deviceUniqueIdUTF8,
const char* deviceUniqueIdUTF8,
const VideoCaptureCapability& requested, VideoCaptureCapability& resulting)
{
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
@ -100,8 +100,8 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::GetBestMatchedCapability(
}
WebRtc_Word32 VideoCaptureMacQTKitInfo::DisplayCaptureSettingsDialogBox(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const WebRtc_UWord8* dialogTitleUTF8, void* parentWindow,
const char* deviceUniqueIdUTF8,
const char* dialogTitleUTF8, void* parentWindow,
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY)
{
@ -113,7 +113,7 @@ WebRtc_Word32 VideoCaptureMacQTKitInfo::DisplayCaptureSettingsDialogBox(
}
WebRtc_Word32 VideoCaptureMacQTKitInfo::CreateCapabilityMap(
const WebRtc_UWord8* deviceUniqueIdUTF8)
const char* deviceUniqueIdUTF8)
{
// Not implemented. Mac doesn't use discrete steps in capabilities, rather
// "analog". QTKit will do it's best to convert frames to what ever format

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@ -49,16 +49,16 @@
- (NSNumber*)getCaptureDeviceCount;
- (NSNumber*)getDeviceNamesFromIndex:(WebRtc_UWord32)index
DefaultName:(WebRtc_UWord8*)deviceName
DefaultName:(char*)deviceName
WithLength:(WebRtc_UWord32)deviceNameLength
AndUniqueID:(WebRtc_UWord8*)deviceUniqueID
AndUniqueID:(char*)deviceUniqueID
WithLength:(WebRtc_UWord32)deviceUniqueIDLength
AndProductID:(WebRtc_UWord8*)deviceProductID
AndProductID:(char*)deviceProductID
WithLength:(WebRtc_UWord32)deviceProductIDLength;
- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:
(const WebRtc_UWord8*)deviceUniqueIdUTF8
AndTitle:(const WebRtc_UWord8*)dialogTitleUTF8
(const char*)deviceUniqueIdUTF8
AndTitle:(const char*)dialogTitleUTF8
AndParentWindow:(void*) parentWindow AtX:(WebRtc_UWord32)positionX
AndY:(WebRtc_UWord32) positionY;
@end

View File

@ -49,11 +49,12 @@ using namespace webrtc;
/// ***** Creates a message box with Cocoa framework
/// ***** Returns 0 on success, -1 otherwise.
- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:(const WebRtc_UWord8*)deviceUniqueIdUTF8
AndTitle:(const WebRtc_UWord8*)dialogTitleUTF8
AndParentWindow:(void*) parentWindow
AtX:(WebRtc_UWord32)positionX
AndY:(WebRtc_UWord32) positionY
- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:
(const char*)deviceUniqueIdUTF8
AndTitle:(const char*)dialogTitleUTF8
AndParentWindow:(void*) parentWindow
AtX:(WebRtc_UWord32)positionX
AndY:(WebRtc_UWord32) positionY
{
NSString* strTitle = [NSString stringWithFormat:@"%s", dialogTitleUTF8];
NSString* strButton = @"Alright";
@ -74,11 +75,11 @@ using namespace webrtc;
- (NSNumber*)getDeviceNamesFromIndex:(WebRtc_UWord32)index
DefaultName:(WebRtc_UWord8*)deviceName
DefaultName:(char*)deviceName
WithLength:(WebRtc_UWord32)deviceNameLength
AndUniqueID:(WebRtc_UWord8*)deviceUniqueID
AndUniqueID:(char*)deviceUniqueID
WithLength:(WebRtc_UWord32)deviceUniqueIDLength
AndProductID:(WebRtc_UWord8*)deviceProductID
AndProductID:(char*)deviceProductID
WithLength:(WebRtc_UWord32)deviceProductIDLength
{
if(NO == _OSSupportedInfo)

View File

@ -65,7 +65,7 @@ VideoCaptureMacQuickTime::~VideoCaptureMacQuickTime()
}
WebRtc_Word32 VideoCaptureMacQuickTime::Init(
const WebRtc_Word32 id, const WebRtc_UWord8* deviceUniqueIdUTF8)
const WebRtc_Word32 id, const char* deviceUniqueIdUTF8)
{
const WebRtc_Word32 nameLength =
@ -74,7 +74,7 @@ WebRtc_Word32 VideoCaptureMacQuickTime::Init(
return -1;
// Store the device name
_deviceUniqueId = new WebRtc_UWord8[nameLength + 1];
_deviceUniqueId = new char[nameLength + 1];
memset(_deviceUniqueId, 0, nameLength + 1);
memcpy(_deviceUniqueId, deviceUniqueIdUTF8, nameLength + 1);

View File

@ -48,9 +48,9 @@ WebRtc_UWord32 VideoCaptureMacQuickTimeInfo::NumberOfDevices()
// don't care about these variables... dummy vars to call GetCaptureDevices
const int kNameLength = 1024;
WebRtc_UWord8 deviceNameUTF8[kNameLength] = "";
WebRtc_UWord8 deviceUniqueIdUTF8[kNameLength] = "";
WebRtc_UWord8 productUniqueIdUTF8[kNameLength] = "";
char deviceNameUTF8[kNameLength] = "";
char deviceUniqueIdUTF8[kNameLength] = "";
char productUniqueIdUTF8[kNameLength] = "";
if (GetCaptureDevices(0, deviceNameUTF8, kNameLength, deviceUniqueIdUTF8,
kNameLength, productUniqueIdUTF8, kNameLength,
@ -63,9 +63,9 @@ WebRtc_UWord32 VideoCaptureMacQuickTimeInfo::NumberOfDevices()
}
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetDeviceName(
WebRtc_UWord32 deviceNumber, WebRtc_UWord8* deviceNameUTF8,
WebRtc_UWord32 deviceNameUTF8Length, WebRtc_UWord8* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length, WebRtc_UWord8* productUniqueIdUTF8,
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
WebRtc_UWord32 deviceNameUTF8Length, char* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
WebRtc_UWord32 productUniqueIdUTF8Length)
{
@ -77,7 +77,7 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetDeviceName(
}
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::NumberOfCapabilities(
const WebRtc_UWord8* deviceUniqueIdUTF8)
const char* deviceUniqueIdUTF8)
{
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
"NumberOfCapabilities is not supported on the Mac platform.");
@ -85,7 +85,7 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::NumberOfCapabilities(
}
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetCapability(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const char* deviceUniqueIdUTF8,
const WebRtc_UWord32 deviceCapabilityNumber,
VideoCaptureCapability& capability)
{
@ -95,7 +95,7 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetCapability(
}
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetBestMatchedCapability(
const WebRtc_UWord8*deviceUniqueIdUTF8,
const char*deviceUniqueIdUTF8,
const VideoCaptureCapability& requested, VideoCaptureCapability& resulting)
{
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
@ -104,15 +104,15 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::GetBestMatchedCapability(
}
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::DisplayCaptureSettingsDialogBox(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const WebRtc_UWord8* dialogTitleUTF8, void* parentWindow,
const char* deviceUniqueIdUTF8,
const char* dialogTitleUTF8, void* parentWindow,
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY)
{
return -1;
}
WebRtc_Word32 VideoCaptureMacQuickTimeInfo::CreateCapabilityMap(
const WebRtc_UWord8* deviceUniqueIdUTF8)
const char* deviceUniqueIdUTF8)
{
WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
"NumberOfCapabilities is not supported on the Mac platform.");
@ -120,9 +120,9 @@ WebRtc_Word32 VideoCaptureMacQuickTimeInfo::CreateCapabilityMap(
}
int VideoCaptureMacQuickTimeInfo::GetCaptureDevices(
WebRtc_UWord32 deviceNumber, WebRtc_UWord8* deviceNameUTF8,
WebRtc_UWord32 deviceNameUTF8Length, WebRtc_UWord8* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length, WebRtc_UWord8* productUniqueIdUTF8,
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
WebRtc_UWord32 deviceNameUTF8Length, char* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
WebRtc_UWord32 productUniqueIdUTF8Length, int& numberOfDevices)
{

View File

@ -56,10 +56,10 @@ public:
* otherwise.
*/
virtual WebRtc_Word32 GetDeviceName(
WebRtc_UWord32 deviceNumber, WebRtc_UWord8* deviceNameUTF8,
WebRtc_UWord32 deviceNameLength, WebRtc_UWord8* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceNumber, char* deviceNameUTF8,
WebRtc_UWord32 deviceNameLength, char* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length,
WebRtc_UWord8* productUniqueIdUTF8 = 0,
char* productUniqueIdUTF8 = 0,
WebRtc_UWord32 productUniqueIdUTF8Length = 0);
@ -68,13 +68,13 @@ public:
/*
* Returns the number of capabilities for this device
*/
virtual WebRtc_Word32 NumberOfCapabilities(const WebRtc_UWord8* deviceUniqueIdUTF8);
virtual WebRtc_Word32 NumberOfCapabilities(const char* deviceUniqueIdUTF8);
/*
* Gets the capabilities of the named device
*/
virtual WebRtc_Word32 GetCapability(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const char* deviceUniqueIdUTF8,
const WebRtc_UWord32 deviceCapabilityNumber,
VideoCaptureCapability& capability);
@ -83,7 +83,7 @@ public:
* Returns the deviceCapabilityNumber on success.
*/
virtual WebRtc_Word32 GetBestMatchedCapability(
const WebRtc_UWord8*deviceUniqueIdUTF8,
const char*deviceUniqueIdUTF8,
const VideoCaptureCapability& requested,
VideoCaptureCapability& resulting);
@ -91,13 +91,13 @@ public:
* Display OS /capture device specific settings dialog
*/
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
const WebRtc_UWord8* deviceUniqueIdUTF8,
const WebRtc_UWord8* dialogTitleUTF8, void* parentWindow,
const char* deviceUniqueIdUTF8,
const char* dialogTitleUTF8, void* parentWindow,
WebRtc_UWord32 positionX, WebRtc_UWord32 positionY);
protected:
virtual WebRtc_Word32 CreateCapabilityMap(
const WebRtc_UWord8* deviceUniqueIdUTF8);
const char* deviceUniqueIdUTF8);
private:
@ -126,11 +126,11 @@ private:
// private methods
int GetCaptureDevices(WebRtc_UWord32 deviceNumber,
WebRtc_UWord8* deviceNameUTF8,
char* deviceNameUTF8,
WebRtc_UWord32 deviceNameUTF8Length,
WebRtc_UWord8* deviceUniqueIdUTF8,
char* deviceUniqueIdUTF8,
WebRtc_UWord32 deviceUniqueIdUTF8Length,
WebRtc_UWord8* productUniqueIdUTF8,
char* productUniqueIdUTF8,
WebRtc_UWord32 productUniqueIdUTF8Length,
int& numberOfDevices);

View File

@ -113,7 +113,7 @@ bool CheckQTVersion()
*/
VideoCaptureModule* VideoCaptureImpl::Create(
const WebRtc_Word32 id, const WebRtc_UWord8* deviceUniqueIdUTF8)
const WebRtc_Word32 id, const char* deviceUniqueIdUTF8)
{
if (webrtc::videocapturemodule::CheckOSVersion() == false)