Remove warnings in VideoEngine, capture module and render module.

BUG=164, 176, 180

Review URL: http://webrtc-codereview.appspot.com/303004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1145 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2011-12-09 10:12:57 +00:00
parent b19582b7dc
commit 5cc4dc9e0c
14 changed files with 42 additions and 92 deletions

View File

@ -23,11 +23,13 @@ namespace videocapturemodule
VideoCaptureMacQTKit::VideoCaptureMacQTKit(const WebRtc_Word32 id) : VideoCaptureMacQTKit::VideoCaptureMacQTKit(const WebRtc_Word32 id) :
VideoCaptureImpl(id), VideoCaptureImpl(id),
_captureDevice(NULL),
_captureInfo(NULL),
_isCapturing(false),
_id(id), _id(id),
_captureWidth(QTKIT_DEFAULT_WIDTH), _captureWidth(QTKIT_DEFAULT_WIDTH),
_captureHeight(QTKIT_DEFAULT_HEIGHT), _captureHeight(QTKIT_DEFAULT_HEIGHT),
_captureFrameRate(QTKIT_DEFAULT_FRAME_RATE), _captureFrameRate(QTKIT_DEFAULT_FRAME_RATE),
_isCapturing(false),
_frameCount(0) _frameCount(0)
{ {
WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceVideoCapture, id, WEBRTC_TRACE(webrtc::kTraceModuleCall, webrtc::kTraceVideoCapture, id,
@ -64,7 +66,6 @@ WebRtc_Word32 VideoCaptureMacQTKit::Init(
"VideoCaptureMacQTKit::Init() called with id %d and unique " "VideoCaptureMacQTKit::Init() called with id %d and unique "
"device %s", id, iDeviceUniqueIdUTF8); "device %s", id, iDeviceUniqueIdUTF8);
WebRtc_Word32 result=0;
const WebRtc_Word32 nameLength = const WebRtc_Word32 nameLength =
(WebRtc_Word32) strlen((char*)iDeviceUniqueIdUTF8); (WebRtc_Word32) strlen((char*)iDeviceUniqueIdUTF8);
if(nameLength>kVideoCaptureUniqueNameLength) if(nameLength>kVideoCaptureUniqueNameLength)

View File

@ -21,9 +21,6 @@
#include "video_capture_qtkit_utility.h" #include "video_capture_qtkit_utility.h"
#include "video_capture_qtkit_info.h" #include "video_capture_qtkit_info.h"
using namespace webrtc;
@interface VideoCaptureMacQTKitInfoObjC : NSObject{ @interface VideoCaptureMacQTKitInfoObjC : NSObject{
bool _OSSupportedInfo; bool _OSSupportedInfo;
NSArray* _captureDevicesInfo; NSArray* _captureDevicesInfo;

View File

@ -10,7 +10,7 @@
#include "trace.h" #include "trace.h"
using namespace webrtc;
#pragma mark **** hidden class interface #pragma mark **** hidden class interface
@ -127,21 +127,6 @@
// ****************** "private" category functions below here ****************** // ****************** "private" category functions below here ******************
#pragma mark **** "private" method implementations #pragma mark **** "private" method implementations
- (NSNumber*)getCaptureDeviceWithIndex:(int)index ToString:(char*)name
WithLength:(int)length
{
index = index;
name = name;
length = length;
return [NSNumber numberWithInt:0];
}
- (NSNumber*)setCaptureDeviceByIndex:(int)index
{
index = index;
return [NSNumber numberWithInt:0];
}
- (NSNumber*)initializeVariables - (NSNumber*)initializeVariables
{ {
if(NO == _OSSupportedInfo) if(NO == _OSSupportedInfo)

View File

@ -23,18 +23,10 @@
#import <CoreFoundation/CoreFoundation.h> #import <CoreFoundation/CoreFoundation.h>
#import <CoreVideo/CoreVideo.h> #import <CoreVideo/CoreVideo.h>
#import "video_capture_recursive_lock.h" #import "video_capture_recursive_lock.h"
#include "video_capture_qtkit.h" #include "video_capture_qtkit.h"
using namespace webrtc;
using namespace videocapturemodule;
@interface VideoCaptureMacQTKitObjC : NSObject{ @interface VideoCaptureMacQTKitObjC : NSObject{
// class properties // class properties
bool _capturing; bool _capturing;
@ -48,7 +40,7 @@ using namespace videocapturemodule;
bool _captureInitialized; bool _captureInitialized;
// WebRTC Custom classes // WebRTC Custom classes
VideoCaptureMacQTKit* _owner; webrtc::videocapturemodule::VideoCaptureMacQTKit* _owner;
VideoCaptureRecursiveLock* _rLock; VideoCaptureRecursiveLock* _rLock;
// QTKit variables // QTKit variables
@ -90,9 +82,7 @@ using namespace videocapturemodule;
***************************************************************************/ ***************************************************************************/
- (NSNumber*)getCaptureDeviceWithIndex:(int)index ToString:(char*)name WithLength:(int)length;
- (NSNumber*)registerOwner:(webrtc::videocapturemodule::VideoCaptureMacQTKit*)owner; - (NSNumber*)registerOwner:(webrtc::videocapturemodule::VideoCaptureMacQTKit*)owner;
- (NSNumber*)setCaptureDeviceByIndex:(int)index;
- (NSNumber*)setCaptureDeviceById:(char*)uniqueId; - (NSNumber*)setCaptureDeviceById:(char*)uniqueId;
- (NSNumber*)setCaptureHeight:(int)height AndWidth:(int)width AndFrameRate:(int)frameRate; - (NSNumber*)setCaptureHeight:(int)height AndWidth:(int)width AndFrameRate:(int)frameRate;
- (NSNumber*)startCapture; - (NSNumber*)startCapture;

View File

@ -17,6 +17,8 @@
#include "video_capture_qtkit_utility.h" #include "video_capture_qtkit_utility.h"
#include "trace.h" #include "trace.h"
using namespace webrtc;
using namespace videocapturemodule;
@implementation VideoCaptureMacQTKitObjC @implementation VideoCaptureMacQTKitObjC
@ -70,28 +72,6 @@
return [NSNumber numberWithInt:0]; return [NSNumber numberWithInt:0];
} }
/// ***** Supposed to get capture device by index.
/// ***** Currently not used
- (NSNumber*)getCaptureDeviceWithIndex:(int)index ToString:(char*)name
WithLength:(int)length{
WEBRTC_TRACE(kTraceModuleCall, kTraceVideoCapture, 0,
"%s:%d index=%s name=%s", __FUNCTION__, __LINE__, name);
index = index;
name = name;
length = length;
return [NSNumber numberWithInt:0];
}
/// ***** Supposed to set capture device by index.
/// ***** Currently not used
- (NSNumber*)setCaptureDeviceByIndex:(int)index {
WEBRTC_TRACE(kTraceModuleCall, kTraceVideoCapture, 0,
"%s:%d name", __FUNCTION__, __LINE__);
index = index;
return [NSNumber numberWithInt:0];
}
/// ***** Sets the QTCaptureSession's input device from a char* /// ***** Sets the QTCaptureSession's input device from a char*
/// ***** Sets several member variables. Can signal the error system if one has /// ***** Sets several member variables. Can signal the error system if one has
/// occurred /// occurred
@ -215,8 +195,9 @@
_frameHeight = height; _frameHeight = height;
_frameRate = frameRate; _frameRate = frameRate;
[_captureDecompressedVideoOutput // TODO(mflodman) Check fps settings.
setMinimumVideoFrameInterval:(NSTimeInterval)1/(float)_frameRate]; // [_captureDecompressedVideoOutput
// setMinimumVideoFrameInterval:(NSTimeInterval)1/(float)_frameRate];
NSDictionary* captureDictionary = [NSDictionary dictionaryWithObjectsAndKeys: NSDictionary* captureDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithDouble:_frameWidth], (id)kCVPixelBufferWidthKey, [NSNumber numberWithDouble:_frameWidth], (id)kCVPixelBufferWidthKey,
[NSNumber numberWithDouble:_frameHeight], (id)kCVPixelBufferHeightKey, [NSNumber numberWithDouble:_frameHeight], (id)kCVPixelBufferHeightKey,
@ -417,9 +398,10 @@
[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32ARGB], [NSNumber numberWithUnsignedInt:kCVPixelFormatType_32ARGB],
(id)kCVPixelBufferPixelFormatTypeKey, nil]]; (id)kCVPixelBufferPixelFormatTypeKey, nil]];
[_captureDecompressedVideoOutput setMinimumVideoFrameInterval: // TODO(mflodman) Check fps settings.
(NSTimeInterval)1/(float)_frameRate]; //[_captureDecompressedVideoOutput setMinimumVideoFrameInterval:
[_captureDecompressedVideoOutput setAutomaticallyDropsLateVideoFrames:YES]; // (NSTimeInterval)1/(float)_frameRate];
//[_captureDecompressedVideoOutput setAutomaticallyDropsLateVideoFrames:YES];
success = [_captureSession addOutput:_captureDecompressedVideoOutput success = [_captureSession addOutput:_captureDecompressedVideoOutput
error:&error]; error:&error];
@ -465,7 +447,6 @@
CVPixelBufferLockBaseAddress(videoFrame, LOCK_FLAGS); CVPixelBufferLockBaseAddress(videoFrame, LOCK_FLAGS);
void* baseAddress = CVPixelBufferGetBaseAddress(videoFrame); void* baseAddress = CVPixelBufferGetBaseAddress(videoFrame);
size_t bytesPerRow = CVPixelBufferGetBytesPerRow(videoFrame); size_t bytesPerRow = CVPixelBufferGetBytesPerRow(videoFrame);
int frameWidth = CVPixelBufferGetWidth(videoFrame);
int frameHeight = CVPixelBufferGetHeight(videoFrame); int frameHeight = CVPixelBufferGetHeight(videoFrame);
CVPixelBufferUnlockBaseAddress(videoFrame, LOCK_FLAGS); CVPixelBufferUnlockBaseAddress(videoFrame, LOCK_FLAGS);
@ -491,10 +472,6 @@
_framesDelivered++; _framesDelivered++;
_framesRendered++; _framesRendered++;
captureOutput = captureOutput;
sampleBuffer = sampleBuffer;
connection = connection;
if(YES == [_rLock locked]) if(YES == [_rLock locked])
{ {
[_rLock unlock]; [_rLock unlock];

View File

@ -26,7 +26,7 @@
-(id)init; -(id)init;
-(void)grabFullScreen; -(void)grabFullScreen;
-(void)releaseFullScreen; -(void)releaseFullScreen;
-(NSWindow*)window;
@end @end

View File

@ -25,11 +25,6 @@ using namespace webrtc;
return self; return self;
} }
-(NSWindow*)window{
return _window;
}
-(void)grabFullScreen{ -(void)grabFullScreen{
WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, 0, "%s:%d", __FUNCTION__, __LINE__); WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, 0, "%s:%d", __FUNCTION__, __LINE__);
@ -75,6 +70,11 @@ using namespace webrtc;
} }
} }
- (NSWindow*)window
{
return _window;
}
- (void) dealloc - (void) dealloc
{ {
WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, 0, "%s:%d", __FUNCTION__, __LINE__); WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, 0, "%s:%d", __FUNCTION__, __LINE__);

