diff --git a/webrtc/modules/video_capture/video_capture.gypi b/webrtc/modules/video_capture/video_capture.gypi index b7eefc5cd2..bca05be954 100644 --- a/webrtc/modules/video_capture/video_capture.gypi +++ b/webrtc/modules/video_capture/video_capture.gypi @@ -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': [ diff --git a/webrtc/modules/video_capture/windows/capture_delay_values_windows.h b/webrtc/modules/video_capture/windows/capture_delay_values_windows.h new file mode 100644 index 0000000000..a4d9da6459 --- /dev/null +++ b/webrtc/modules/video_capture/windows/capture_delay_values_windows.h @@ -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_ diff --git a/webrtc/modules/video_capture/windows/device_info_mf.cc b/webrtc/modules/video_capture/windows/device_info_mf.cc deleted file mode 100644 index 61f4f46ecb..0000000000 --- a/webrtc/modules/video_capture/windows/device_info_mf.cc +++ /dev/null @@ -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 diff --git a/webrtc/modules/video_capture/windows/device_info_mf.h b/webrtc/modules/video_capture/windows/device_info_mf.h deleted file mode 100644 index cf1297f6d5..0000000000 --- a/webrtc/modules/video_capture/windows/device_info_mf.h +++ /dev/null @@ -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_ diff --git a/webrtc/modules/video_capture/windows/device_info_ds.cc b/webrtc/modules/video_capture/windows/device_info_windows.cc similarity index 96% rename from webrtc/modules/video_capture/windows/device_info_ds.cc rename to webrtc/modules/video_capture/windows/device_info_windows.cc index 5acd58ecb1..a149a2e361 100644 --- a/webrtc/modules/video_capture/windows/device_info_ds.cc +++ b/webrtc/modules/video_capture/windows/device_info_windows.cc @@ -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, diff --git a/webrtc/modules/video_capture/windows/device_info_ds.h b/webrtc/modules/video_capture/windows/device_info_windows.h similarity index 93% rename from webrtc/modules/video_capture/windows/device_info_ds.h rename to webrtc/modules/video_capture/windows/device_info_windows.h index 33ccdf5e5f..2bae6b30a4 100644 --- a/webrtc/modules/video_capture/windows/device_info_ds.h +++ b/webrtc/modules/video_capture/windows/device_info_windows.h @@ -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_ diff --git a/webrtc/modules/video_capture/windows/help_functions_ds.cc b/webrtc/modules/video_capture/windows/help_functions_windows.cc similarity index 92% rename from webrtc/modules/video_capture/windows/help_functions_ds.cc rename to webrtc/modules/video_capture/windows/help_functions_windows.cc index 5c78e6b8ad..405a53d802 100644 --- a/webrtc/modules/video_capture/windows/help_functions_ds.cc +++ b/webrtc/modules/video_capture/windows/help_functions_windows.cc @@ -8,13 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include // 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 +#include "help_functions_windows.h" namespace webrtc { diff --git a/webrtc/modules/video_capture/windows/help_functions_ds.h b/webrtc/modules/video_capture/windows/help_functions_windows.h similarity index 81% rename from webrtc/modules/video_capture/windows/help_functions_ds.h rename to webrtc/modules/video_capture/windows/help_functions_windows.h index 9765796c98..002087789f 100644 --- a/webrtc/modules/video_capture/windows/help_functions_ds.h +++ b/webrtc/modules/video_capture/windows/help_functions_windows.h @@ -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 +#include 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_ diff --git a/webrtc/modules/video_capture/windows/sink_filter_ds.cc b/webrtc/modules/video_capture/windows/sink_filter_windows.cc similarity index 99% rename from webrtc/modules/video_capture/windows/sink_filter_ds.cc rename to webrtc/modules/video_capture/windows/sink_filter_windows.cc index db57eb263b..ec9d2bf1c4 100644 --- a/webrtc/modules/video_capture/windows/sink_filter_ds.cc +++ b/webrtc/modules/video_capture/windows/sink_filter_windows.cc @@ -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 // VIDEOINFOHEADER2 #include #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, diff --git a/webrtc/modules/video_capture/windows/sink_filter_ds.h b/webrtc/modules/video_capture/windows/sink_filter_windows.h similarity index 98% rename from webrtc/modules/video_capture/windows/sink_filter_ds.h rename to webrtc/modules/video_capture/windows/sink_filter_windows.h index 78e34e3b26..efeb9c77cb 100644 --- a/webrtc/modules/video_capture/windows/sink_filter_ds.h +++ b/webrtc/modules/video_capture/windows/sink_filter_windows.h @@ -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 // 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_ diff --git a/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc b/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc index 815ff0251d..41805c262e 100644 --- a/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc +++ b/webrtc/modules/video_capture/windows/video_capture_factory_windows.cc @@ -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* newCaptureModule = + new RefCountImpl(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* capture = new RefCountImpl(id); - if (capture->Init(id, device_id) != 0) { - delete capture; - capture = NULL; - } - - return capture; -} - -} // namespace videocapturemodule -} // namespace webrtc +} //namespace videocapturemodule +} //namespace webrtc diff --git a/webrtc/modules/video_capture/windows/video_capture_mf.cc b/webrtc/modules/video_capture/windows/video_capture_mf.cc deleted file mode 100644 index 873165d9e5..0000000000 --- a/webrtc/modules/video_capture/windows/video_capture_mf.cc +++ /dev/null @@ -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 diff --git a/webrtc/modules/video_capture/windows/video_capture_mf.h b/webrtc/modules/video_capture/windows/video_capture_mf.h deleted file mode 100644 index 5271eeb3db..0000000000 --- a/webrtc/modules/video_capture/windows/video_capture_mf.h +++ /dev/null @@ -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_ diff --git a/webrtc/modules/video_capture/windows/video_capture_ds.cc b/webrtc/modules/video_capture/windows/video_capture_windows.cc similarity index 98% rename from webrtc/modules/video_capture/windows/video_capture_ds.cc rename to webrtc/modules/video_capture/windows/video_capture_windows.cc index 275d987a75..4c2d52419e 100644 --- a/webrtc/modules/video_capture/windows/video_capture_ds.cc +++ b/webrtc/modules/video_capture/windows/video_capture_windows.cc @@ -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 // 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, diff --git a/webrtc/modules/video_capture/windows/video_capture_ds.h b/webrtc/modules/video_capture/windows/video_capture_windows.h similarity index 95% rename from webrtc/modules/video_capture/windows/video_capture_ds.h rename to webrtc/modules/video_capture/windows/video_capture_windows.h index 48c49909f9..6b83505303 100644 --- a/webrtc/modules/video_capture/windows/video_capture_ds.h +++ b/webrtc/modules/video_capture/windows/video_capture_windows.h @@ -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 -#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_