From f3f2f6abdbacbf48dce535c2ff28c4bc66335789 Mon Sep 17 00:00:00 2001 From: "wu@webrtc.org" Date: Wed, 19 Oct 2011 18:42:17 +0000 Subject: [PATCH] * Add include_internal_video_capture and include_internal_video_render to include/exclude the internal VCM and VRM. * Split the WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER into WEBRTC_INCLUDE_INTERNAL_VIDEO_CAPTURE and WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER. * Add DummyDeviceInfo for the case when WEBRTC_INCLUDE_INTERNAL_VIDEO_CAPTURE is not defined. Review URL: http://webrtc-codereview.appspot.com/224005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@778 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/build/common.gypi | 15 +- .../source/External/device_info_external.cc | 53 ++++ .../source/External/video_capture_external.cc | 28 ++ .../main/source/video_capture.gypi | 268 +++++++++--------- .../main/test/testAPI/testAPI.cpp | 4 - .../main/source/video_render.gypi | 16 +- .../main/source/video_render_impl.cc | 16 +- .../main/test/testAPI/testAPI.cpp | 7 +- src/video_engine/main/source/vie_capturer.cc | 2 - .../main/source/vie_input_manager.cc | 39 +-- .../main/source/vie_render_manager.cc | 4 - 11 files changed, 255 insertions(+), 197 deletions(-) create mode 100644 src/modules/video_capture/main/source/External/device_info_external.cc create mode 100644 src/modules/video_capture/main/source/External/video_capture_external.cc diff --git a/src/build/common.gypi b/src/build/common.gypi index e1d1574920..cba8319912 100644 --- a/src/build/common.gypi +++ b/src/build/common.gypi @@ -59,6 +59,12 @@ # Exclude internal ADM since Chromium uses its own IO handling. 'include_internal_audio_device%': 0, + + # Exclude internal VCM on Chromium build + 'include_internal_video_capture%': 0, + + # Exclude internal video render module on Chromium build + 'include_internal_video_render%': 0, 'webrtc_root%': '<(DEPTH)/third_party/webrtc', }, { @@ -66,6 +72,10 @@ 'include_pulse_audio%': 1, 'include_internal_audio_device%': 1, + + 'include_internal_video_capture%': 1, + + 'include_internal_video_render%': 1, 'webrtc_root%': '<(DEPTH)/src', }], @@ -102,11 +112,6 @@ 'WEBRTC_TARGET_PC', ], }], - ['build_with_chromium==1', { - 'defines': [ - 'WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER', - ], - }], ], # conditions 'target_conditions': [ diff --git a/src/modules/video_capture/main/source/External/device_info_external.cc b/src/modules/video_capture/main/source/External/device_info_external.cc new file mode 100644 index 0000000000..2aad08130b --- /dev/null +++ b/src/modules/video_capture/main/source/External/device_info_external.cc @@ -0,0 +1,53 @@ +/* + * 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. + */ + +#include "../device_info_impl.h" +#include "../video_capture_impl.h" + +namespace webrtc { + +namespace videocapturemodule { + +class ExternalDeviceInfo : public DeviceInfoImpl { + public: + ExternalDeviceInfo(const WebRtc_Word32 id) + : DeviceInfoImpl(id) { + } + virtual ~ExternalDeviceInfo() {} + virtual WebRtc_UWord32 NumberOfDevices() { return 0; } + virtual WebRtc_Word32 DisplayCaptureSettingsDialogBox( + const WebRtc_UWord8* /*deviceUniqueIdUTF8*/, + const WebRtc_UWord8* /*dialogTitleUTF8*/, + void* /*parentWindow*/, + WebRtc_UWord32 /*positionX*/, + WebRtc_UWord32 /*positionY*/) { return -1; } + virtual WebRtc_Word32 GetDeviceName( + WebRtc_UWord32 deviceNumber, + WebRtc_UWord8* deviceNameUTF8, + WebRtc_UWord32 deviceNameLength, + WebRtc_UWord8* deviceUniqueIdUTF8, + WebRtc_UWord32 deviceUniqueIdUTF8Length, + WebRtc_UWord8* productUniqueIdUTF8=0, + WebRtc_UWord32 productUniqueIdUTF8Length=0) { + return -1; + } + virtual WebRtc_Word32 CreateCapabilityMap( + const WebRtc_UWord8* deviceUniqueIdUTF8) { return 0; } + virtual WebRtc_Word32 Init() { return 0; } +}; + +VideoCaptureModule::DeviceInfo* VideoCaptureImpl::CreateDeviceInfo( + const WebRtc_Word32 id) { + return new ExternalDeviceInfo(id); +} + +} // namespace videocapturemodule + +} // namespace webrtc diff --git a/src/modules/video_capture/main/source/External/video_capture_external.cc b/src/modules/video_capture/main/source/External/video_capture_external.cc new file mode 100644 index 0000000000..e8cbccba71 --- /dev/null +++ b/src/modules/video_capture/main/source/External/video_capture_external.cc @@ -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. + */ + +#include "../video_capture_impl.h" +#include "ref_count.h" + +namespace webrtc { + +namespace videocapturemodule { + +VideoCaptureModule* VideoCaptureImpl::Create( + const WebRtc_Word32 id, + const WebRtc_UWord8* deviceUniqueIdUTF8) { + RefCountImpl* implementation = + new RefCountImpl(id); + return implementation; +} + +} // namespace videocapturemodule + +} // namespace webrtc diff --git a/src/modules/video_capture/main/source/video_capture.gypi b/src/modules/video_capture/main/source/video_capture.gypi index 9429130150..e4834ed9c1 100644 --- a/src/modules/video_capture/main/source/video_capture.gypi +++ b/src/modules/video_capture/main/source/video_capture.gypi @@ -47,140 +47,148 @@ 'device_info_impl.cc', ], 'conditions': [ - # DEFINE PLATFORM SPECIFIC SOURCE FILES - ['OS=="linux" and build_with_chromium==0', { - 'include_dirs': [ - 'Linux', - ], + ['include_internal_video_capture==0', { 'sources': [ - 'Linux/device_info_linux.h', - 'Linux/video_capture_linux.h', - 'Linux/device_info_linux.cc', - 'Linux/video_capture_linux.cc', + 'External/device_info_external.cc', + 'External/video_capture_external.cc', ], - }], - ['OS=="mac" and build_with_chromium==0', { - 'sources': [ - 'Mac/QTKit/video_capture_recursive_lock.h', - 'Mac/QTKit/video_capture_qtkit.h', - 'Mac/QTKit/video_capture_qtkit_info.h', - 'Mac/QTKit/video_capture_qtkit_info_objc.h', - 'Mac/QTKit/video_capture_qtkit_objc.h', - 'Mac/QTKit/video_capture_qtkit_utility.h', - 'Mac/video_capture_mac.mm', - 'Mac/QTKit/video_capture_qtkit.mm', - 'Mac/QTKit/video_capture_qtkit_objc.mm', - 'Mac/QTKit/video_capture_recursive_lock.mm', - 'Mac/QTKit/video_capture_qtkit_info.mm', - 'Mac/QTKit/video_capture_qtkit_info_objc.mm', - ], - 'include_dirs': [ - 'Mac', - ], - 'link_settings': { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-framework QTKit', + },{ # include_internal_video_capture == 1 + 'conditions': [ + # DEFINE PLATFORM SPECIFIC SOURCE FILES + ['OS=="linux"', { + 'include_dirs': [ + 'Linux', ], - }, - }, - }], - ['OS=="win" and build_with_chromium==0', { - 'include_dirs': [ - 'Windows', - '<(direct_show_base_classes)', - ], - 'defines!': [ - 'NOMINMAX', - ], - 'sources': [ - 'Windows/help_functions_windows.h', - 'Windows/sink_filter_windows.h', - 'Windows/video_capture_windows.h', - 'Windows/device_info_windows.h', - 'Windows/capture_delay_values_windows.h', - 'Windows/help_functions_windows.cc', - 'Windows/sink_filter_windows.cc', - 'Windows/video_capture_windows.cc', - 'Windows/device_info_windows.cc', - 'Windows/video_capture_factory_windows.cc', - '<(direct_show_base_classes)amextra.cpp', - '<(direct_show_base_classes)amextra.h', - '<(direct_show_base_classes)amfilter.cpp', - '<(direct_show_base_classes)amfilter.h', - '<(direct_show_base_classes)amvideo.cpp', - '<(direct_show_base_classes)arithutil.cpp', - '<(direct_show_base_classes)cache.h', - '<(direct_show_base_classes)checkbmi.h', - '<(direct_show_base_classes)combase.cpp', - '<(direct_show_base_classes)combase.h', - '<(direct_show_base_classes)cprop.cpp', - '<(direct_show_base_classes)cprop.h', - '<(direct_show_base_classes)ctlutil.cpp', - '<(direct_show_base_classes)ctlutil.h', - '<(direct_show_base_classes)ddmm.cpp', - '<(direct_show_base_classes)ddmm.h', - '<(direct_show_base_classes)dllentry.cpp', - '<(direct_show_base_classes)dllsetup.cpp', - '<(direct_show_base_classes)dllsetup.h', - '<(direct_show_base_classes)dxmperf.h', - '<(direct_show_base_classes)fourcc.h', - '<(direct_show_base_classes)measure.h', - '<(direct_show_base_classes)msgthrd.h', - '<(direct_show_base_classes)mtype.cpp', - '<(direct_show_base_classes)mtype.h', - '<(direct_show_base_classes)outputq.cpp', - '<(direct_show_base_classes)outputq.h', - '<(direct_show_base_classes)perflog.cpp', - '<(direct_show_base_classes)perflog.h', - '<(direct_show_base_classes)perfstruct.h', - '<(direct_show_base_classes)pstream.cpp', - '<(direct_show_base_classes)pstream.h', - '<(direct_show_base_classes)pullpin.cpp', - '<(direct_show_base_classes)pullpin.h', - '<(direct_show_base_classes)refclock.cpp', - '<(direct_show_base_classes)refclock.h', - '<(direct_show_base_classes)reftime.h', - '<(direct_show_base_classes)renbase.cpp', - '<(direct_show_base_classes)renbase.h', - '<(direct_show_base_classes)schedule.cpp', - '<(direct_show_base_classes)schedule.h', - '<(direct_show_base_classes)seekpt.cpp', - '<(direct_show_base_classes)seekpt.h', - '<(direct_show_base_classes)source.cpp', - '<(direct_show_base_classes)source.h', - '<(direct_show_base_classes)streams.h', - '<(direct_show_base_classes)strmctl.cpp', - '<(direct_show_base_classes)strmctl.h', - '<(direct_show_base_classes)sysclock.cpp', - '<(direct_show_base_classes)sysclock.h', - '<(direct_show_base_classes)transfrm.cpp', - '<(direct_show_base_classes)transfrm.h', - '<(direct_show_base_classes)transip.cpp', - '<(direct_show_base_classes)transip.h', - '<(direct_show_base_classes)videoctl.cpp', - '<(direct_show_base_classes)videoctl.h', - '<(direct_show_base_classes)vtrans.cpp', - '<(direct_show_base_classes)vtrans.h', - '<(direct_show_base_classes)winctrl.cpp', - '<(direct_show_base_classes)winctrl.h', - '<(direct_show_base_classes)winutil.cpp', - '<(direct_show_base_classes)winutil.h', - '<(direct_show_base_classes)wxdebug.cpp', - '<(direct_show_base_classes)wxdebug.h', - '<(direct_show_base_classes)wxlist.cpp', - '<(direct_show_base_classes)wxlist.h', - '<(direct_show_base_classes)wxutil.cpp', - '<(direct_show_base_classes)wxutil.h', - ], - 'msvs_settings': { - 'VCLibrarianTool': { - 'AdditionalDependencies': 'Strmiids.lib', - }, - }, - }], + 'sources': [ + 'Linux/device_info_linux.h', + 'Linux/video_capture_linux.h', + 'Linux/device_info_linux.cc', + 'Linux/video_capture_linux.cc', + ], + }], # linux + ['OS=="mac"', { + 'sources': [ + 'Mac/QTKit/video_capture_recursive_lock.h', + 'Mac/QTKit/video_capture_qtkit.h', + 'Mac/QTKit/video_capture_qtkit_info.h', + 'Mac/QTKit/video_capture_qtkit_info_objc.h', + 'Mac/QTKit/video_capture_qtkit_objc.h', + 'Mac/QTKit/video_capture_qtkit_utility.h', + 'Mac/video_capture_mac.mm', + 'Mac/QTKit/video_capture_qtkit.mm', + 'Mac/QTKit/video_capture_qtkit_objc.mm', + 'Mac/QTKit/video_capture_recursive_lock.mm', + 'Mac/QTKit/video_capture_qtkit_info.mm', + 'Mac/QTKit/video_capture_qtkit_info_objc.mm', + ], + 'include_dirs': [ + 'Mac', + ], + 'link_settings': { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-framework QTKit', + ], + }, + }, + }], # mac + ['OS=="win"', { + 'include_dirs': [ + 'Windows', + '<(direct_show_base_classes)', + ], + 'defines!': [ + 'NOMINMAX', + ], + 'sources': [ + 'Windows/help_functions_windows.h', + 'Windows/sink_filter_windows.h', + 'Windows/video_capture_windows.h', + 'Windows/device_info_windows.h', + 'Windows/capture_delay_values_windows.h', + 'Windows/help_functions_windows.cc', + 'Windows/sink_filter_windows.cc', + 'Windows/video_capture_windows.cc', + 'Windows/device_info_windows.cc', + 'Windows/video_capture_factory_windows.cc', + '<(direct_show_base_classes)amextra.cpp', + '<(direct_show_base_classes)amextra.h', + '<(direct_show_base_classes)amfilter.cpp', + '<(direct_show_base_classes)amfilter.h', + '<(direct_show_base_classes)amvideo.cpp', + '<(direct_show_base_classes)arithutil.cpp', + '<(direct_show_base_classes)cache.h', + '<(direct_show_base_classes)checkbmi.h', + '<(direct_show_base_classes)combase.cpp', + '<(direct_show_base_classes)combase.h', + '<(direct_show_base_classes)cprop.cpp', + '<(direct_show_base_classes)cprop.h', + '<(direct_show_base_classes)ctlutil.cpp', + '<(direct_show_base_classes)ctlutil.h', + '<(direct_show_base_classes)ddmm.cpp', + '<(direct_show_base_classes)ddmm.h', + '<(direct_show_base_classes)dllentry.cpp', + '<(direct_show_base_classes)dllsetup.cpp', + '<(direct_show_base_classes)dllsetup.h', + '<(direct_show_base_classes)dxmperf.h', + '<(direct_show_base_classes)fourcc.h', + '<(direct_show_base_classes)measure.h', + '<(direct_show_base_classes)msgthrd.h', + '<(direct_show_base_classes)mtype.cpp', + '<(direct_show_base_classes)mtype.h', + '<(direct_show_base_classes)outputq.cpp', + '<(direct_show_base_classes)outputq.h', + '<(direct_show_base_classes)perflog.cpp', + '<(direct_show_base_classes)perflog.h', + '<(direct_show_base_classes)perfstruct.h', + '<(direct_show_base_classes)pstream.cpp', + '<(direct_show_base_classes)pstream.h', + '<(direct_show_base_classes)pullpin.cpp', + '<(direct_show_base_classes)pullpin.h', + '<(direct_show_base_classes)refclock.cpp', + '<(direct_show_base_classes)refclock.h', + '<(direct_show_base_classes)reftime.h', + '<(direct_show_base_classes)renbase.cpp', + '<(direct_show_base_classes)renbase.h', + '<(direct_show_base_classes)schedule.cpp', + '<(direct_show_base_classes)schedule.h', + '<(direct_show_base_classes)seekpt.cpp', + '<(direct_show_base_classes)seekpt.h', + '<(direct_show_base_classes)source.cpp', + '<(direct_show_base_classes)source.h', + '<(direct_show_base_classes)streams.h', + '<(direct_show_base_classes)strmctl.cpp', + '<(direct_show_base_classes)strmctl.h', + '<(direct_show_base_classes)sysclock.cpp', + '<(direct_show_base_classes)sysclock.h', + '<(direct_show_base_classes)transfrm.cpp', + '<(direct_show_base_classes)transfrm.h', + '<(direct_show_base_classes)transip.cpp', + '<(direct_show_base_classes)transip.h', + '<(direct_show_base_classes)videoctl.cpp', + '<(direct_show_base_classes)videoctl.h', + '<(direct_show_base_classes)vtrans.cpp', + '<(direct_show_base_classes)vtrans.h', + '<(direct_show_base_classes)winctrl.cpp', + '<(direct_show_base_classes)winctrl.h', + '<(direct_show_base_classes)winutil.cpp', + '<(direct_show_base_classes)winutil.h', + '<(direct_show_base_classes)wxdebug.cpp', + '<(direct_show_base_classes)wxdebug.h', + '<(direct_show_base_classes)wxlist.cpp', + '<(direct_show_base_classes)wxlist.h', + '<(direct_show_base_classes)wxutil.cpp', + '<(direct_show_base_classes)wxutil.h', + ], + 'msvs_settings': { + 'VCLibrarianTool': { + 'AdditionalDependencies': 'Strmiids.lib', + }, + }, + }], # win + ], # conditions + }], # include_internal_video_capture ], # conditions - }, ], # Exclude the test targets when building with chromium. diff --git a/src/modules/video_capture/main/test/testAPI/testAPI.cpp b/src/modules/video_capture/main/test/testAPI/testAPI.cpp index 12b8e7e6d7..c784abf14d 100644 --- a/src/modules/video_capture/main/test/testAPI/testAPI.cpp +++ b/src/modules/video_capture/main/test/testAPI/testAPI.cpp @@ -36,10 +36,8 @@ using namespace std; #include #include "testExternalCapture.h" -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER #include "testPlatformDependent.h" #include "testCameraEncoder.h" -#endif #if defined(_WIN32) int _tmain(int argc, _TCHAR* argv[]) @@ -62,7 +60,6 @@ int main (int argc, const char * argv[]) printf("\nExternal capture test result %d\n",testResult); } -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER { webrtc::testPlatformDependent platformDependent; testResult=platformDependent.DoTest(); @@ -74,7 +71,6 @@ int main (int argc, const char * argv[]) printf("\nCamera encoder test result %d\n",testResult); } -#endif getchar(); diff --git a/src/modules/video_render/main/source/video_render.gypi b/src/modules/video_render/main/source/video_render.gypi index 5d0f07dea3..2a154ded0e 100644 --- a/src/modules/video_render/main/source/video_render.gypi +++ b/src/modules/video_render/main/source/video_render.gypi @@ -82,7 +82,12 @@ # TODO(andrew): with the proper suffix, these files will be excluded # automatically. 'conditions': [ - ['OS!="linux" or build_with_chromium==1', { + ['include_internal_video_render==1', { + 'defines': [ + 'WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER', + ], + }], + ['OS!="linux" or include_internal_video_render==0', { 'sources!': [ 'linux/video_render_linux_impl.h', 'linux/video_x11_channel.h', @@ -92,7 +97,7 @@ 'linux/video_x11_render.cc', ], }], - ['OS!="mac" or build_with_chromium==1', { + ['OS!="mac" or include_internal_video_render==0', { 'sources!': [ 'mac/cocoa_full_screen_window.h', 'mac/cocoa_render_view.h', @@ -108,7 +113,7 @@ 'mac/cocoa_full_screen_window.mm', ], }], - ['OS!="win" or build_with_chromium==1', { + ['OS!="win" or include_internal_video_render==0', { 'sources!': [ 'windows/i_video_render_win.h', 'windows/video_render_direct3d9.h', @@ -125,6 +130,11 @@ # Exclude the test target when building with chromium. 'conditions': [ + ['include_internal_video_render==1', { + 'defines': [ + 'WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER', + ], + }], ['build_with_chromium==0', { 'targets': [ { diff --git a/src/modules/video_render/main/source/video_render_impl.cc b/src/modules/video_render/main/source/video_render_impl.cc index 5d27a73153..748ea876f4 100644 --- a/src/modules/video_render/main/source/video_render_impl.cc +++ b/src/modules/video_render/main/source/video_render_impl.cc @@ -18,7 +18,7 @@ #include -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER #if defined (_WIN32) #include "windows/video_render_windows_impl.h" @@ -53,7 +53,7 @@ //Other platforms #endif -#endif // WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#endif // WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER // For external rendering #include "external/video_render_external_impl.h" @@ -120,7 +120,7 @@ ModuleVideoRenderImpl::ModuleVideoRenderImpl( // Create platform specific renderer switch (videoRenderType) { -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER #if defined(_WIN32) case kRenderWindows: @@ -210,7 +210,7 @@ ModuleVideoRenderImpl::ModuleVideoRenderImpl( // Other platforms #endif -#endif // WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#endif // WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER case kRenderExternal: { VideoRenderExternalImpl* ptrRenderer(NULL); @@ -264,7 +264,7 @@ ModuleVideoRenderImpl::~ModuleVideoRenderImpl() delete ptrRenderer; } break; -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER #if defined(_WIN32) case kRenderWindows: @@ -319,7 +319,7 @@ ModuleVideoRenderImpl::~ModuleVideoRenderImpl() //other platforms #endif -#endif // WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#endif // WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER default: // Error... @@ -397,7 +397,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) WEBRTC_TRACE(kTraceModuleCall, kTraceVideoRenderer, _id, "%s", __FUNCTION__); -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#ifdef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER #if defined(MAC_IPHONE) // MAC_IPHONE must go before WEBRTC_MAC or WEBRTC_MAC_INTEL _ptrRenderer = NULL; @@ -442,7 +442,7 @@ WebRtc_Word32 ModuleVideoRenderImpl::ChangeWindow(void* window) #endif -#else // WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER +#else // WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER return -1; #endif } diff --git a/src/modules/video_render/main/test/testAPI/testAPI.cpp b/src/modules/video_render/main/test/testAPI/testAPI.cpp index cf56565258..5309b8f589 100644 --- a/src/modules/video_render/main/test/testAPI/testAPI.cpp +++ b/src/modules/video_render/main/test/testAPI/testAPI.cpp @@ -362,7 +362,7 @@ int TestSingleStream(VideoRender* renderModule) { VideoRenderCallback* renderCallback0 = renderModule->AddIncomingRenderStream(streamId0, 0, 0.0f, 0.0f, 1.0f, 1.0f); assert(renderCallback0 != NULL); -#if defined (WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER) +#ifndef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER MyRenderCallback externalRender; renderModule->AddExternalRenderCallback(streamId0, &externalRender); #endif @@ -407,8 +407,6 @@ int TestSingleStream(VideoRender* renderModule) { int TestFullscreenStream(VideoRender* &renderModule, void* window, const VideoRenderType videoRenderType) { - int error = 0; - VideoRender::DestroyVideoRender(renderModule); renderModule = VideoRender::CreateVideoRender(12345, window, true, videoRenderType); @@ -492,7 +490,6 @@ int TestBitmapText(VideoRender* renderModule) { } int TestMultipleStreams(VideoRender* renderModule) { - int error = 0; // Add settings for a stream to render printf("Add stream 0\n"); const int streamId0 = 0; @@ -665,7 +662,7 @@ int main (int argc, const char * argv[]) window = (void*)testWindow; #endif -#if defined (WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER) +#ifndef WEBRTC_INCLUDE_INTERNAL_VIDEO_RENDER windowType = kRenderExternal; #endif diff --git a/src/video_engine/main/source/vie_capturer.cc b/src/video_engine/main/source/vie_capturer.cc index adf52fe733..ffe8f0f34c 100644 --- a/src/video_engine/main/source/vie_capturer.cc +++ b/src/video_engine/main/source/vie_capturer.cc @@ -204,7 +204,6 @@ WebRtc_Word32 ViECapturer::Init(const WebRtc_UWord8* deviceUniqueIdUTF8, const WebRtc_UWord32 deviceUniqueIdUTF8Length) { assert(_captureModule == NULL); -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER if (deviceUniqueIdUTF8 == NULL) { _captureModule = VideoCaptureFactory::Create( @@ -214,7 +213,6 @@ WebRtc_Word32 ViECapturer::Init(const WebRtc_UWord8* deviceUniqueIdUTF8, _captureModule = VideoCaptureFactory::Create( ViEModuleId(_engineId, _captureId), deviceUniqueIdUTF8); } -#endif if (!_captureModule) return -1; _captureModule->AddRef(); diff --git a/src/video_engine/main/source/vie_input_manager.cc b/src/video_engine/main/source/vie_input_manager.cc index ebe239bd5e..8e3e3b4955 100644 --- a/src/video_engine/main/source/vie_input_manager.cc +++ b/src/video_engine/main/source/vie_input_manager.cc @@ -54,13 +54,9 @@ ViEInputManager::ViEInputManager(const int engineId) { _freeCaptureDeviceId[idx] = true; } -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - _ptrCaptureDeviceInfo=NULL; -#else _ptrCaptureDeviceInfo = VideoCaptureFactory::CreateDeviceInfo( ViEModuleId(_engineId)); -#endif for (int idx = 0; idx < kViEMaxFilePlayers; idx++) { _freeFileId[idx] = true; @@ -87,13 +83,11 @@ ViEInputManager::~ViEInputManager() } delete &_mapCritsect; -#ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER if (_ptrCaptureDeviceInfo) { delete _ptrCaptureDeviceInfo; _ptrCaptureDeviceInfo = NULL; } -#endif } // ---------------------------------------------------------------------------- @@ -116,9 +110,6 @@ int ViEInputManager::NumberOfCaptureDevices() { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId), "%s", __FUNCTION__); -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - return 0; -#endif assert(_ptrCaptureDeviceInfo); return _ptrCaptureDeviceInfo->NumberOfDevices(); } @@ -135,9 +126,6 @@ int ViEInputManager::GetDeviceName(WebRtc_UWord32 deviceNumber, { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId), "%s(deviceNumber: %d)", __FUNCTION__, deviceNumber); -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - return 0; -#endif assert(_ptrCaptureDeviceInfo); return _ptrCaptureDeviceInfo->GetDeviceName(deviceNumber, deviceNameUTF8, deviceNameLength, @@ -154,9 +142,6 @@ int ViEInputManager::GetDeviceName(WebRtc_UWord32 deviceNumber, int ViEInputManager::NumberOfCaptureCapabilities( const WebRtc_UWord8* deviceUniqueIdUTF8) { -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - return 0; -#endif WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId), "%s", __FUNCTION__); assert(_ptrCaptureDeviceInfo); @@ -174,14 +159,14 @@ int ViEInputManager::GetCaptureCapability(const WebRtc_UWord8* deviceUniqueIdUTF WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId), "%s(deviceUniqueIdUTF8: %s, deviceCapabilityNumber: %d)", __FUNCTION__, deviceUniqueIdUTF8, deviceCapabilityNumber); -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - return -1; -#endif assert(_ptrCaptureDeviceInfo); VideoCaptureCapability moduleCapability; int result = _ptrCaptureDeviceInfo->GetCapability(deviceUniqueIdUTF8, deviceCapabilityNumber, moduleCapability); + if (result != 0) + return result; + // Copy from module type to public type capability.expectedCaptureDelay = moduleCapability.expectedCaptureDelay; capability.height = moduleCapability.height; @@ -198,9 +183,6 @@ int ViEInputManager::GetOrientation(const WebRtc_UWord8* deviceUniqueIdUTF8, { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId), "%s(deviceUniqueIdUTF8: %s,)", __FUNCTION__, deviceUniqueIdUTF8); -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - return -1; -#endif assert(_ptrCaptureDeviceInfo); VideoCaptureRotation moduleOrientation; int result = _ptrCaptureDeviceInfo->GetOrientation(deviceUniqueIdUTF8, @@ -239,9 +221,6 @@ int ViEInputManager::DisplayCaptureSettingsDialogBox( WebRtc_UWord32 positionX, WebRtc_UWord32 positionY) { -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - return -1; -#endif assert(_ptrCaptureDeviceInfo); return _ptrCaptureDeviceInfo->DisplayCaptureSettingsDialogBox( deviceUniqueIdUTF8, @@ -263,12 +242,6 @@ int ViEInputManager::CreateCaptureDevice(const WebRtc_UWord8* deviceUniqueIdUTF8 { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId), "%s(deviceUniqueId: %s)", __FUNCTION__, deviceUniqueIdUTF8); -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_engineId), - "%s(deviceUniqueId: Only external capture modules can be used.) " - , __FUNCTION__); - return -1; -#endif CriticalSectionScoped cs(_mapCritsect); // Make sure the device is not already allocated @@ -455,12 +428,6 @@ int ViEInputManager::CreateExternalCaptureDevice(ViEExternalCapture*& externalCa { WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideo, ViEId(_engineId), "%s", __FUNCTION__); -#ifdef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER - WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_engineId), - "%s(deviceUniqueId: Only external capture modules can be used.) " - , __FUNCTION__); - return -1; -#endif CriticalSectionScoped cs(_mapCritsect); int newcaptureId = 0; diff --git a/src/video_engine/main/source/vie_render_manager.cc b/src/video_engine/main/source/vie_render_manager.cc index 3d82c4e1e2..5e78b47807 100644 --- a/src/video_engine/main/source/vie_render_manager.cc +++ b/src/video_engine/main/source/vie_render_manager.cc @@ -173,11 +173,7 @@ ViERenderer* ViERenderManager::AddRenderStream(const WebRtc_Word32 renderId, if (ptrRenderer == NULL) { // No render module for this window, create a new one - #ifndef WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER ptrRenderer = VideoRender::CreateVideoRender(ViEModuleId(_engineId, -1), window, false); - #else - ptrRenderer = VideoRender::CreateVideoRender(ViEModuleId(_engineId, -1), window, false, kRenderExternal); - #endif //WEBRTC_VIDEO_EXTERNAL_CAPTURE_AND_RENDER if (!ptrRenderer) { WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo, ViEId(_engineId), "Could not create new render module");