View File

@ -9,7 +9,7 @@
*/ */
// //
// cocoa_render_view.h // cocoa_render_view.h
// //
#ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_COCOA_RENDER_VIEW_H_ #ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_COCOA_RENDER_VIEW_H_
@ -20,16 +20,13 @@
#import <OpenGL/glu.h> #import <OpenGL/glu.h>
#import <OpenGL/OpenGL.h> #import <OpenGL/OpenGL.h>
@interface CocoaRenderView : NSOpenGLView { @interface CocoaRenderView : NSOpenGLView {
NSOpenGLContext* _nsOpenGLContext; NSOpenGLContext* _nsOpenGLContext;
} }
-(void)initCocoaRenderView:(NSOpenGLPixelFormat*)fmt; -(void)initCocoaRenderView:(NSOpenGLPixelFormat*)fmt;
-(void)initCocoaRenderViewFullScreen:(NSOpenGLPixelFormat*)fmt; -(void)initCocoaRenderViewFullScreen:(NSOpenGLPixelFormat*)fmt;
-(NSOpenGLContext*)nsOpenGLContext;
@end @end
#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_COCOA_RENDER_VIEW_H_ #endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_COCOA_RENDER_VIEW_H_

View File

@ -28,12 +28,10 @@ using namespace webrtc;
} }
-(NSOpenGLContext*)nsOpenGLContext{ -(NSOpenGLContext*)nsOpenGLContext {
return _nsOpenGLContext; return _nsOpenGLContext;
} }
-(void)initCocoaRenderViewFullScreen:(NSOpenGLPixelFormat*)fmt{ -(void)initCocoaRenderViewFullScreen:(NSOpenGLPixelFormat*)fmt{
WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, 0, "%s:%d", __FUNCTION__, __LINE__); WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, 0, "%s:%d", __FUNCTION__, __LINE__);

