Revert 3135 - This broke the Mac bots somehow. Here's the error:
[ RUN ] ViEStandardIntegrationTest.RunsBaseTestWithoutErrors 2012-11-20 13:06:59.625 vie_auto_test[4001:f07] An uncaught exception was raised 2012-11-20 13:06:59.625 vie_auto_test[4001:f07] Error (1000) creating CGSWindow on line 259 2012-11-20 13:06:59.670 vie_auto_test[4001:f07] ( 0 CoreFoundation 0x9a4e912b __raiseError + 219 1 libobjc.A.dylib 0x95ee252e objc_exception_throw + 230 2 CoreFoundation 0x9a448bbb +[NSException raise:format:] + 139 3 AppKit 0x996b4757 _NSCreateWindowWithOpaqueShape2 + 302 4 AppKit 0x996b2f40 -[NSWindow _commonAwake] + 1823 5 AppKit 0x9966fa77 -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 1652 6 AppKit 0x9966eb3f -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1063 7 AppKit 0x9966e704 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 70 8 vie_auto_test 0x0015c232 -[TestCocoaUi createWindows:] + 338 9 libobjc.A.dylib 0x95eef5d3 -[NSObject performSelector:withObject:] + 70 10 Foundation 0x969050c0 __NSThreadPerformPerform + 395 11 CoreFoundation 0x9a3bf66f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15 12 CoreFoundation 0x9a3bf099 __CFRunLoopDoSources0 + 233 13 CoreFoundation 0x9a3e4e46 __CFRunLoopRun + 934 14 CoreFoundation 0x9a3e463a CFRunLoopRunSpecific + 378 15 CoreFoundation 0x9a3e44ab CFRunLoopRunInMode + 123 16 Foundation 0x9690d946 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 278 17 vie_auto_test 0x002e490a main + 522 18 vie_auto_test 0x000b1835 start + 53 ***** Restructure the video_capture code a bit to make room for a Media Foundation class implementation. This change includes the following: * Skeleton classes for a couple of base MediaFoundation classes (no code yet). See *_mf.*. * Renaming the DirectShow based implementation from "_windows" to "_ds". * Move the VideoCaptureImpl::CreateDeviceInfo() method into video_capture_factory_windows.cc The reason for this is that that's where the other VideoCaptureImpl factory function is and the factory function won't be implementation specific. * Removed use of <initguid.h> from a header file to avoid defining the same guids in multiple object files. (more info here: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375463(v=vs.85).aspx) * Moved a couple of global variables from the capture_delay_values_windows.h header and into device_info_ds.cc since that's the only file that uses those variables. * Delete capture_delay_values_windows.h. * Added a factory function: DeviceInfoDS::Create() that'll create the DirectShow specific implementation. TEST=This is mostly moving code around. The code that is added, is currently "dead". No manual testing needed. BUG=chromium:140545 Review URL: https://webrtc-codereview.appspot.com/967008 TBR=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/934017 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3136 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -86,19 +86,16 @@
|
||||
'windows',
|
||||
],
|
||||
'sources': [
|
||||
'windows/device_info_ds.cc',
|
||||
'windows/device_info_ds.h',
|
||||
'windows/device_info_mf.cc',
|
||||
'windows/device_info_mf.h',
|
||||
'windows/help_functions_ds.cc',
|
||||
'windows/help_functions_ds.h',
|
||||
'windows/sink_filter_ds.cc',
|
||||
'windows/sink_filter_ds.h',
|
||||
'windows/video_capture_ds.cc',
|
||||
'windows/video_capture_ds.h',
|
||||
'windows/capture_delay_values_windows.h',
|
||||
'windows/device_info_windows.cc',
|
||||
'windows/device_info_windows.h',
|
||||
'windows/help_functions_windows.cc',
|
||||
'windows/help_functions_windows.h',
|
||||
'windows/sink_filter_windows.cc',
|
||||
'windows/sink_filter_windows.h',
|
||||
'windows/video_capture_factory_windows.cc',
|
||||
'windows/video_capture_mf.cc',
|
||||
'windows/video_capture_mf.h',
|
||||
'windows/video_capture_windows.cc',
|
||||
'windows/video_capture_windows.h',
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
|
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_CAPTURE_DELAY_VALUES_WINDOWS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_CAPTURE_DELAY_VALUES_WINDOWS_H_
|
||||
|
||||
#include "../video_capture_delay.h"
|
||||
|
||||
namespace webrtc
|
||||
{
|
||||
namespace videocapturemodule
|
||||
{
|
||||
const WebRtc_Word32 NoWindowsCaptureDelays=1;
|
||||
const DelayValues WindowsCaptureDelays[NoWindowsCaptureDelays]=
|
||||
{
|
||||
"Microsoft LifeCam Cinema","usb#vid_045e&pid_075d",{{640,480,125},{640,360,117},{424,240,111},{352,288,111},{320,240,116},{176,144,101},{160,120,109},{1280,720,166},{960,544,126},{800,448,120},{800,600,127}},
|
||||
};
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_CAPTURE_DELAY_VALUES_WINDOWS_H_
|
@ -1,51 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "modules/video_capture/windows/device_info_mf.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace videocapturemodule {
|
||||
|
||||
DeviceInfoMF::DeviceInfoMF(const WebRtc_Word32 id) : DeviceInfoImpl(id) {
|
||||
}
|
||||
|
||||
DeviceInfoMF::~DeviceInfoMF() {
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoMF::Init() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtc_UWord32 DeviceInfoMF::NumberOfDevices() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoMF::GetDeviceName(
|
||||
WebRtc_UWord32 deviceNumber,
|
||||
char* deviceNameUTF8,
|
||||
WebRtc_UWord32 deviceNameLength,
|
||||
char* deviceUniqueIdUTF8,
|
||||
WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
||||
char* productUniqueIdUTF8,
|
||||
WebRtc_UWord32 productUniqueIdUTF8Length) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoMF::DisplayCaptureSettingsDialogBox(
|
||||
const char* deviceUniqueIdUTF8,
|
||||
const char* dialogTitleUTF8,
|
||||
void* parentWindow,
|
||||
WebRtc_UWord32 positionX,
|
||||
WebRtc_UWord32 positionY) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_WINDOWS_DEVICE_INFO_MF_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_WINDOWS_DEVICE_INFO_MF_H_
|
||||
|
||||
#include "modules/video_capture/device_info_impl.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace videocapturemodule {
|
||||
|
||||
// Provides video capture device information using the Media Foundation API.
|
||||
class DeviceInfoMF : public DeviceInfoImpl {
|
||||
public:
|
||||
explicit DeviceInfoMF(const WebRtc_Word32 id);
|
||||
virtual ~DeviceInfoMF();
|
||||
|
||||
WebRtc_Word32 Init();
|
||||
virtual WebRtc_UWord32 NumberOfDevices();
|
||||
|
||||
virtual WebRtc_Word32 GetDeviceName(WebRtc_UWord32 deviceNumber,
|
||||
char* deviceNameUTF8, WebRtc_UWord32 deviceNameLength,
|
||||
char* deviceUniqueIdUTF8, WebRtc_UWord32 deviceUniqueIdUTF8Length,
|
||||
char* productUniqueIdUTF8, WebRtc_UWord32 productUniqueIdUTF8Length);
|
||||
|
||||
virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox(
|
||||
const char* deviceUniqueIdUTF8, const char* dialogTitleUTF8,
|
||||
void* parentWindow, WebRtc_UWord32 positionX, WebRtc_UWord32 positionY);
|
||||
};
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_WINDOWS_DEVICE_INFO_MF_H_
|
@ -8,11 +8,11 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "device_info_ds.h"
|
||||
#include "device_info_windows.h"
|
||||
|
||||
#include "../video_capture_config.h"
|
||||
#include "../video_capture_delay.h"
|
||||
#include "help_functions_ds.h"
|
||||
#include "help_functions_windows.h"
|
||||
#include "capture_delay_values_windows.h"
|
||||
#include "ref_count.h"
|
||||
#include "trace.h"
|
||||
|
||||
@ -23,29 +23,12 @@ namespace webrtc
|
||||
{
|
||||
namespace videocapturemodule
|
||||
{
|
||||
const WebRtc_Word32 NoWindowsCaptureDelays = 1;
|
||||
const DelayValues WindowsCaptureDelays[NoWindowsCaptureDelays] = {
|
||||
"Microsoft LifeCam Cinema",
|
||||
"usb#vid_045e&pid_075d",
|
||||
{
|
||||
{640,480,125},
|
||||
{640,360,117},
|
||||
{424,240,111},
|
||||
{352,288,111},
|
||||
{320,240,116},
|
||||
{176,144,101},
|
||||
{160,120,109},
|
||||
{1280,720,166},
|
||||
{960,544,126},
|
||||
{800,448,120},
|
||||
{800,600,127}
|
||||
},
|
||||
};
|
||||
|
||||
// static
|
||||
DeviceInfoDS* DeviceInfoDS::Create(const WebRtc_Word32 id)
|
||||
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
||||
const WebRtc_Word32 id)
|
||||
{
|
||||
DeviceInfoDS* dsInfo = new DeviceInfoDS(id);
|
||||
videocapturemodule::DeviceInfoWindows* dsInfo =
|
||||
new videocapturemodule::DeviceInfoWindows(id);
|
||||
|
||||
if (!dsInfo || dsInfo->Init() != 0)
|
||||
{
|
||||
delete dsInfo;
|
||||
@ -54,7 +37,7 @@ DeviceInfoDS* DeviceInfoDS::Create(const WebRtc_Word32 id)
|
||||
return dsInfo;
|
||||
}
|
||||
|
||||
DeviceInfoDS::DeviceInfoDS(const WebRtc_Word32 id)
|
||||
DeviceInfoWindows::DeviceInfoWindows(const WebRtc_Word32 id)
|
||||
: DeviceInfoImpl(id), _dsDevEnum(NULL), _dsMonikerDevEnum(NULL),
|
||||
_CoUninitializeIsRequired(true)
|
||||
{
|
||||
@ -98,7 +81,7 @@ DeviceInfoDS::DeviceInfoDS(const WebRtc_Word32 id)
|
||||
}
|
||||
}
|
||||
|
||||
DeviceInfoDS::~DeviceInfoDS()
|
||||
DeviceInfoWindows::~DeviceInfoWindows()
|
||||
{
|
||||
RELEASE_AND_CLEAR(_dsMonikerDevEnum);
|
||||
RELEASE_AND_CLEAR(_dsDevEnum);
|
||||
@ -108,7 +91,7 @@ DeviceInfoDS::~DeviceInfoDS()
|
||||
}
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoDS::Init()
|
||||
WebRtc_Word32 DeviceInfoWindows::Init()
|
||||
{
|
||||
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
|
||||
IID_ICreateDevEnum, (void **) &_dsDevEnum);
|
||||
@ -120,13 +103,13 @@ WebRtc_Word32 DeviceInfoDS::Init()
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
WebRtc_UWord32 DeviceInfoDS::NumberOfDevices()
|
||||
WebRtc_UWord32 DeviceInfoWindows::NumberOfDevices()
|
||||
{
|
||||
ReadLockScoped cs(_apiLock);
|
||||
return GetDeviceInfo(0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoDS::GetDeviceName(
|
||||
}
|
||||
WebRtc_Word32 DeviceInfoWindows::GetDeviceName(
|
||||
WebRtc_UWord32 deviceNumber,
|
||||
char* deviceNameUTF8,
|
||||
WebRtc_UWord32 deviceNameLength,
|
||||
@ -145,7 +128,7 @@ WebRtc_Word32 DeviceInfoDS::GetDeviceName(
|
||||
return result > (WebRtc_Word32) deviceNumber ? 0 : -1;
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoDS::GetDeviceInfo(
|
||||
WebRtc_Word32 DeviceInfoWindows::GetDeviceInfo(
|
||||
WebRtc_UWord32 deviceNumber,
|
||||
char* deviceNameUTF8,
|
||||
WebRtc_UWord32 deviceNameLength,
|
||||
@ -272,7 +255,7 @@ WebRtc_Word32 DeviceInfoDS::GetDeviceInfo(
|
||||
return index;
|
||||
}
|
||||
|
||||
IBaseFilter * DeviceInfoDS::GetDeviceFilter(
|
||||
IBaseFilter * DeviceInfoWindows::GetDeviceFilter(
|
||||
const char* deviceUniqueIdUTF8,
|
||||
char* productUniqueIdUTF8,
|
||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
||||
@ -366,7 +349,7 @@ IBaseFilter * DeviceInfoDS::GetDeviceFilter(
|
||||
return captureFilter;
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoDS::GetWindowsCapability(
|
||||
WebRtc_Word32 DeviceInfoWindows::GetWindowsCapability(
|
||||
const WebRtc_Word32 capabilityIndex,
|
||||
VideoCaptureCapabilityWindows& windowsCapability)
|
||||
|
||||
@ -386,7 +369,7 @@ WebRtc_Word32 DeviceInfoDS::GetWindowsCapability(
|
||||
return 0;
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
||||
WebRtc_Word32 DeviceInfoWindows::CreateCapabilityMap(
|
||||
const char* deviceUniqueIdUTF8)
|
||||
|
||||
{
|
||||
@ -413,13 +396,13 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
||||
|
||||
|
||||
char productId[kVideoCaptureProductIdLength];
|
||||
IBaseFilter* captureDevice = DeviceInfoDS::GetDeviceFilter(
|
||||
IBaseFilter* captureDevice = DeviceInfoWindows::GetDeviceFilter(
|
||||
deviceUniqueIdUTF8,
|
||||
productId,
|
||||
kVideoCaptureProductIdLength);
|
||||
if (!captureDevice)
|
||||
return -1;
|
||||
IPin* outputCapturePin = GetOutputPin(captureDevice, GUID_NULL);
|
||||
IPin* outputCapturePin = GetOutputPin(captureDevice);
|
||||
if (!outputCapturePin)
|
||||
{
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
||||
@ -706,7 +689,7 @@ WebRtc_Word32 DeviceInfoDS::CreateCapabilityMap(
|
||||
"\\?\usb#vid_0408&pid_2010&mi_00#7&258e7aaf&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
|
||||
"\\?\avc#sony&dv-vcr&camcorder&dv#65b2d50301460008#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global"
|
||||
*/
|
||||
void DeviceInfoDS::GetProductId(const char* devicePath,
|
||||
void DeviceInfoWindows::GetProductId(const char* devicePath,
|
||||
char* productUniqueIdUTF8,
|
||||
WebRtc_UWord32 productUniqueIdUTF8Length)
|
||||
{
|
||||
@ -746,7 +729,7 @@ void DeviceInfoDS::GetProductId(const char* devicePath,
|
||||
}
|
||||
}
|
||||
|
||||
WebRtc_Word32 DeviceInfoDS::DisplayCaptureSettingsDialogBox(
|
||||
WebRtc_Word32 DeviceInfoWindows::DisplayCaptureSettingsDialogBox(
|
||||
const char* deviceUniqueIdUTF8,
|
||||
const char* dialogTitleUTF8,
|
||||
void* parentWindow,
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_DEVICE_INFO_DS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_DEVICE_INFO_DS_H_
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_DEVICE_INFO_WINDOWS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_DEVICE_INFO_WINDOWS_H_
|
||||
|
||||
#include "../video_capture_impl.h"
|
||||
#include "../device_info_impl.h"
|
||||
@ -33,14 +33,11 @@ struct VideoCaptureCapabilityWindows: public VideoCaptureCapability
|
||||
}
|
||||
|
||||
};
|
||||
class DeviceInfoDS: public DeviceInfoImpl
|
||||
class DeviceInfoWindows: public DeviceInfoImpl
|
||||
{
|
||||
public:
|
||||
// Factory function.
|
||||
static DeviceInfoDS* Create(const WebRtc_Word32 id);
|
||||
|
||||
DeviceInfoDS(const WebRtc_Word32 id);
|
||||
virtual ~DeviceInfoDS();
|
||||
DeviceInfoWindows(const WebRtc_Word32 id);
|
||||
virtual ~DeviceInfoWindows();
|
||||
|
||||
WebRtc_Word32 Init();
|
||||
virtual WebRtc_UWord32 NumberOfDevices();
|
||||
@ -84,8 +81,8 @@ public:
|
||||
static void GetProductId(const char* devicePath,
|
||||
char* productUniqueIdUTF8,
|
||||
WebRtc_UWord32 productUniqueIdUTF8Length);
|
||||
|
||||
protected:
|
||||
|
||||
WebRtc_Word32 GetDeviceInfo(WebRtc_UWord32 deviceNumber,
|
||||
char* deviceNameUTF8,
|
||||
WebRtc_UWord32 deviceNameLength,
|
||||
@ -105,4 +102,4 @@ private:
|
||||
};
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_DEVICE_INFO_DS_H_
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_DEVICE_INFO_WINDOWS_H_
|
@ -8,13 +8,7 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include <initguid.h> // Must come before the help_functions_ds.h include so
|
||||
// that DEFINE_GUID() entries will be defined in this
|
||||
// object file.
|
||||
|
||||
#include "help_functions_ds.h"
|
||||
|
||||
#include <cguid.h>
|
||||
#include "help_functions_windows.h"
|
||||
|
||||
namespace webrtc
|
||||
{
|
@ -8,13 +8,16 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_HELP_FUNCTIONS_DS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_HELP_FUNCTIONS_DS_H_
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_HELP_FUNCTIONS_WINDOWS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_HELP_FUNCTIONS_WINDOWS_H_
|
||||
|
||||
#include <dshow.h>
|
||||
#include <initguid.h>
|
||||
|
||||
DEFINE_GUID(MEDIASUBTYPE_I420, 0x30323449, 0x0000, 0x0010, 0x80, 0x00, 0x00,
|
||||
0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
DEFINE_GUID(MEDIASUBTYPE_V210, 0x30313276, 0x0000, 0x0010, 0x80, 0x00, 0x00,
|
||||
0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
DEFINE_GUID(MEDIASUBTYPE_HDYC, 0x43594448, 0x0000, 0x0010, 0x80, 0x00, 0x00,
|
||||
0xAA, 0x00, 0x38, 0x9B, 0x71);
|
||||
|
||||
@ -27,9 +30,9 @@ namespace videocapturemodule
|
||||
LONGLONG GetMaxOfFrameArray(LONGLONG *maxFps, long size);
|
||||
|
||||
IPin* GetInputPin(IBaseFilter* filter);
|
||||
IPin* GetOutputPin(IBaseFilter* filter, REFGUID Category);
|
||||
IPin* GetOutputPin(IBaseFilter* filter, REFGUID Category = GUID_NULL);
|
||||
BOOL PinMatchesCategory(IPin *pPin, REFGUID Category);
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_HELP_FUNCTIONS_DS_H_
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_HELP_FUNCTIONS_WINDOWS_H_
|
@ -8,19 +8,16 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "sink_filter_ds.h"
|
||||
#include "sink_filter_windows.h"
|
||||
|
||||
#include "trace.h"
|
||||
#include "help_functions_ds.h"
|
||||
#include "help_functions_windows.h"
|
||||
|
||||
#include <Dvdmedia.h> // VIDEOINFOHEADER2
|
||||
#include <initguid.h>
|
||||
|
||||
#define DELETE_RESET(p) { delete (p) ; (p) = NULL ;}
|
||||
|
||||
DEFINE_GUID(CLSID_SINKFILTER, 0x88cdbbdc, 0xa73b, 0x4afa, 0xac, 0xbf, 0x15, 0xd5,
|
||||
0xe2, 0xce, 0x12, 0xc3);
|
||||
|
||||
namespace webrtc
|
||||
{
|
||||
namespace videocapturemodule
|
||||
@ -34,6 +31,9 @@ typedef struct tagTHREADNAME_INFO
|
||||
DWORD dwFlags; // reserved for future use, must be zero
|
||||
} THREADNAME_INFO;
|
||||
|
||||
DEFINE_GUID(CLSID_SINKFILTER, 0x88cdbbdc, 0xa73b, 0x4afa, 0xac, 0xbf, 0x15, 0xd5,
|
||||
0xe2, 0xce, 0x12, 0xc3);
|
||||
|
||||
CaptureInputPin::CaptureInputPin (WebRtc_Word32 moduleId,
|
||||
IN TCHAR * szName,
|
||||
IN CaptureSinkFilter* pFilter,
|
@ -8,8 +8,8 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_SINK_FILTER_DS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_SINK_FILTER_DS_H_
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_SINK_FILTER_WINDOWS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_SINK_FILTER_WINDOWS_H_
|
||||
|
||||
#include <Streams.h> // Include base DS filter header files
|
||||
|
||||
@ -97,4 +97,4 @@ private:
|
||||
};
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_SINK_FILTER_DS_H_
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_SINK_FILTER_WINDOWS_H_
|
@ -9,33 +9,28 @@
|
||||
*/
|
||||
|
||||
#include "ref_count.h"
|
||||
#include "video_capture_ds.h"
|
||||
#include "video_capture_mf.h"
|
||||
#include "video_capture_windows.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace videocapturemodule {
|
||||
namespace webrtc
|
||||
{
|
||||
namespace videocapturemodule
|
||||
{
|
||||
VideoCaptureModule* VideoCaptureImpl::Create(
|
||||
const WebRtc_Word32 id,
|
||||
const char* deviceUniqueIdUTF8)
|
||||
{
|
||||
if (deviceUniqueIdUTF8 == NULL)
|
||||
return NULL;
|
||||
|
||||
// static
|
||||
VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo(
|
||||
const WebRtc_Word32 id) {
|
||||
// TODO(tommi): Use the Media Foundation version on Vista and up.
|
||||
return DeviceInfoDS::Create(id);
|
||||
RefCountImpl<videocapturemodule::VideoCaptureDS>* newCaptureModule =
|
||||
new RefCountImpl<videocapturemodule::VideoCaptureDS>(id);
|
||||
|
||||
if (newCaptureModule->Init(id, deviceUniqueIdUTF8) != 0)
|
||||
{
|
||||
delete newCaptureModule;
|
||||
newCaptureModule = NULL;
|
||||
}
|
||||
return newCaptureModule;
|
||||
}
|
||||
|
||||
VideoCaptureModule* VideoCaptureImpl::Create(const WebRtc_Word32 id,
|
||||
const char* device_id) {
|
||||
if (device_id == NULL)
|
||||
return NULL;
|
||||
|
||||
// TODO(tommi): Use Media Foundation implementation for Vista and up.
|
||||
RefCountImpl<VideoCaptureDS>* capture = new RefCountImpl<VideoCaptureDS>(id);
|
||||
if (capture->Init(id, device_id) != 0) {
|
||||
delete capture;
|
||||
capture = NULL;
|
||||
}
|
||||
|
||||
return capture;
|
||||
}
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
} //namespace videocapturemodule
|
||||
} //namespace webrtc
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "modules/video_capture/windows/video_capture_mf.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace videocapturemodule {
|
||||
|
||||
VideoCaptureMF::VideoCaptureMF(const WebRtc_Word32 id) : VideoCaptureImpl(id) {}
|
||||
VideoCaptureMF::~VideoCaptureMF() {}
|
||||
|
||||
WebRtc_Word32 VideoCaptureMF::Init(const WebRtc_Word32 id,
|
||||
const char* device_id) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
WebRtc_Word32 VideoCaptureMF::StartCapture(
|
||||
const VideoCaptureCapability& capability) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
WebRtc_Word32 VideoCaptureMF::StopCapture() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool VideoCaptureMF::CaptureStarted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
WebRtc_Word32 VideoCaptureMF::CaptureSettings(
|
||||
VideoCaptureCapability& settings) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_WINDOWS_VIDEO_CAPTURE_MF_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_WINDOWS_VIDEO_CAPTURE_MF_H_
|
||||
|
||||
#include "modules/video_capture/video_capture_impl.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace videocapturemodule {
|
||||
|
||||
// VideoCapture implementation that uses the Media Foundation API on Windows.
|
||||
// This will replace the DirectShow based implementation on Vista and higher.
|
||||
// TODO(tommi): Finish implementing and switch out the DS in the factory method
|
||||
// for supported platforms.
|
||||
class VideoCaptureMF : public VideoCaptureImpl {
|
||||
public:
|
||||
explicit VideoCaptureMF(const WebRtc_Word32 id);
|
||||
|
||||
WebRtc_Word32 Init(const WebRtc_Word32 id, const char* device_id);
|
||||
|
||||
// Overrides from VideoCaptureImpl.
|
||||
virtual WebRtc_Word32 StartCapture(const VideoCaptureCapability& capability);
|
||||
virtual WebRtc_Word32 StopCapture();
|
||||
virtual bool CaptureStarted();
|
||||
virtual WebRtc_Word32 CaptureSettings(
|
||||
VideoCaptureCapability& settings); // NOLINT
|
||||
|
||||
protected:
|
||||
virtual ~VideoCaptureMF();
|
||||
};
|
||||
|
||||
} // namespace videocapturemodule
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_WINDOWS_VIDEO_CAPTURE_MF_H_
|
@ -8,12 +8,12 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "video_capture_ds.h"
|
||||
#include "video_capture_windows.h"
|
||||
|
||||
#include "../video_capture_config.h"
|
||||
#include "critical_section_wrapper.h"
|
||||
#include "help_functions_ds.h"
|
||||
#include "sink_filter_ds.h"
|
||||
#include "help_functions_windows.h"
|
||||
#include "sink_filter_windows.h"
|
||||
#include "trace.h"
|
||||
|
||||
#include <Dvdmedia.h> // VIDEOINFOHEADER2
|
||||
@ -375,7 +375,7 @@ HRESULT VideoCaptureDS::ConnectDVCamera()
|
||||
"Failed to get input pin from DV decoder");
|
||||
return -1;
|
||||
}
|
||||
_outputDvPin = GetOutputPin(_dvFilter, GUID_NULL);
|
||||
_outputDvPin = GetOutputPin(_dvFilter);
|
||||
if (_outputDvPin == NULL)
|
||||
{
|
||||
WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
|
@ -8,13 +8,13 @@
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_DS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_DS_H_
|
||||
#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_WINDOWS_H_
|
||||
#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_WINDOWS_H_
|
||||
|
||||
#include "../video_capture_impl.h"
|
||||
#include <tchar.h>
|
||||
|
||||
#include "device_info_ds.h"
|
||||
#include "device_info_windows.h"
|
||||
|
||||
#define CAPTURE_FILTER_NAME L"VideoCaptureFilter"
|
||||
#define SINK_FILTER_NAME L"SinkFilter"
|
||||
@ -62,7 +62,7 @@ protected:
|
||||
WebRtc_Word32 DisconnectGraph();
|
||||
HRESULT VideoCaptureDS::ConnectDVCamera();
|
||||
|
||||
DeviceInfoDS _dsInfo;
|
||||
DeviceInfoWindows _dsInfo;
|
||||
|
||||
IBaseFilter* _captureFilter;
|
||||
IGraphBuilder* _graphBuilder;
|
||||
@ -79,4 +79,4 @@ protected:
|
||||
};
|
||||
} // namespace videocapturemodule
|
||||
} //namespace webrtc
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_DS_H_
|
||||
#endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_WINDOWS_VIDEO_CAPTURE_WINDOWS_H_
|
Reference in New Issue
Block a user