View File

@ -289,7 +289,7 @@ int VideoChannelNSOpenGL::RenderOffScreenBuffer()
// if(_fullscreen) // if(_fullscreen)
// { // {
NSRect mainDisplayRect = [[NSScreen mainScreen] frame]; // NSRect mainDisplayRect = [[NSScreen mainScreen] frame];
// _width = mainDisplayRect.size.width; // _width = mainDisplayRect.size.width;
// _height = mainDisplayRect.size.height; // _height = mainDisplayRect.size.height;
// glViewport(0, 0, mainDisplayRect.size.width, mainDisplayRect.size.height); // glViewport(0, 0, mainDisplayRect.size.width, mainDisplayRect.size.height);

View File

@ -17,12 +17,12 @@ class ViEToFileRenderer;
namespace webrtc { namespace webrtc {
class VideoCaptureModule; class VideoCaptureModule;
class VideoCodec;
class ViEBase; class ViEBase;
class ViECapture; class ViECapture;
class ViECodec; class ViECodec;
class ViERender; class ViERender;
class ViERTP_RTCP; class ViERTP_RTCP;
struct VideoCodec;
} }
// Finds a suitable capture device (e.g. camera) on the current system // Finds a suitable capture device (e.g. camera) on the current system

View File

@ -131,6 +131,7 @@ void ViEAutoTest::ViECaptureStandardTest()
EXPECT_GT(numberOfCaptureDevices, 0); EXPECT_GT(numberOfCaptureDevices, 0);
int captureDeviceId[10]; int captureDeviceId[10];
memset(captureDeviceId, 0, sizeof(captureDeviceId));
webrtc::VideoCaptureModule* vcpms[10]; webrtc::VideoCaptureModule* vcpms[10];
memset(vcpms, 0, sizeof(vcpms)); memset(vcpms, 0, sizeof(vcpms));

View File

@ -8,15 +8,16 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "engine_configurations.h" #include "engine_configurations.h"
#if defined(COCOA_RENDERING) #if defined(COCOA_RENDERING)
#include "vie_autotest_mac_cocoa.h" #import "cocoa_render_view.h"
#include "vie_autotest_defines.h" #include "vie_autotest_mac_cocoa.h"
#include "vie_autotest.h" #include "vie_autotest_defines.h"
#include "vie_autotest_main.h" #include "vie_autotest.h"
#include "vie_autotest_main.h"
ViEAutoTestWindowManager::ViEAutoTestWindowManager() ViEAutoTestWindowManager::ViEAutoTestWindowManager()
: _cocoaRenderView1(nil), _cocoaRenderView2(nil) { : _cocoaRenderView1(nil), _cocoaRenderView2(nil) {
} }
@ -85,19 +86,19 @@ int main(int argc, char * argv[]) {
int result = 0; int result = 0;
#if defined(MAC_COCOA_USE_NSRUNLOOP) #if defined(MAC_COCOA_USE_NSRUNLOOP)
AutoTestClass* tests = [[AutoTestClass alloc] init]; AutoTestClass* tests = [[AutoTestClass alloc] init];
[tests setArgc:argc argv:argv]; [tests setArgc:argc argv:argv];
[NSThread detachNewThreadSelector:@selector(autoTestWithArg:) [NSThread detachNewThreadSelector:@selector(autoTestWithArg:)
toTarget:tests withObject:nil]; toTarget:tests withObject:nil];
// Process OS events. Blocking call. // Process OS events. Blocking call.
[[NSRunLoop mainRunLoop]run]; [[NSRunLoop mainRunLoop]run];
result = [tests result]; result = [tests result];
#else #else
ViEAutoTestMain autoTest; ViEAutoTestMain autoTest;
result = autoTest.RunTests(argc, argv); result = autoTest.RunTests(argc, argv);
#endif #endif
[pool release]; [pool release];
return result; return result;

View File

@ -154,6 +154,9 @@
], ],
}], }],
['OS=="mac"', { ['OS=="mac"', {
'include_dirs': [
'../../../modules/video_render/main/source/mac',
],
'xcode_settings': { 'xcode_settings': {
'OTHER_LDFLAGS': [ 'OTHER_LDFLAGS': [
'-framework Foundation -framework AppKit -framework Cocoa -framework OpenGL -framework CoreVideo -framework CoreAudio -framework AudioToolbox', '-framework Foundation -framework AppKit -framework Cocoa -framework OpenGL -framework CoreVideo -framework CoreAudio -framework AudioToolbox',