[openrtm-commit:01337] r113 - in branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam: . cmake doc idl include/DirectShowCam src
openrtm @ openrtm.org
openrtm @ openrtm.org
2014年 3月 13日 (木) 14:52:03 JST
Author: kawauchi
Date: 2014-03-13 14:52:03 +0900 (Thu, 13 Mar 2014)
New Revision: 113
Removed:
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml20130607161557
Modified:
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/README.DirectShowCam
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/CMakeLists.txt
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/cpack_options.cmake.in
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/wix.xsl.in
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/doc/CMakeLists.txt
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/idl/CMakeLists.txt
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/CMakeLists.txt
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/DirectShowCam.h
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/CMakeLists.txt
branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/DirectShowCam.cpp
Log:
DirectShowCam : Adjusted cmake files for the package, fixed RTC.xml and delete unnecessary file. refs #2704
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/CMakeLists.txt 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,111 +1,124 @@
-cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
+cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_policy(SET CMP0002 OLD)
-
-project(DirectShowCam)
+
+project(DirectShowCam)
SUBDIRS(BaseClasses)
-string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
-include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
+string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
+include("${PROJECT_SOURCE_DIR}/cmake/utils.cmake")
+set(PROJECT_VERSION 1.1.0 CACHE STRING "DirectShowCam version")
+DISSECT_VERSION()
+set(PROJECT_DESCRIPTION "DirectShowCam Module")
+set(PROJECT_VENDOR "AIST")
+set(PROJECT_AUTHOR "AIST")
+set(PROJECT_AUTHOR_SHORT "AIST")
+
+set(LINUX_PACKAGE_GENERATOR "DEB")
+#set(LINUX_PACKAGE_GENERATOR "RPM")
+set(PROJECT_MAINTAINER "Noriaki Ando <n-ando at aist.go.jp>")
+set(PROJECT_TYPE "c++/opencv-rtcs")
-set(PROJECT_VERSION 1.0.0 CACHE STRING "DirectShowCam version")
-DISSECT_VERSION()
-set(PROJECT_DESCRIPTION "DirectShowCam Module")
-set(PROJECT_VENDOR "AIST")
-set(PROJECT_AUTHOR "AIST")
-set(PROJECT_AUTHOR_SHORT "AIST")
-
-# Add an "uninstall" target
-CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
- "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
+# Add an "uninstall" target
+CONFIGURE_FILE ("${PROJECT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
+ "${PROJECT_BINARY_DIR}/uninstall_target.cmake" IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET (${PROJECT_NAME}_uninstall "${CMAKE_COMMAND}" -P
- "${PROJECT_BINARY_DIR}/uninstall_target.cmake")
+ "${PROJECT_BINARY_DIR}/uninstall_target.cmake")
+
+#option(BUILD_EXAMPLES "Build and install examples" OFF)
+option(BUILD_DOCUMENTATION "Build the documentation" OFF)
+#option(BUILD_TESTS "Build the tests" OFF)
+#option(BUILD_TOOLS "Build the tools" OFF)
+option(BUILD_IDL "Build and install idl" ON)
+option(BUILD_SOURCES "Build and install sources" OFF)
+
+option(STATIC_LIBS "Build static libraries" OFF)
+if(STATIC_LIBS)
+ set(LIB_TYPE STATIC)
+else(STATIC_LIBS)
+ set(LIB_TYPE SHARED)
+endif(STATIC_LIBS)
+
+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ # Mac OS X specific code
+ SET(CMAKE_CXX_COMPILER "g++")
+endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+
+
+# Set up installation directories
+if(WIN32)
+# set(BIN_INSTALL_DIR "components/bin")
+# set(LIB_INSTALL_DIR "components/lib")
+ set(INSTALL_PREFIX "components/${PROJECT_TYPE}")
+else(WIN32)
+ set(OPENRTM_SHARE_PREFIX "share/openrtm-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
+ set(INSTALL_PREFIX "${OPENRTM_SHARE_PREFIX}/components/${PROJECT_TYPE}")
+endif(WIN32)
-#option(BUILD_EXAMPLES "Build and install examples" OFF)
-option(BUILD_DOCUMENTATION "Build the documentation" ON)
-#option(BUILD_TESTS "Build the tests" OFF)
-#option(BUILD_TOOLS "Build the tools" OFF)
-option(BUILD_IDL "Build and install idl" ON)
-option(BUILD_SOURCES "Build and install sources" OFF)
-
-option(STATIC_LIBS "Build static libraries" OFF)
-if(STATIC_LIBS)
- set(LIB_TYPE STATIC)
-else(STATIC_LIBS)
- set(LIB_TYPE SHARED)
-endif(STATIC_LIBS)
-
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- # Mac OS X specific code
- SET(CMAKE_CXX_COMPILER "g++")
-endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-
-
-# Set up installation directories
-set(BIN_INSTALL_DIR "components/bin")
-set(LIB_INSTALL_DIR "components/lib")
-set(INC_INSTALL_DIR
- "components/include/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
-set(SHARE_INSTALL_DIR
- "components/share/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
-
-# Get necessary dependency information
-find_package(OpenRTM)
-if(${OpenRTM_FOUND})
- MESSAGE(STATUS "OpenRTM configuration Found")
-else(${OpenRTM_FOUND})
- message(STATUS "Use cmake/Modules/FindOpenRTM.cmake in the project")
- list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
- find_package(OpenRTM REQUIRED)
-endif(${OpenRTM_FOUND})
-
-# Universal settings
-#enable_testing()
-
-# Subdirectories
-add_subdirectory(cmake)
-if(BUILD_DOCUMENTATION)
- add_subdirectory(doc)
-endif(BUILD_DOCUMENTATION)
-
-#if(BUILD_EXAMPLES)
-# add_subdirectory(examples)
-#endif(BUILD_EXAMPLES)
-
-if(BUILD_IDL)
- add_subdirectory(idl)
-endif(BUILD_IDL)
-
-add_subdirectory(include)
-MAP_ADD_STR(headers "include/" comp_hdrs)
-add_subdirectory(src)
-
-#if(BUILD_TESTS)
-# add_subdirectory(test)
-#endif(BUILD_TESTS)
-
-#if(BUILD_TOOLS)
-# add_subdirectory(tools)
-#endif(BUILD_TOOLS)
-
-if(BUILD_SOURCES)
- add_subdirectory(include)
- add_subdirectory(src)
-endif(BUILD_SOURCES)
-
-# Package creation
-# By default, do not warn when built on machines using only VS Express:
-IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
-SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
-ENDIF()
-include(InstallRequiredSystemLibraries)
-set(PROJECT_EXECUTABLES ${PROJECT_NAME_LOWER}Comp
- "${PROJECT_NAME_LOWER}Comp")
-
-set(cpack_options "${PROJECT_BINARY_DIR}/cpack_options.cmake")
-
-configure_file("${PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in"
- ${cpack_options} @ONLY)
-
-set(CPACK_PROJECT_CONFIG_FILE ${cpack_options})
-include(${CPACK_PROJECT_CONFIG_FILE})
-include(CPack)
+#set(INC_INSTALL_DIR
+# "components/include/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
+#set(SHARE_INSTALL_DIR
+# "components/share/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}")
+
+# Get necessary dependency information
+find_package(OpenRTM)
+if(${OpenRTM_FOUND})
+ MESSAGE(STATUS "OpenRTM configuration Found")
+else(${OpenRTM_FOUND})
+ message(STATUS "Use cmake/Modules/FindOpenRTM.cmake in the project")
+ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
+ find_package(OpenRTM REQUIRED)
+endif(${OpenRTM_FOUND})
+
+# Universal settings
+#enable_testing()
+
+# Subdirectories
+add_subdirectory(cmake)
+if(BUILD_DOCUMENTATION)
+ add_subdirectory(doc)
+endif(BUILD_DOCUMENTATION)
+
+#if(BUILD_EXAMPLES)
+# add_subdirectory(examples)
+#endif(BUILD_EXAMPLES)
+
+if(BUILD_IDL)
+ add_subdirectory(idl)
+endif(BUILD_IDL)
+
+add_subdirectory(include)
+MAP_ADD_STR(headers "include/" comp_hdrs)
+add_subdirectory(src)
+
+#if(BUILD_TESTS)
+# add_subdirectory(test)
+#endif(BUILD_TESTS)
+
+#if(BUILD_TOOLS)
+# add_subdirectory(tools)
+#endif(BUILD_TOOLS)
+
+if(BUILD_SOURCES)
+ add_subdirectory(include)
+ add_subdirectory(src)
+endif(BUILD_SOURCES)
+
+# Package creation
+# By default, do not warn when built on machines using only VS Express:
+IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+ENDIF()
+include(InstallRequiredSystemLibraries)
+set(PROJECT_EXECUTABLES ${PROJECT_NAME_LOWER}Comp
+ "${PROJECT_NAME_LOWER}Comp")
+
+set(cpack_options "${PROJECT_BINARY_DIR}/cpack_options.cmake")
+
+configure_file("${PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in"
+ ${cpack_options} @ONLY)
+
+set(CPACK_PROJECT_CONFIG_FILE ${cpack_options})
+include(${CPACK_PROJECT_CONFIG_FILE})
+include(CPack)
+
+
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/README.DirectShowCam
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/README.DirectShowCam 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/README.DirectShowCam 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,116 +1,116 @@
-======================================================================
- RTComponent: DirectShowCam specificatioin
-
- OpenRTM-aist-1.0.0
- Date: $Date$
-
- This file is generated by rtc-template with the following argments.
-
-# rtc-template -bcxx --module-name=DirectShowCam
-# --module-desc='DirectShowCam Module' --module-version=1.0.0 --module-vendor=AIST
-# --module-category=Category --module-comp-type=STATIC
-# --module-act-type=PERIODIC --module-max-inst=1
-# --outport=m_FIN_OUTPORT:RTC::CameraImage
-
-
-======================================================================
- Basic Information
-======================================================================
-# <rtc-template block="module">
-Module Name: DirectShowCam
-Description: DirectShowCam Module
-Version: 1.0.0
-Vendor: AIST
-Category: Category
-Kind: DataFlowComponent
-Comp. Type: STATIC
-Act. Type: PERIODIC
-MAX Inst.: 1
-Lang: C++
-Lang Type:
-
-# </rtc-template>
-
-
-======================================================================
- Activity definition
-======================================================================
-
-[on_initialize] implemented
-
-[on_finalize]
-
-[on_startup]
-
-[on_shutdown]
-
-[on_activated] implemented
-
-[on_deactivated] implemented
-
-[on_execute] implemented
-
-[on_aborting]
-
-[on_error]
-
-[on_reset]
-
-[on_state_update]
-
-[on_rate_changed]
-
-======================================================================
- InPorts definition
-======================================================================
-# <rtc-template block="inport">
-
-
-# </rtc-template>
-
-======================================================================
- OutPorts definition
-======================================================================
-# <rtc-template block="outport">
-
- Name: m_FIN_OUTPORT
- PortNumber: 0
- Description:
- PortType:
- DataType: RTC::CameraImage
- MaxOut:
- [Data Elements]
- Name:
- Type:
- Number:
- Semantics:
- Unit:
- Frequency:
- Operation Cycle:
- RangeLow:
- RangeHigh:
- DefaultValue:
-
-
-# </rtc-template>
-
-
-======================================================================
- Service Port definition
-======================================================================
-# <rtc-template block="serviceport">
-# </rtc-template>
-
-======================================================================
- Configuration definition
-======================================================================
-# <rtc-template block="configuration">
-# </rtc-template>
-
-This software is developed at the National Institute of Advanced
-Industrial Science and Technology. Approval number H23PRO-????. This
-software is licensed under the Lesser General Public License. See
-COPYING.LESSER.
-
-This area is reserved for future OpenRTM.
-
+======================================================================
+ RTComponent: DirectShowCam specificatioin
+
+ OpenRTM-aist-1.0.0
+ Date: $Date$
+
+ This file is generated by rtc-template with the following argments.
+
+# rtc-template -bcxx --module-name=DirectShowCam
+# --module-desc='DirectShowCam Module' --module-version=1.1.0 --module-vendor=AIST
+# --module-category=Category --module-comp-type=STATIC
+# --module-act-type=PERIODIC --module-max-inst=1
+# --outport=m_FIN_OUTPORT:RTC::CameraImage
+
+
+======================================================================
+ Basic Information
+======================================================================
+# <rtc-template block="module">
+Module Name: DirectShowCam
+Description: DirectShowCam Module
+Version: 1.1.0
+Vendor: AIST
+Category: Category
+Kind: DataFlowComponent
+Comp. Type: STATIC
+Act. Type: PERIODIC
+MAX Inst.: 1
+Lang: C++
+Lang Type:
+
+# </rtc-template>
+
+
+======================================================================
+ Activity definition
+======================================================================
+
+[on_initialize] implemented
+
+[on_finalize]
+
+[on_startup]
+
+[on_shutdown]
+
+[on_activated] implemented
+
+[on_deactivated] implemented
+
+[on_execute] implemented
+
+[on_aborting]
+
+[on_error]
+
+[on_reset]
+
+[on_state_update]
+
+[on_rate_changed]
+
+======================================================================
+ InPorts definition
+======================================================================
+# <rtc-template block="inport">
+
+
+# </rtc-template>
+
+======================================================================
+ OutPorts definition
+======================================================================
+# <rtc-template block="outport">
+
+ Name: m_FIN_OUTPORT
+ PortNumber: 0
+ Description:
+ PortType:
+ DataType: RTC::CameraImage
+ MaxOut:
+ [Data Elements]
+ Name:
+ Type:
+ Number:
+ Semantics:
+ Unit:
+ Frequency:
+ Operation Cycle:
+ RangeLow:
+ RangeHigh:
+ DefaultValue:
+
+
+# </rtc-template>
+
+
+======================================================================
+ Service Port definition
+======================================================================
+# <rtc-template block="serviceport">
+# </rtc-template>
+
+======================================================================
+ Configuration definition
+======================================================================
+# <rtc-template block="configuration">
+# </rtc-template>
+
+This software is developed at the National Institute of Advanced
+Industrial Science and Technology. Approval number H23PRO-????. This
+software is licensed under the Lesser General Public License. See
+COPYING.LESSER.
+
+This area is reserved for future OpenRTM.
+
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<rtc:RtcProfile rtc:version="0.2" rtc:id="RTC:AIST:Category:DirectShowCam:1.0.0" xmlns:rtcExt="http://www.openrtp.org/namespaces/rtc_ext" xmlns:rtcDoc="http://www.openrtp.org/namespaces/rtc_doc" xmlns:rtc="http://www.openrtp.org/namespaces/rtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <rtc:BasicInfo xsi:type="rtcExt:basic_info_ext" rtcExt:saveProject="DirectShowCam" rtc:updateDate="2013-06-07T16:09:05+09:00" rtc:creationDate="2013-06-07T16:09:05+09:00" rtc:version="1.0.0" rtc:vendor="AIST" rtc:maxInstances="1" rtc:executionType="PeriodicExecutionContext" rtc:executionRate="1000.0" rtc:description="DirectShowCam Module" rtc:category="Category" rtc:componentKind="DataFlowComponent" rtc:activityType="PERIODIC" rtc:componentType="STATIC" rtc:name="DirectShowCam"/>
+<rtc:RtcProfile rtc:version="0.2" rtc:id="RTC:AIST:Category:DirectShowCam:1.1.0" xmlns:rtcExt="http://www.openrtp.org/namespaces/rtc_ext" xmlns:rtcDoc="http://www.openrtp.org/namespaces/rtc_doc" xmlns:rtc="http://www.openrtp.org/namespaces/rtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <rtc:BasicInfo xsi:type="rtcExt:basic_info_ext" rtcExt:saveProject="DirectShowCam" rtc:updateDate="2013-06-07T16:09:05+09:00" rtc:creationDate="2013-06-07T16:09:05+09:00" rtc:version="1.1.0" rtc:vendor="AIST" rtc:maxInstances="1" rtc:executionType="PeriodicExecutionContext" rtc:executionRate="1000.0" rtc:description="DirectShowCam Module" rtc:category="Category" rtc:componentKind="DataFlowComponent" rtc:activityType="PERIODIC" rtc:componentType="STATIC" rtc:name="DirectShowCam"/>
<rtc:Actions>
<rtc:OnInitialize xsi:type="rtcDoc:action_status_doc" rtc:implemented="true"/>
<rtc:OnFinalize xsi:type="rtcDoc:action_status_doc" rtc:implemented="false"/>
Deleted: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml20130607161557
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml20130607161557 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/RTC.xml20130607161557 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<rtc:RtcProfile rtc:version="0.2" rtc:id="RTC:VenderName:Category:ModuleName:1.0.0" xmlns:rtcExt="http://www.openrtp.org/namespaces/rtc_ext" xmlns:rtcDoc="http://www.openrtp.org/namespaces/rtc_doc" xmlns:rtc="http://www.openrtp.org/namespaces/rtc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <rtc:BasicInfo xsi:type="rtcExt:basic_info_ext" rtc:updateDate="2013-06-07T16:09:05+09:00" rtc:creationDate="2013-06-07T16:09:05+09:00" rtc:version="1.0.0" rtc:vendor="VenderName" rtc:maxInstances="1" rtc:executionType="PeriodicExecutionContext" rtc:executionRate="1000.0" rtc:description="ModuleDescription" rtc:category="Category" rtc:componentKind="DataFlowComponent" rtc:activityType="PERIODIC" rtc:componentType="STATIC" rtc:name="ModuleName">
- <rtcDoc:Doc rtcDoc:license="" rtcDoc:creator=""/>
- </rtc:BasicInfo>
- <rtc:Actions/>
-</rtc:RtcProfile>
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/CMakeLists.txt 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/CMakeLists.txt 2014-03-13 05:52:03 UTC (rev 113)
@@ -2,8 +2,8 @@
set(PKG_LIBS -l${PROJECT_NAME_LOWER})
set(pkg_conf_file ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}.pc)
configure_file(${PROJECT_NAME_LOWER}.pc.in ${pkg_conf_file} @ONLY)
-install(FILES ${pkg_conf_file}
- DESTINATION ${LIB_INSTALL_DIR}/pkgconfig/ COMPONENT component)
+#install(FILES ${pkg_conf_file}
+# DESTINATION ${LIB_INSTALL_DIR}/pkgconfig/ COMPONENT component)
# Install CMake modules
set(cmake_config ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake)
@@ -14,5 +14,5 @@
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake.in
${cmake_version_config} @ONLY)
set(cmake_mods ${cmake_config} ${cmake_version_config})
-install(FILES ${cmake_mods} DESTINATION ${SHARE_INSTALL_DIR} COMPONENT library)
+#install(FILES ${cmake_mods} DESTINATION ${SHARE_INSTALL_DIR} COMPONENT library)
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/cpack_options.cmake.in
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/cpack_options.cmake.in 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/cpack_options.cmake.in 2014-03-13 05:52:03 UTC (rev 113)
@@ -68,9 +68,9 @@
#
#
#
- set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
- set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
- set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.bmp")
+# set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
+# set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
+# set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.bmp")
set(CPACK_NSIS_HELP_LINK "http://www.openrtm.org")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.openrtm.org")
set(CPACK_NSIS_MODIFY_PATH ON)
@@ -90,5 +90,9 @@
set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
" Delete \"$INSTDIR\\@PROJECT_NAME_LOWER at -config.cmake\"
Delete \"$INSTDIR\\@PROJECT_NAME_LOWER at -config-version.cmake\"")
+
+ELSE(WIN32)
+ set(CPACK_GENERATOR @LINUX_PACKAGE_GENERATOR@)
+ set(CPACK_PACKAGE_CONTACT @PROJECT_MAINTAINER@)
ENDIF (WIN32)
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/wix.xsl.in
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/wix.xsl.in 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/cmake/wix.xsl.in 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,99 +1,99 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
- <xsl:output indent="yes" method="xml"/>
-
- <xsl:template match="/wix:Wix">
- <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
- <Product xmlns="http://schemas.microsoft.com/wix/2006/wi" Id="A0C7C29C-E049-4EA8-8ED0-AA7EB543E37C" Name="@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@" Language="1041" Codepage="932" Version="@CPACK_PACKAGE_VERSION@" Manufacturer="@CPACK_PACKAGE_VENDOR@" UpgradeCode="C0A073E4-4962-4045-8464-0BDAB36613EE">
- <Package InstallerVersion="300" Compressed="yes" Languages='1041' SummaryCodepage='932' />
- <Media Id="1" Cabinet="@CPACK_PACKAGE_NAME at .cab" EmbedCab="yes" />
- <Directory Id="TARGETDIR" Name="SourceDir" >
- <Directory Id="ProgramFilesFolder" Name="PFILE" >
- <Directory Id="OPENRTM_DIR" Name="OpenRTM-aist" >
- <!-- <Directory Id="INSTALLLOCATION" Name="@OPENRTM_VERSION_MAJOR at .@OPENRTM_VERSION_MINOR@" /> -->
- <Directory Id="INSTALLLOCATION" Name="1.1" />
- </Directory>
- </Directory>
- </Directory>
-
- <Feature Id="APPLICATIONS" Title="@CPACK_COMPONENT_COMPONENT_DISPLAY_NAME@" Level="1" Description="@CPACK_COMPONENT_COMPONENT_DESCRIPTION@" >
- <!-- Start Ripping through the xml -->
- <!--
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\@RTC_NAME at .dll')]" />
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\@RTC_NAME at .lib')]" />
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\@RTC_NAME at Comp.exe')]" />
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\RTC.xml')]" />
- -->
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, translate('\bin\@CPACK_PACKAGE_NAME at .dll','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))]" />
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, translate('\lib\@CPACK_PACKAGE_NAME at .lib','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))]" />
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, translate('\bin\@CPACK_PACKAGE_NAME at Comp.exe','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))]" />
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, 'RTC.xml')]" />
- </Feature>
-
- <Feature Id="DOCUMENTS" Title="@CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME@" Level="1" Absent="allow" Description="@CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION@" >
- <!-- Start Ripping through the xml -->
- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\doc')]" />
- </Feature>
-
- <!-- <Feature Id="SOURCES" Title="@CPACK_COMPONENT_SOURCES_DISPLAY_NAME@" Level="1" Absent="allow" Description="@CPACK_COMPONENT_SOURCES_DESCRIPTION@" >-->
- <!-- Start Ripping through the xml -->
- <!-- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@CPACK_PACKAGE_INSTALL_DIRECTORY@\src')]" /> -->
- <!-- </Feature> -->
-
- <!--Tack on your specific wix options-->
- <UIRef Id="WixUI_FeatureTree" />
- <UIRef Id="WixUI_ErrorProgressText" />
- <!--
- <WixVariable Id="WixUILicenseRtf" Value="@CPACK_RESOURCE_FILE_LICENSE@"/>
- -->
- <!-- TODO: Add Wix Specific Dialogs and features. -->
- <!-- TODO: Add artwork -->
- <!-- TODO: Add ... -->
-
- </Product>
-
- <!--Output the fragment info which heat generates-->
- <xsl:copy-of select="wix:Fragment[wix:DirectoryRef/wix:Component]" />
- <xsl:apply-templates select="wix:Fragment[wix:DirectoryRef/@Id!='TARGETDIR' and wix:DirectoryRef/wix:Directory]" />
-
- </Wix>
- </xsl:template>
-
- <xsl:template match="wix:Fragment[wix:DirectoryRef/wix:Directory]" >
- <xsl:copy>
- <xsl:apply-templates select="wix:DirectoryRef" />
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="wix:DirectoryRef" >
- <xsl:copy>
- <xsl:choose>
- <xsl:when test="wix:Directory[@Name='components']" >
- <xsl:attribute name="Id">INSTALLLOCATION</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="Id"><xsl:value-of select="@Id" /></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates />
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="wix:Directory" >
- <xsl:copy>
- <xsl:attribute name="Id"><xsl:value-of select="@Id" /></xsl:attribute>
- <xsl:attribute name="Name"><xsl:value-of select="@Name" /></xsl:attribute>
- </xsl:copy>
- </xsl:template>
-
- <xsl:template match="wix:Component">
- <xsl:element name="ComponentRef" xmlns="http://schemas.microsoft.com/wix/2006/wi" >
- <xsl:attribute name="Id">
- <xsl:value-of select="@Id" />
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:wix="http://schemas.microsoft.com/wix/2006/wi">
+ <xsl:output indent="yes" method="xml"/>
+
+ <xsl:template match="/wix:Wix">
+ <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product xmlns="http://schemas.microsoft.com/wix/2006/wi" Id="69252465-3C44-4318-894F-3FC88CBE0FB8" Name="@CPACK_PACKAGE_NAME@ @CPACK_PACKAGE_VERSION@" Language="1041" Codepage="932" Version="@CPACK_PACKAGE_VERSION@" Manufacturer="@CPACK_PACKAGE_VENDOR@" UpgradeCode="50891045-2ADB-480B-A62D-3ED5B0C3F77C">
+ <Package InstallerVersion="300" Compressed="yes" Languages='1041' SummaryCodepage='932' />
+ <Media Id="1" Cabinet="@CPACK_PACKAGE_NAME at .cab" EmbedCab="yes" />
+ <Directory Id="TARGETDIR" Name="SourceDir" >
+ <Directory Id="ProgramFilesFolder" Name="PFILE" >
+ <Directory Id="OPENRTM_DIR" Name="OpenRTM-aist" >
+ <!-- <Directory Id="INSTALLLOCATION" Name="@OPENRTM_VERSION_MAJOR at .@OPENRTM_VERSION_MINOR@" /> -->
+ <Directory Id="INSTALLLOCATION" Name="1.1" />
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <Feature Id="APPLICATIONS" Title="@CPACK_COMPONENT_COMPONENT_DISPLAY_NAME@" Level="1" Description="@CPACK_COMPONENT_COMPONENT_DESCRIPTION@" >
+ <!-- Start Ripping through the xml -->
+ <!--
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\@RTC_NAME at .dll')]" />
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\@RTC_NAME at .lib')]" />
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\@RTC_NAME at Comp.exe')]" />
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\RTC.xml')]" />
+ -->
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, translate('\bin\@CPACK_PACKAGE_NAME at .dll','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))]" />
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, translate('\lib\@CPACK_PACKAGE_NAME at .lib','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))]" />
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, translate('\bin\@CPACK_PACKAGE_NAME at Comp.exe','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'))]" />
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, 'RTC.xml')]" />
+ </Feature>
+
+ <Feature Id="DOCUMENTS" Title="@CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME@" Level="1" Absent="allow" Description="@CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION@" >
+ <!-- Start Ripping through the xml -->
+ <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@PACKAGE_NAME@@PACKAGE_VERSION@\doc')]" />
+ </Feature>
+
+ <!-- <Feature Id="SOURCES" Title="@CPACK_COMPONENT_SOURCES_DISPLAY_NAME@" Level="1" Absent="allow" Description="@CPACK_COMPONENT_SOURCES_DESCRIPTION@" >-->
+ <!-- Start Ripping through the xml -->
+ <!-- <xsl:apply-templates select="wix:Fragment/wix:DirectoryRef/wix:Component[contains(wix:File/@Source, '@CPACK_PACKAGE_INSTALL_DIRECTORY@\src')]" /> -->
+ <!-- </Feature> -->
+
+ <!--Tack on your specific wix options-->
+ <UIRef Id="WixUI_FeatureTree" />
+ <UIRef Id="WixUI_ErrorProgressText" />
+ <!--
+ <WixVariable Id="WixUILicenseRtf" Value="@CPACK_RESOURCE_FILE_LICENSE@"/>
+ -->
+ <!-- TODO: Add Wix Specific Dialogs and features. -->
+ <!-- TODO: Add artwork -->
+ <!-- TODO: Add ... -->
+
+ </Product>
+
+ <!--Output the fragment info which heat generates-->
+ <xsl:copy-of select="wix:Fragment[wix:DirectoryRef/wix:Component]" />
+ <xsl:apply-templates select="wix:Fragment[wix:DirectoryRef/@Id!='TARGETDIR' and wix:DirectoryRef/wix:Directory]" />
+
+ </Wix>
+ </xsl:template>
+
+ <xsl:template match="wix:Fragment[wix:DirectoryRef/wix:Directory]" >
+ <xsl:copy>
+ <xsl:apply-templates select="wix:DirectoryRef" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="wix:DirectoryRef" >
+ <xsl:copy>
+ <xsl:choose>
+ <xsl:when test="wix:Directory[@Name='components']" >
+ <xsl:attribute name="Id">INSTALLLOCATION</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="Id"><xsl:value-of select="@Id" /></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="wix:Directory" >
+ <xsl:copy>
+ <xsl:attribute name="Id"><xsl:value-of select="@Id" /></xsl:attribute>
+ <xsl:attribute name="Name"><xsl:value-of select="@Name" /></xsl:attribute>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="wix:Component">
+ <xsl:element name="ComponentRef" xmlns="http://schemas.microsoft.com/wix/2006/wi" >
+ <xsl:attribute name="Id">
+ <xsl:value-of select="@Id" />
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+</xsl:stylesheet>
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/doc/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/doc/CMakeLists.txt 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/doc/CMakeLists.txt 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,40 +1,40 @@
cmake_policy(SET CMP0002 OLD)
-find_package(Doxygen)
-if(DOXYGEN_FOUND)
- # Search for Sphinx
- #set(SPHINX_PATH "" CACHE PATH
- # "Path to the directory containing the sphinx-build program")
- #find_program(SPHINX_BUILD sphinx-build PATHS ${SPHINX_PATH})
- #if(NOT SPHINX_BUILD)
- # message(FATAL_ERROR
- # "Sphinx was not found. Set SPHINX_PATH to the directory containing the sphinx-build executable, or disable BUILD_DOCUMENTATION.")
- #endif(NOT SPHINX_BUILD)
-
- set(html_dir "${CMAKE_CURRENT_BINARY_DIR}/html")
- set(doxygen_dir "${html_dir}/doxygen")
- file(MAKE_DIRECTORY ${html_dir})
- file(MAKE_DIRECTORY ${doxygen_dir})
-
- # Doxygen part
- set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/doxyfile")
- configure_file(doxyfile.in ${doxyfile})
+find_package(Doxygen)
+if(DOXYGEN_FOUND)
+ # Search for Sphinx
+ #set(SPHINX_PATH "" CACHE PATH
+ # "Path to the directory containing the sphinx-build program")
+ #find_program(SPHINX_BUILD sphinx-build PATHS ${SPHINX_PATH})
+ #if(NOT SPHINX_BUILD)
+ # message(FATAL_ERROR
+ # "Sphinx was not found. Set SPHINX_PATH to the directory containing the sphinx-build executable, or disable BUILD_DOCUMENTATION.")
+ #endif(NOT SPHINX_BUILD)
+
+ set(html_dir "${CMAKE_CURRENT_BINARY_DIR}/html")
+ set(doxygen_dir "${html_dir}/doxygen")
+ file(MAKE_DIRECTORY ${html_dir})
+ file(MAKE_DIRECTORY ${doxygen_dir})
+
+ # Doxygen part
+ set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/doxyfile")
+ configure_file(doxyfile.in ${doxyfile})
add_custom_target(${PROJECT_NAME}_doxygen_doc ${DOXYGEN_EXECUTABLE} ${doxyfile})
-
- # Sphinx part
- #set(conf_dir "${CMAKE_CURRENT_BINARY_DIR}/conf")
- #file(MAKE_DIRECTORY "${conf_dir}")
- #file(MAKE_DIRECTORY "${conf_dir}/_static")
- #set(conf_py "${conf_dir}/conf.py")
- #configure_file(conf.py.in ${conf_py})
- #add_custom_target(sphinx_doc ALL sphinx-build -b html -c ${conf_dir}
- # ${CMAKE_CURRENT_SOURCE_DIR}/content ${CMAKE_CURRENT_BINARY_DIR}/html
- # DEPENDS doxygen_doc)
- #install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" DESTINATION
- # "components/share/doc/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}"
- # COMPONENT documentation)
-else(DOXYGEN_FOUND)
- message(FATAL_ERROR
- "Doxygen was not found. Cannot build documentation. Disable BUILD_DOCUMENTATION to continue")
-endif(DOXYGEN_FOUND)
-
+
+ # Sphinx part
+ #set(conf_dir "${CMAKE_CURRENT_BINARY_DIR}/conf")
+ #file(MAKE_DIRECTORY "${conf_dir}")
+ #file(MAKE_DIRECTORY "${conf_dir}/_static")
+ #set(conf_py "${conf_dir}/conf.py")
+ #configure_file(conf.py.in ${conf_py})
+ #add_custom_target(sphinx_doc ALL sphinx-build -b html -c ${conf_dir}
+ # ${CMAKE_CURRENT_SOURCE_DIR}/content ${CMAKE_CURRENT_BINARY_DIR}/html
+ # DEPENDS doxygen_doc)
+ #install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" DESTINATION
+ # "components/share/doc/${PROJECT_NAME_LOWER}-${PROJECT_VERSION_MAJOR}"
+ # COMPONENT documentation)
+else(DOXYGEN_FOUND)
+ message(FATAL_ERROR
+ "Doxygen was not found. Cannot build documentation. Disable BUILD_DOCUMENTATION to continue")
+endif(DOXYGEN_FOUND)
+
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/idl/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/idl/CMakeLists.txt 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/idl/CMakeLists.txt 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,56 +1,56 @@
-set(idls )
-
-install(FILES ${idls} DESTINATION ${INC_INSTALL_DIR}/idl
- COMPONENT idl)
-
-macro(_IDL_OUTPUTS _idl _dir _result)
- set(${_result} ${_dir}/${_idl}SK.cc ${_dir}/${_idl}.hh
- ${_dir}/${_idl}DynSK.cc)
-endmacro(_IDL_OUTPUTS)
-
-macro(_COMPILE_IDL _idl_file)
- if(NOT WIN32)
- execute_process(COMMAND rtm-config --prefix OUTPUT_VARIABLE OPENRTM_DIR
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND rtm-config --idlflags OUTPUT_VARIABLE OPENRTM_IDLFLAGS
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- separate_arguments(OPENRTM_IDLFLAGS)
- execute_process(COMMAND rtm-config --idlc OUTPUT_VARIABLE OPENRTM_IDLC
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(_rtm_skelwrapper_command "rtm-skelwrapper")
- else(NOT WIN32)
- set(_rtm_skelwrapper_command "rtm-skelwrapper.py")
- endif(NOT WIN32)
- get_filename_component(_idl ${_idl_file} NAME_WE)
- set(_idl_srcs_var ${_idl}_SRCS)
- _IDL_OUTPUTS(${_idl} ${CMAKE_CURRENT_BINARY_DIR} ${_idl_srcs_var})
-
- add_custom_command(OUTPUT ${${_idl_srcs_var}}
- COMMAND python ${OPENRTM_DIR}/bin/${_rtm_skelwrapper_command} --include-dir= --skel-suffix=Skel --stub-suffix=Stub --idl-file=${_idl}.idl
- COMMAND ${OPENRTM_IDLC} ${OPENRTM_IDLFLAGS} ${_idl_file}
- WORKING_DIRECTORY ${CURRENT_BINARY_DIR}
- DEPENDS ${_idl_file}
- COMMENT "Compiling ${_idl_file}" VERBATIM)
- add_custom_target(${_idl}_TGT DEPENDS ${${_idl_srcs_var}})
- set(ALL_IDL_SRCS ${ALL_IDL_SRCS} ${${_idl_srcs_var}})
- if(NOT TARGET ALL_IDL_TGT)
- add_custom_target(ALL_IDL_TGT)
- endif(NOT TARGET ALL_IDL_TGT)
- add_dependencies(ALL_IDL_TGT ${_idl}_TGT)
-endmacro(_COMPILE_IDL)
-
-# Module exposed to the user
-macro(OPENRTM_COMPILE_IDL_FILES)
- foreach(idl ${ARGN})
- _COMPILE_IDL(${idl})
- endforeach(idl)
-endmacro(OPENRTM_COMPILE_IDL_FILES)
-
-
-OPENRTM_COMPILE_IDL_FILES(${idls})
-set(ALL_IDL_SRCS ${ALL_IDL_SRCS} PARENT_SCOPE)
+set(idls )
+
+#install(FILES ${idls} DESTINATION ${INC_INSTALL_DIR}/idl
+# COMPONENT idl)
+
+macro(_IDL_OUTPUTS _idl _dir _result)
+ set(${_result} ${_dir}/${_idl}SK.cc ${_dir}/${_idl}.hh
+ ${_dir}/${_idl}DynSK.cc)
+endmacro(_IDL_OUTPUTS)
+
+macro(_COMPILE_IDL _idl_file)
+ if(NOT WIN32)
+ execute_process(COMMAND rtm-config --prefix OUTPUT_VARIABLE OPENRTM_DIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process(COMMAND rtm-config --idlflags OUTPUT_VARIABLE OPENRTM_IDLFLAGS
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ separate_arguments(OPENRTM_IDLFLAGS)
+ execute_process(COMMAND rtm-config --idlc OUTPUT_VARIABLE OPENRTM_IDLC
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(_rtm_skelwrapper_command "rtm-skelwrapper")
+ else(NOT WIN32)
+ set(_rtm_skelwrapper_command "rtm-skelwrapper.py")
+ endif(NOT WIN32)
+ get_filename_component(_idl ${_idl_file} NAME_WE)
+ set(_idl_srcs_var ${_idl}_SRCS)
+ _IDL_OUTPUTS(${_idl} ${CMAKE_CURRENT_BINARY_DIR} ${_idl_srcs_var})
+
+ add_custom_command(OUTPUT ${${_idl_srcs_var}}
+ COMMAND python ${OPENRTM_DIR}/bin/${_rtm_skelwrapper_command} --include-dir= --skel-suffix=Skel --stub-suffix=Stub --idl-file=${_idl}.idl
+ COMMAND ${OPENRTM_IDLC} ${OPENRTM_IDLFLAGS} ${_idl_file}
+ WORKING_DIRECTORY ${CURRENT_BINARY_DIR}
+ DEPENDS ${_idl_file}
+ COMMENT "Compiling ${_idl_file}" VERBATIM)
+ add_custom_target(${_idl}_TGT DEPENDS ${${_idl_srcs_var}})
+ set(ALL_IDL_SRCS ${ALL_IDL_SRCS} ${${_idl_srcs_var}})
+ if(NOT TARGET ALL_IDL_TGT)
+ add_custom_target(ALL_IDL_TGT)
+ endif(NOT TARGET ALL_IDL_TGT)
+ add_dependencies(ALL_IDL_TGT ${_idl}_TGT)
+endmacro(_COMPILE_IDL)
+
+# Module exposed to the user
+macro(OPENRTM_COMPILE_IDL_FILES)
+ foreach(idl ${ARGN})
+ _COMPILE_IDL(${idl})
+ endforeach(idl)
+endmacro(OPENRTM_COMPILE_IDL_FILES)
+
+
+OPENRTM_COMPILE_IDL_FILES(${idls})
+set(ALL_IDL_SRCS ${ALL_IDL_SRCS} PARENT_SCOPE)
FILTER_LIST("${ALL_IDL_SRCS}" "hh$" idl_headers)
-install(FILES ${idl_headers}
- DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}/idl
- COMPONENT headers)
-
+#install(FILES ${idl_headers}
+# DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}/idl
+# COMPONENT headers)
+
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/CMakeLists.txt 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/CMakeLists.txt 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,7 +1,7 @@
set(hdrs DirectShowCam.h
- PARENT_SCOPE
+# PARENT_SCOPE
)
-install(FILES ${hdrs} DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}
- COMPONENT library)
+#install(FILES ${hdrs} DESTINATION ${INC_INSTALL_DIR}/${PROJECT_NAME_LOWER}
+# COMPONENT library)
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/DirectShowCam.h
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/DirectShowCam.h 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/include/DirectShowCam/DirectShowCam.h 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,358 +1,360 @@
-// -*- C++ -*-
-/*!
- * @file DirectShowCam.h
- * @brief DirectShowCam Module
- * @date $Date$
- *
- * $Id$
- */
-
-#ifndef DIRECTSHOWCAM_H
-#define DIRECTSHOWCAM_H
-
-//DirectShow
-//#include <dshow.h>
-#include "streams.h"
-#define __IDxtCompositor_INTERFACE_DEFINED__
-#define __IDxtAlphaSetter_INTERFACE_DEFINED__
-#define __IDxtJpeg_INTERFACE_DEFINED__
-#define __IDxtKey_INTERFACE_DEFINED__
-#include "qedit.h"
-#include <comdef.h>
-
-//OpenRTM
-#include <rtm/Manager.h>
-#include <rtm/DataFlowComponentBase.h>
-#include <rtm/CorbaPort.h>
-#include <rtm/DataInPort.h>
-#include <rtm/DataOutPort.h>
-#include <rtm/idl/BasicDataTypeSkel.h>
-#include <rtm/idl/ExtendedDataTypesSkel.h>
-#include <rtm/idl/InterfaceDataTypesSkel.h>
-
-// Service implementation headers
-// <rtc-template block="service_impl_h">
-
-// </rtc-template>
-
-// Service Consumer stub headers
-// <rtc-template block="consumer_stub_h">
-
-// </rtc-template>
-
-using namespace RTC;
-
-//C++
-#include <string>
-#include <iostream>
-
-#define IBITCOUNT 16
-#define RGB_CHANNELBIT 8
-#define RGB_CHANNEL 3
-
-//R[obNNX
-//J©çfðæ¾µ½ãAÄÎêéNXAfÍBufferCB\bhÉRs[
-//\[XÍDirextShowGOUv(SampleGrabCB)Ql
-class CGrabCB: public ISampleGrabberCB
-{
-public:
- HANDLE hEvent;
- char *m_pImagePtr;
- void SetBufferPtr(char *pBuffer) { m_pImagePtr = pBuffer;}
- void DetachBuffer(void)
- {
- if(m_pImagePtr!=NULL){
- m_pImagePtr = NULL;
- }
- }
-
- // fake out any COM ref counting
- STDMETHODIMP_(ULONG) AddRef() { return 2; }
- STDMETHODIMP_(ULONG) Release() { return 1; }
-
- // fake out any COM QI'ing
- STDMETHODIMP QueryInterface(REFIID riid, void ** ppv)
- {
- if( riid == IID_ISampleGrabberCB || riid == IID_IUnknown )
- {
- *ppv = (void *) static_cast<ISampleGrabberCB*> ( this );
- return NOERROR;
- }
- return E_NOINTERFACE;
- }
- // ISampleGrabberCB methods
- STDMETHODIMP SampleCB(double SampleTime, IMediaSample *pSample)
- {
- return E_NOTIMPL;
- }
- STDMETHODIMP BufferCB(double SampleTime, BYTE *pSrcBuffer, long BufferLen)
- {
- memcpy(m_pImagePtr, pSrcBuffer, BufferLen);
- SetEvent(hEvent);
- return S_OK;
- }
- // Constructor
- CGrabCB( )
- {
- m_pImagePtr = NULL;
- }
-};
-
-/*!
- * @class DirectShowCam
- * @brief DirectShowCam Module
- *
- */
-class DirectShowCam
- : public RTC::DataFlowComponentBase
-{
- public:
- /*!
- * @brief constructor
- * @param manager Maneger Object
- */
- DirectShowCam(RTC::Manager* manager);
-
- /*!
- * @brief destructor
- */
- ~DirectShowCam();
-
- // <rtc-template block="public_attribute">
-
- // </rtc-template>
-
- // <rtc-template block="public_operation">
-
- // </rtc-template>
-
- /***
- *
- * The initialize action (on CREATED->ALIVE transition)
- * formaer rtc_init_entry()
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- virtual RTC::ReturnCode_t onInitialize();
-
- /***
- *
- * The finalize action (on ALIVE->END transition)
- * formaer rtc_exiting_entry()
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onFinalize();
-
- /***
- *
- * The startup action when ExecutionContext startup
- * former rtc_starting_entry()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
-
- /***
- *
- * The shutdown action when ExecutionContext stop
- * former rtc_stopping_entry()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
-
- /***
- *
- * The activated action (Active state entry action)
- * former rtc_active_entry()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
-
- /***
- *
- * The deactivated action (Active state exit action)
- * former rtc_active_exit()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
-
- /***
- *
- * The execution action that is invoked periodically
- * former rtc_active_do()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
-
- /***
- *
- * The aborting action when main logic error occurred.
- * former rtc_aborting_entry()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
-
- /***
- *
- * The error action in ERROR state
- * former rtc_error_do()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
-
- /***
- *
- * The reset action that is invoked resetting
- * This is same but different the former rtc_init_entry()
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
-
- /***
- *
- * The state update action that is invoked after onExecute() action
- * no corresponding operation exists in OpenRTm-aist-0.2.0
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
-
- /***
- *
- * The action that is invoked when execution context's rate is changed
- * no corresponding operation exists in OpenRTm-aist-0.2.0
- *
- * @param ec_id target ExecutionContext Id
- *
- * @return RTC::ReturnCode_t
- *
- *
- */
- // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
-
-
- protected:
- // <rtc-template block="protected_attribute">
-
- // </rtc-template>
-
- // <rtc-template block="protected_operation">
-
- // </rtc-template>
-
- // Configuration variable declaration
- // <rtc-template block="config_declare">
-
- // </rtc-template>
-
- // DataInPort declaration
- // <rtc-template block="inport_declare">
-
- // </rtc-template>
-
-
- // DataOutPort declaration
- // <rtc-template block="outport_declare">
- RTC::CameraImage m_FIN_OUTPORT;
- /*!
- */
- OutPort<RTC::CameraImage> m_FIN_OUTPORTOut;
-
- // </rtc-template>
-
- // CORBA Port declaration
- // <rtc-template block="corbaport_declare">
-
- // </rtc-template>
-
- // Service declaration
- // <rtc-template block="service_declare">
-
- // </rtc-template>
-
- // Consumer declaration
- // <rtc-template block="consumer_declare">
-
- // </rtc-template>
-
- private:
- // <rtc-template block="private_attribute">
-
- // </rtc-template>
-
- // <rtc-template block="private_operation">
-
- // </rtc-template>
- HRESULT hr;
- IGraphBuilder *pGraph;
- ICaptureGraphBuilder2 *pBuilder;
- IBaseFilter *pSrc;
- IBaseFilter *pF;
- IMediaControl *pMediaControl;
- ISampleGrabber *pGrab;
-
- char *pBuffer;
- long buffersize;
- int v_Width;
- int v_Height;
- int v_Channel;
- bool bFound;
-
- CGrabCB m_cb;
-};
-
-
-extern "C"
-{
- DLL_EXPORT void DirectShowCamInit(RTC::Manager* manager);
-};
-
-#endif // DIRECTSHOWCAM_H
+// -*- C++ -*-
+/*!
+ * @file DirectShowCam.h
+ * @brief DirectShowCam Module
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#ifndef DIRECTSHOWCAM_H
+#define DIRECTSHOWCAM_H
+
+//DirectShow
+//#include <dshow.h>
+#include "streams.h"
+#define __IDxtCompositor_INTERFACE_DEFINED__
+#define __IDxtAlphaSetter_INTERFACE_DEFINED__
+#define __IDxtJpeg_INTERFACE_DEFINED__
+#define __IDxtKey_INTERFACE_DEFINED__
+#include "qedit.h"
+#include <comdef.h>
+
+//OpenRTM
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/idl/ExtendedDataTypesSkel.h>
+#include <rtm/idl/InterfaceDataTypesSkel.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+//C++
+#include <string>
+#include <iostream>
+
+#define IBITCOUNT 16
+#define RGB_CHANNELBIT 8
+#define RGB_CHANNEL 3
+
+/*
+* ã³ã¼ã«ããã¯ã¯ã©ã¹
+* ã«ã¡ã©ããæ åãåå¾ããå¾ãå¼ã°ããã¯ã©ã¹ãæ åã¯BufferCBã¡ã½ããã«ã³ãã¼
+* ã½ã¼ã¹ã¯DirextShowã¨ã°ã¶ã³ãã«(SampleGrabCB)åè
+*/
+class CGrabCB: public ISampleGrabberCB
+{
+public:
+ HANDLE hEvent;
+ char *m_pImagePtr;
+ void SetBufferPtr(char *pBuffer) { m_pImagePtr = pBuffer;}
+ void DetachBuffer(void)
+ {
+ if(m_pImagePtr!=NULL){
+ m_pImagePtr = NULL;
+ }
+ }
+
+ // fake out any COM ref counting
+ STDMETHODIMP_(ULONG) AddRef() { return 2; }
+ STDMETHODIMP_(ULONG) Release() { return 1; }
+
+ // fake out any COM QI'ing
+ STDMETHODIMP QueryInterface(REFIID riid, void ** ppv)
+ {
+ if( riid == IID_ISampleGrabberCB || riid == IID_IUnknown )
+ {
+ *ppv = (void *) static_cast<ISampleGrabberCB*> ( this );
+ return NOERROR;
+ }
+ return E_NOINTERFACE;
+ }
+ // ISampleGrabberCB methods
+ STDMETHODIMP SampleCB(double SampleTime, IMediaSample *pSample)
+ {
+ return E_NOTIMPL;
+ }
+ STDMETHODIMP BufferCB(double SampleTime, BYTE *pSrcBuffer, long BufferLen)
+ {
+ memcpy(m_pImagePtr, pSrcBuffer, BufferLen);
+ SetEvent(hEvent);
+ return S_OK;
+ }
+ // Constructor
+ CGrabCB( )
+ {
+ m_pImagePtr = NULL;
+ }
+};
+
+/*!
+ * @class DirectShowCam
+ * @brief DirectShowCam Module
+ *
+ */
+class DirectShowCam
+ : public RTC::DataFlowComponentBase
+{
+ public:
+ /*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+ DirectShowCam(RTC::Manager* manager);
+
+ /*!
+ * @brief destructor
+ */
+ ~DirectShowCam();
+
+ // <rtc-template block="public_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="public_operation">
+
+ // </rtc-template>
+
+ /***
+ *
+ * The initialize action (on CREATED->ALIVE transition)
+ * formaer rtc_init_entry()
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onInitialize();
+
+ /***
+ *
+ * The finalize action (on ALIVE->END transition)
+ * formaer rtc_exiting_entry()
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onFinalize();
+
+ /***
+ *
+ * The startup action when ExecutionContext startup
+ * former rtc_starting_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The shutdown action when ExecutionContext stop
+ * former rtc_stopping_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The activated action (Active state entry action)
+ * former rtc_active_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The deactivated action (Active state exit action)
+ * former rtc_active_exit()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The execution action that is invoked periodically
+ * former rtc_active_do()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The aborting action when main logic error occurred.
+ * former rtc_aborting_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The error action in ERROR state
+ * former rtc_error_do()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The reset action that is invoked resetting
+ * This is same but different the former rtc_init_entry()
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The state update action that is invoked after onExecute() action
+ * no corresponding operation exists in OpenRTm-aist-0.2.0
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+ /***
+ *
+ * The action that is invoked when execution context's rate is changed
+ * no corresponding operation exists in OpenRTm-aist-0.2.0
+ *
+ * @param ec_id target ExecutionContext Id
+ *
+ * @return RTC::ReturnCode_t
+ *
+ *
+ */
+ // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+ // <rtc-template block="protected_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="protected_operation">
+
+ // </rtc-template>
+
+ // Configuration variable declaration
+ // <rtc-template block="config_declare">
+
+ // </rtc-template>
+
+ // DataInPort declaration
+ // <rtc-template block="inport_declare">
+
+ // </rtc-template>
+
+
+ // DataOutPort declaration
+ // <rtc-template block="outport_declare">
+ RTC::CameraImage m_FIN_OUTPORT;
+ /*!
+ */
+ OutPort<RTC::CameraImage> m_FIN_OUTPORTOut;
+
+ // </rtc-template>
+
+ // CORBA Port declaration
+ // <rtc-template block="corbaport_declare">
+
+ // </rtc-template>
+
+ // Service declaration
+ // <rtc-template block="service_declare">
+
+ // </rtc-template>
+
+ // Consumer declaration
+ // <rtc-template block="consumer_declare">
+
+ // </rtc-template>
+
+ private:
+ // <rtc-template block="private_attribute">
+
+ // </rtc-template>
+
+ // <rtc-template block="private_operation">
+
+ // </rtc-template>
+ HRESULT hr;
+ IGraphBuilder *pGraph;
+ ICaptureGraphBuilder2 *pBuilder;
+ IBaseFilter *pSrc;
+ IBaseFilter *pF;
+ IMediaControl *pMediaControl;
+ ISampleGrabber *pGrab;
+
+ char *pBuffer;
+ long buffersize;
+ int v_Width;
+ int v_Height;
+ int v_Channel;
+ bool bFound;
+
+ CGrabCB m_cb;
+};
+
+
+extern "C"
+{
+ DLL_EXPORT void DirectShowCamInit(RTC::Manager* manager);
+};
+
+#endif // DIRECTSHOWCAM_H
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/CMakeLists.txt
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/CMakeLists.txt 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/CMakeLists.txt 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,49 +1,49 @@
-set(comp_srcs DirectShowCam.cpp )
-set(standalone_srcs DirectShowCamComp.cpp)
-
+set(comp_srcs DirectShowCam.cpp )
+set(standalone_srcs DirectShowCamComp.cpp)
+
find_package(OpenCV REQUIRED)
include(../BaseClasses/FindDirectShow.cmake)
-if (DEFINED OPENRTM_INCLUDE_DIRS)
- string(REGEX REPLACE "-I" ";"
- OPENRTM_INCLUDE_DIRS "${OPENRTM_INCLUDE_DIRS}")
- string(REGEX REPLACE " ;" ";"
- OPENRTM_INCLUDE_DIRS "${OPENRTM_INCLUDE_DIRS}")
-endif (DEFINED OPENRTM_INCLUDE_DIRS)
-
-if (DEFINED OPENRTM_LIBRARY_DIRS)
- string(REGEX REPLACE "-L" ";"
- OPENRTM_LIBRARY_DIRS "${OPENRTM_LIBRARY_DIRS}")
- string(REGEX REPLACE " ;" ";"
- OPENRTM_LIBRARY_DIRS "${OPENRTM_LIBRARY_DIRS}")
-endif (DEFINED OPENRTM_LIBRARY_DIRS)
-
-if (DEFINED OPENRTM_LIBRARIES)
- string(REGEX REPLACE "-l" ";"
- OPENRTM_LIBRARIES "${OPENRTM_LIBRARIES}")
- string(REGEX REPLACE " ;" ";"
- OPENRTM_LIBRARIES "${OPENRTM_LIBRARIES}")
-endif (DEFINED OPENRTM_LIBRARIES)
-
-include_directories(${PROJECT_SOURCE_DIR}/include)
-include_directories(${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME})
-include_directories(${PROJECT_BINARY_DIR})
-include_directories(${PROJECT_BINARY_DIR}/idl)
-include_directories(${OPENRTM_INCLUDE_DIRS})
-include_directories(${OMNIORB_INCLUDE_DIRS})
+if (DEFINED OPENRTM_INCLUDE_DIRS)
+ string(REGEX REPLACE "-I" ";"
+ OPENRTM_INCLUDE_DIRS "${OPENRTM_INCLUDE_DIRS}")
+ string(REGEX REPLACE " ;" ";"
+ OPENRTM_INCLUDE_DIRS "${OPENRTM_INCLUDE_DIRS}")
+endif (DEFINED OPENRTM_INCLUDE_DIRS)
+
+if (DEFINED OPENRTM_LIBRARY_DIRS)
+ string(REGEX REPLACE "-L" ";"
+ OPENRTM_LIBRARY_DIRS "${OPENRTM_LIBRARY_DIRS}")
+ string(REGEX REPLACE " ;" ";"
+ OPENRTM_LIBRARY_DIRS "${OPENRTM_LIBRARY_DIRS}")
+endif (DEFINED OPENRTM_LIBRARY_DIRS)
+
+if (DEFINED OPENRTM_LIBRARIES)
+ string(REGEX REPLACE "-l" ";"
+ OPENRTM_LIBRARIES "${OPENRTM_LIBRARIES}")
+ string(REGEX REPLACE " ;" ";"
+ OPENRTM_LIBRARIES "${OPENRTM_LIBRARIES}")
+endif (DEFINED OPENRTM_LIBRARIES)
+
+include_directories(${PROJECT_SOURCE_DIR}/include)
+include_directories(${PROJECT_SOURCE_DIR}/include/${PROJECT_NAME})
+include_directories(${PROJECT_BINARY_DIR})
+include_directories(${PROJECT_BINARY_DIR}/idl)
+include_directories(${OPENRTM_INCLUDE_DIRS})
+include_directories(${OMNIORB_INCLUDE_DIRS})
include_directories(${DIRECTSHOW_BASECLASS_DIR})
-add_definitions(${OPENRTM_CFLAGS})
-add_definitions(${OMNIORB_CFLAGS})
-
-MAP_ADD_STR(comp_hdrs "../" comp_headers)
-
-link_directories(${OPENRTM_LIBRARY_DIRS})
-link_directories(${OMNIORB_LIBRARY_DIRS})
-
-add_library(${PROJECT_NAME} ${LIB_TYPE} ${comp_srcs}
- ${comp_headers} ${ALL_IDL_SRCS})
-set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
-set_source_files_properties(${ALL_IDL_SRCS} PROPERTIES GENERATED 1)
+add_definitions(${OPENRTM_CFLAGS})
+add_definitions(${OMNIORB_CFLAGS})
+
+MAP_ADD_STR(comp_hdrs "../" comp_headers)
+
+link_directories(${OPENRTM_LIBRARY_DIRS})
+link_directories(${OMNIORB_LIBRARY_DIRS})
+
+add_library(${PROJECT_NAME} ${LIB_TYPE} ${comp_srcs}
+ ${comp_headers} ${ALL_IDL_SRCS})
+set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
+set_source_files_properties(${ALL_IDL_SRCS} PROPERTIES GENERATED 1)
add_dependencies(${PROJECT_NAME} ALL_IDL_TGT strmbase)
add_library(strmbase STATIC IMPORTED)
@@ -53,22 +53,27 @@
set_property(TARGET strmiids PROPERTY
IMPORTED_LOCATION ${WINDOWSSDK_STRMIIDS_LIB})
target_link_libraries(${PROJECT_NAME} ${OPENRTM_LIBRARIES} ${OpenCV_LIBS} strmbase strmiids)
-
-add_executable(${PROJECT_NAME}Comp ${standalone_srcs}
- ${comp_srcs} ${comp_headers} ${ALL_IDL_SRCS})
+
+add_executable(${PROJECT_NAME}Comp ${standalone_srcs}
+ ${comp_srcs} ${comp_headers} ${ALL_IDL_SRCS})
add_dependencies(${PROJECT_NAME}Comp strmbase)
target_link_libraries(${PROJECT_NAME}Comp ${OPENRTM_LIBRARIES} ${OpenCV_LIBS} strmbase strmiids)
+
+#install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}Comp
+# EXPORT ${PROJECT_NAME}
+# RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT component
+# LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT component
+# ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT component)
+#install(EXPORT ${PROJECT_NAME}
+# DESTINATION ${LIB_INSTALL_DIR}/${PROJECT_NAME}
+# FILE ${PROJECT_NAME}Depends.cmake)
+install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}Comp
+ EXPORT ${PROJECT_NAME}
+ RUNTIME DESTINATION ${INSTALL_PREFIX} COMPONENT component
+ LIBRARY DESTINATION ${INSTALL_PREFIX} COMPONENT component
+ ARCHIVE DESTINATION ${INSTALL_PREFIX} COMPONENT component)
+
-install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}Comp
- EXPORT ${PROJECT_NAME}
- RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT component
- LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT component
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT component)
-
-install(EXPORT ${PROJECT_NAME}
- DESTINATION ${LIB_INSTALL_DIR}/${PROJECT_NAME}
- FILE ${PROJECT_NAME}Depends.cmake)
-
if (SolutionDir)
if (MSVC)
add_custom_command(
Modified: branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/DirectShowCam.cpp
===================================================================
--- branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/DirectShowCam.cpp 2014-03-13 04:56:05 UTC (rev 112)
+++ branches/newCMakeForVC2010/ImageProcessing/opencv/components/DirectShowCam/src/DirectShowCam.cpp 2014-03-13 05:52:03 UTC (rev 113)
@@ -1,416 +1,416 @@
-// -*- C++ -*-
-/*!
- * @file DirectShowCam.cpp
- * @brief DirectShowCam Module
- * @date $Date$
- *
- * $Id$
- */
-
-#include "DirectShowCam.h"
-
-//fðãºÏ·
-void m_flip(char *pBuffer,int Width, int Height, int Channel)
-{
- int i;
- int nHeight;
- int nStride;
- char *pSource, *pDestination;
- char *pTempBuffer;
-
- nStride = Width * Channel;
- nHeight = Height;
- pSource = pBuffer;
- pDestination = pBuffer;
- pDestination += nStride * (nHeight -1);
- pTempBuffer = new char[nStride];
-
- for(i=0;i<nHeight/2;i++)
- {
- memcpy(pTempBuffer, pDestination, nStride);
- memcpy(pDestination, pSource, nStride);
- memcpy(pSource, pTempBuffer, nStride);
- pSource += nStride;
- pDestination -= nStride;
- }
-
- delete [] pTempBuffer;
-
-}
-
-// Module specification
-// <rtc-template block="module_spec">
-static const char* directshowcam_spec[] =
- {
- "implementation_id", "DirectShowCam",
- "type_name", "DirectShowCam",
- "description", "DirectShowCam Module",
- "version", "1.0.0",
- "vendor", "AIST",
- "category", "Category",
- "activity_type", "PERIODIC",
- "kind", "DataFlowComponent",
- "max_instance", "1",
- "language", "C++",
- "lang_type", "compile",
- ""
- };
-// </rtc-template>
-
-/*!
- * @brief constructor
- * @param manager Maneger Object
- */
-DirectShowCam::DirectShowCam(RTC::Manager* manager)
- // <rtc-template block="initializer">
- : RTC::DataFlowComponentBase(manager),
- m_FIN_OUTPORTOut("m_FIN_OUTPORT", m_FIN_OUTPORT)
-
- // </rtc-template>
-{
-}
-
-/*!
- * @brief destructor
- */
-DirectShowCam::~DirectShowCam()
-{
-}
-
-
-
-RTC::ReturnCode_t DirectShowCam::onInitialize()
-{
- // Registration: InPort/OutPort/Service
- // <rtc-template block="registration">
- // Set InPort buffers
-
- // Set OutPort buffer
- addOutPort("m_FIN_OUTPORT", m_FIN_OUTPORTOut);
-
- // Set service provider to Ports
-
- // Set service consumers to Ports
-
- // Set CORBA Service Ports
-
- // </rtc-template>
-
- // <rtc-template block="bind_config">
- // </rtc-template>
-
- return RTC::RTC_OK;
-}
-
-/*
-RTC::ReturnCode_t DirectShowCam::onFinalize()
-{
- return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t DirectShowCam::onStartup(RTC::UniqueId ec_id)
-{
- return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t DirectShowCam::onShutdown(RTC::UniqueId ec_id)
-{
- return RTC::RTC_OK;
-}
-*/
-
-
-RTC::ReturnCode_t DirectShowCam::onActivated(RTC::UniqueId ec_id)
-{
- //Ïú»
- hr = NULL;
- pGraph = NULL;
- pSrc = NULL;
- pF = NULL;
- pBuilder = NULL;
- pGrab = NULL;
- pBuffer = NULL;
- v_Width = v_Height = v_Channel = 0;
- bFound = false;
-
- //Cxgnh¶¬
- m_cb.hEvent=CreateEvent(NULL, FALSE, FALSE, NULL);
-
- //COMCu[h
- hr = CoInitialize(NULL);
-
- if(FAILED(hr))
- {
- std::cout << "CoInitialize Failed!\n";
- return RTC::RTC_ERROR;
- }
-
- //foCXhCoðTõ[`
- ICreateDevEnum *pDevEnum = NULL;
- IEnumMoniker *pClassEnum = NULL;
-
- CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
- IID_ICreateDevEnum, reinterpret_cast<void**>(&pDevEnum));
-
- hr = pDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pClassEnum, 0);
-
- if(SUCCEEDED(hr))
- {
- IMoniker *pMoniker = NULL;
-
- //JeSÅÅqªÁÄ¢éfoCXIð
- if (pClassEnum->Next(1, &pMoniker, NULL) == S_OK)
- {
- pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void **)&pSrc);
- pMoniker->Release();
- bFound = true;
- }
- pClassEnum->Release();
- }
- pDevEnum->Release();
-
- if(!bFound)
- {
- std::cout<<"rfILv`foCXͶݵܹñ"<<std::endl;
- return RTC::RTC_ERROR;
- }
-
- //IGraphBuilder¶¬
- CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
- IID_IGraphBuilder, reinterpret_cast<void**>(&pGraph));
- pGraph->AddFilter(pSrc, L"Video Capture");
-
- //MediaControlÇÁ
- pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
-
- //_îÈCapturefoCXðg¤½ßCputreGraphBuilder2g¤
- CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER,
- IID_ICaptureGraphBuilder2, reinterpret_cast<void**>(&pBuilder));
-
- pBuilder->SetFiltergraph(pGraph);
-
- //CAPTUREtB^
- IAMStreamConfig *pConfig = NULL;
- pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE, 0,
- pSrc, IID_IAMStreamConfig,reinterpret_cast<void**>(&pConfig));
-
- //foCXîñæ¾
- bFound = false;
- int iCount=0, iSize=0;
- pConfig->GetNumberOfCapabilities(&iCount,&iSize);
-
- if(iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS))
- {
- for(int iFormat = 0; iFormat < iCount; iFormat++)
- {
- VIDEO_STREAM_CONFIG_CAPS scc;
- AM_MEDIA_TYPE *pmtConfig;
- hr = pConfig->GetStreamCaps(iFormat, &pmtConfig, (BYTE*)&scc);
-
- if(SUCCEEDED(hr))
- {
- if(pmtConfig->majortype == MEDIATYPE_Video)
- {
- VIDEOINFOHEADER *pVih = (VIDEOINFOHEADER*)pmtConfig->pbFormat;
- std::cout<<"Width : "<<pVih->bmiHeader.biWidth<<", Height : "<<abs(pVih->bmiHeader.biHeight);
- std::cout<<", biBitCount : "<<pVih->bmiHeader.biBitCount<<std::endl;
- if(RGB_CHANNELBIT <= pVih->bmiHeader.biBitCount)
- {
- //æÊTCY
- v_Width = pVih->bmiHeader.biWidth;
- v_Height = pVih->bmiHeader.biHeight;
- v_Channel = RGB_CHANNEL;
- pConfig->SetFormat(pmtConfig);
- bFound = true;
- }
- }
- DeleteMediaType(pmtConfig);
-
- if(bFound){
- break;
- }
- }
- }
- }
-
- //æ¾·éC[WÌBufferõ
- CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
- IID_IBaseFilter, reinterpret_cast<void**>(&pF));
- pF->QueryInterface(IID_ISampleGrabber,(void**)&pGrab);
- pGraph->AddFilter(pF, L"Sample Grabber");
-
- AM_MEDIA_TYPE mt;
- ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
- mt.majortype = MEDIATYPE_Video;
- mt.subtype = MEDIASUBTYPE_RGB24;
- pGrab->SetMediaType(&mt);
-
- pGrab->SetOneShot(FALSE);
- pGrab->SetBufferSamples(FALSE);
-
- pBuilder->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pSrc, NULL, pF );
-
- pGrab->GetConnectedMediaType(&mt);
- VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADER*)mt.pbFormat;
-
- // rfI wb_[ÉÍCrbg}bvîñªÜÜêé
- // rbg}bvîñð BITMAPINFO \¢ÌÉRs[
- BITMAPINFO BitmapInfo;
- ZeroMemory(&BitmapInfo, sizeof(BitmapInfo) );
- memcpy(&BitmapInfo.bmiHeader, &(pVideoHeader->bmiHeader), sizeof(BITMAPINFOHEADER));
-
- buffersize = BitmapInfo.bmiHeader.biSizeImage;
- pBuffer = new char[buffersize];
-
- //R[obNClassÉBufferðn·
- if(pBuffer !=NULL)
- {
- m_cb.SetBufferPtr(pBuffer);
- }
-
- //C[Wðæ¾µ½ãÄÎêéR[obN
- if(pGrab->SetCallback(&m_cb,1)!=S_OK)
- {
- std::cout<<"SetCallback error!\n";
- return RTC::RTC_ERROR;
- }
-
- FreeMediaType(mt);
- //C[Wæ¾·é
- pMediaControl->Run();
-
- return RTC::RTC_OK;
-}
-
-
-RTC::ReturnCode_t DirectShowCam::onDeactivated(RTC::UniqueId ec_id)
-{
-
- if(bFound)
- {
- pMediaControl->Stop();
- pMediaControl->Release();
- pF->Release();
-
- pSrc->Release();
- pGrab->Release();
- pBuilder->Release();
- pGraph->Release();
-
- m_cb.DetachBuffer();
- delete [] pBuffer;
- }
-
- if(pSrc!=NULL)
- pSrc->Release();
-
- CoUninitialize();
- CloseHandle(m_cb.hEvent);
-
- return RTC::RTC_OK;
-}
-
-
-RTC::ReturnCode_t DirectShowCam::onExecute(RTC::UniqueId ec_id)
-{
- static coil::TimeValue tm_pre;
- static int count = 0;
-
- //C[Wæ¾·éÜÅÒÂ
- int ret = WaitForSingleObject(m_cb.hEvent, INFINITE);
-
- if(ret==WAIT_FAILED || ret==WAIT_ABANDONED || ret==WAIT_TIMEOUT)
- {
- std::cout<<"WatiForSingleObjec Error!"<<std::endl;
- return RTC::RTC_ERROR;
- }
-
- //ãºÏ·
- // m_flip(pBuffer, v_Width, abs(v_Height), v_Channel);
-
- int len = v_Channel * v_Width * abs(v_Height);
-
- //oÍAEg|[gÝè
- m_FIN_OUTPORT.pixels.length(len);
- m_FIN_OUTPORT.width = v_Width;
- m_FIN_OUTPORT.height = abs(v_Height);
-
- memcpy((void *)&(m_FIN_OUTPORT.pixels[0]), pBuffer, len);
-
- m_FIN_OUTPORTOut.write();
-
- if (count > 100)
- {
- count = 0;
- coil::TimeValue tm;
- tm = coil::gettimeofday();
-
- double sec(tm - tm_pre);
-
- if (sec > 1.0 && sec < 1000.0)
- {
- std::cout << 100/sec << " [FPS]" << std::endl;
- }
-
- tm_pre = tm;
- }
- ++count;
-
- return RTC::RTC_OK;
-}
-
-/*
-RTC::ReturnCode_t DirectShowCam::onAborting(RTC::UniqueId ec_id)
-{
- return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t DirectShowCam::onError(RTC::UniqueId ec_id)
-{
- return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t DirectShowCam::onReset(RTC::UniqueId ec_id)
-{
- return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t DirectShowCam::onStateUpdate(RTC::UniqueId ec_id)
-{
- return RTC::RTC_OK;
-}
-*/
-
-/*
-RTC::ReturnCode_t DirectShowCam::onRateChanged(RTC::UniqueId ec_id)
-{
- return RTC::RTC_OK;
-}
-*/
-
-
-
-extern "C"
-{
-
- void DirectShowCamInit(RTC::Manager* manager)
- {
- coil::Properties profile(directshowcam_spec);
- manager->registerFactory(profile,
- RTC::Create<DirectShowCam>,
- RTC::Delete<DirectShowCam>);
- }
-
-};
-
-
+// -*- C++ -*-
+/*!
+ * @file DirectShowCam.cpp
+ * @brief DirectShowCam Module
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include "DirectShowCam.h"
+
+/* æ åãä¸ä¸å¤æ */
+void m_flip(char *pBuffer,int Width, int Height, int Channel)
+{
+ int i;
+ int nHeight;
+ int nStride;
+ char *pSource, *pDestination;
+ char *pTempBuffer;
+
+ nStride = Width * Channel;
+ nHeight = Height;
+ pSource = pBuffer;
+ pDestination = pBuffer;
+ pDestination += nStride * (nHeight -1);
+ pTempBuffer = new char[nStride];
+
+ for(i=0;i<nHeight/2;i++)
+ {
+ memcpy(pTempBuffer, pDestination, nStride);
+ memcpy(pDestination, pSource, nStride);
+ memcpy(pSource, pTempBuffer, nStride);
+ pSource += nStride;
+ pDestination -= nStride;
+ }
+
+ delete [] pTempBuffer;
+
+}
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* directshowcam_spec[] =
+ {
+ "implementation_id", "DirectShowCam",
+ "type_name", "DirectShowCam",
+ "description", "DirectShowCam Module",
+ "version", "1.1.0",
+ "vendor", "AIST",
+ "category", "Category",
+ "activity_type", "PERIODIC",
+ "kind", "DataFlowComponent",
+ "max_instance", "1",
+ "language", "C++",
+ "lang_type", "compile",
+ ""
+ };
+// </rtc-template>
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+DirectShowCam::DirectShowCam(RTC::Manager* manager)
+ // <rtc-template block="initializer">
+ : RTC::DataFlowComponentBase(manager),
+ m_FIN_OUTPORTOut("m_FIN_OUTPORT", m_FIN_OUTPORT)
+
+ // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+DirectShowCam::~DirectShowCam()
+{
+}
+
+
+
+RTC::ReturnCode_t DirectShowCam::onInitialize()
+{
+ // Registration: InPort/OutPort/Service
+ // <rtc-template block="registration">
+ // Set InPort buffers
+
+ // Set OutPort buffer
+ addOutPort("m_FIN_OUTPORT", m_FIN_OUTPORTOut);
+
+ // Set service provider to Ports
+
+ // Set service consumers to Ports
+
+ // Set CORBA Service Ports
+
+ // </rtc-template>
+
+ // <rtc-template block="bind_config">
+ // </rtc-template>
+
+ return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t DirectShowCam::onFinalize()
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t DirectShowCam::onStartup(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t DirectShowCam::onShutdown(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+
+RTC::ReturnCode_t DirectShowCam::onActivated(RTC::UniqueId ec_id)
+{
+ /* å¤æ°åæå */
+ hr = NULL;
+ pGraph = NULL;
+ pSrc = NULL;
+ pF = NULL;
+ pBuilder = NULL;
+ pGrab = NULL;
+ pBuffer = NULL;
+ v_Width = v_Height = v_Channel = 0;
+ bFound = false;
+
+ /* ã¤ãã³ããã³ãã«çæ */
+ m_cb.hEvent=CreateEvent(NULL, FALSE, FALSE, NULL);
+
+ /* COMã©ã¤ãã©ãªãã¼ã */
+ hr = CoInitialize(NULL);
+
+ if(FAILED(hr))
+ {
+ std::cout << "CoInitialize Failed!\n";
+ return RTC::RTC_ERROR;
+ }
+
+ /* ããã¤ã¹ãã©ã¤ããæ¢ç´¢ã«ã¼ãã³ */
+ ICreateDevEnum *pDevEnum = NULL;
+ IEnumMoniker *pClassEnum = NULL;
+
+ CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
+ IID_ICreateDevEnum, reinterpret_cast<void**>(&pDevEnum));
+
+ hr = pDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pClassEnum, 0);
+
+ if(SUCCEEDED(hr))
+ {
+ IMoniker *pMoniker = NULL;
+
+ /* ã«ãã´ãªã§æåç¹ãã£ã¦ããããã¤ã¹é¸æ */
+ if (pClassEnum->Next(1, &pMoniker, NULL) == S_OK)
+ {
+ pMoniker->BindToObject(0, 0, IID_IBaseFilter, (void **)&pSrc);
+ pMoniker->Release();
+ bFound = true;
+ }
+ pClassEnum->Release();
+ }
+ pDevEnum->Release();
+
+ if(!bFound)
+ {
+ std::cout<<"ãããªãã£ããã£ããã¤ã¹ã¯åå¨ãã¾ãã"<<std::endl;
+ return RTC::RTC_ERROR;
+ }
+
+ /* IGraphBuilderçæ */
+ CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
+ IID_IGraphBuilder, reinterpret_cast<void**>(&pGraph));
+ pGraph->AddFilter(pSrc, L"Video Capture");
+
+ /* MediaControl追å */
+ pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
+
+ /* æè»ãªCaptureããã¤ã¹ã使ãããCputreGraphBuilder2使ã */
+ CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER,
+ IID_ICaptureGraphBuilder2, reinterpret_cast<void**>(&pBuilder));
+
+ pBuilder->SetFiltergraph(pGraph);
+
+ /* CAPTUREãã£ã«ã¿ */
+ IAMStreamConfig *pConfig = NULL;
+ pBuilder->FindInterface(&PIN_CATEGORY_CAPTURE, 0,
+ pSrc, IID_IAMStreamConfig,reinterpret_cast<void**>(&pConfig));
+
+ /* ããã¤ã¹æ
å ±åå¾ */
+ bFound = false;
+ int iCount=0, iSize=0;
+ pConfig->GetNumberOfCapabilities(&iCount,&iSize);
+
+ if(iSize == sizeof(VIDEO_STREAM_CONFIG_CAPS))
+ {
+ for(int iFormat = 0; iFormat < iCount; iFormat++)
+ {
+ VIDEO_STREAM_CONFIG_CAPS scc;
+ AM_MEDIA_TYPE *pmtConfig;
+ hr = pConfig->GetStreamCaps(iFormat, &pmtConfig, (BYTE*)&scc);
+
+ if(SUCCEEDED(hr))
+ {
+ if(pmtConfig->majortype == MEDIATYPE_Video)
+ {
+ VIDEOINFOHEADER *pVih = (VIDEOINFOHEADER*)pmtConfig->pbFormat;
+ std::cout<<"Width : "<<pVih->bmiHeader.biWidth<<", Height : "<<abs(pVih->bmiHeader.biHeight);
+ std::cout<<", biBitCount : "<<pVih->bmiHeader.biBitCount<<std::endl;
+ if(RGB_CHANNELBIT <= pVih->bmiHeader.biBitCount)
+ {
+ /* ç»é¢ãµã¤ãº */
+ v_Width = pVih->bmiHeader.biWidth;
+ v_Height = pVih->bmiHeader.biHeight;
+ v_Channel = RGB_CHANNEL;
+ pConfig->SetFormat(pmtConfig);
+ bFound = true;
+ }
+ }
+ DeleteMediaType(pmtConfig);
+
+ if(bFound){
+ break;
+ }
+ }
+ }
+ }
+
+ /* åå¾ããã¤ã¡ã¼ã¸ã®Bufferæºå */
+ CoCreateInstance(CLSID_SampleGrabber, NULL, CLSCTX_INPROC_SERVER,
+ IID_IBaseFilter, reinterpret_cast<void**>(&pF));
+ pF->QueryInterface(IID_ISampleGrabber,(void**)&pGrab);
+ pGraph->AddFilter(pF, L"Sample Grabber");
+
+ AM_MEDIA_TYPE mt;
+ ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
+ mt.majortype = MEDIATYPE_Video;
+ mt.subtype = MEDIASUBTYPE_RGB24;
+ pGrab->SetMediaType(&mt);
+
+ pGrab->SetOneShot(FALSE);
+ pGrab->SetBufferSamples(FALSE);
+
+ pBuilder->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pSrc, NULL, pF );
+
+ pGrab->GetConnectedMediaType(&mt);
+ VIDEOINFOHEADER *pVideoHeader = (VIDEOINFOHEADER*)mt.pbFormat;
+
+ /* ãã㪠ãããã¼ã«ã¯ï¼ããããããæ
å ±ãå«ã¾ãã */
+ /* ããããããæ
å ±ã BITMAPINFO æ§é ä½ã«ã³ãã¼ */
+ BITMAPINFO BitmapInfo;
+ ZeroMemory(&BitmapInfo, sizeof(BitmapInfo) );
+ memcpy(&BitmapInfo.bmiHeader, &(pVideoHeader->bmiHeader), sizeof(BITMAPINFOHEADER));
+
+ buffersize = BitmapInfo.bmiHeader.biSizeImage;
+ pBuffer = new char[buffersize];
+
+ /* ã¼ã«ããã¯Classã«Bufferã渡ã */
+ if(pBuffer !=NULL)
+ {
+ m_cb.SetBufferPtr(pBuffer);
+ }
+
+ /* ã¤ã¡ã¼ã¸ãåå¾ããå¾å¼ã°ããã³ã¼ã«ãã㯠*/
+ if(pGrab->SetCallback(&m_cb,1)!=S_OK)
+ {
+ std::cout<<"SetCallback error!\n";
+ return RTC::RTC_ERROR;
+ }
+
+ FreeMediaType(mt);
+ /* ã¤ã¡ã¼ã¸åå¾ãã */
+ pMediaControl->Run();
+
+ return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t DirectShowCam::onDeactivated(RTC::UniqueId ec_id)
+{
+
+ if(bFound)
+ {
+ pMediaControl->Stop();
+ pMediaControl->Release();
+ pF->Release();
+
+ pSrc->Release();
+ pGrab->Release();
+ pBuilder->Release();
+ pGraph->Release();
+
+ m_cb.DetachBuffer();
+ delete [] pBuffer;
+ }
+
+ if(pSrc!=NULL)
+ pSrc->Release();
+
+ CoUninitialize();
+ CloseHandle(m_cb.hEvent);
+
+ return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t DirectShowCam::onExecute(RTC::UniqueId ec_id)
+{
+ static coil::TimeValue tm_pre;
+ static int count = 0;
+
+ /* ã¤ã¡ã¼ã¸åå¾ããã¾ã§å¾
㤠*/
+ int ret = WaitForSingleObject(m_cb.hEvent, INFINITE);
+
+ if(ret==WAIT_FAILED || ret==WAIT_ABANDONED || ret==WAIT_TIMEOUT)
+ {
+ std::cout<<"WatiForSingleObjec Error!"<<std::endl;
+ return RTC::RTC_ERROR;
+ }
+
+ /* ä¸ä¸å¤æ */
+ // m_flip(pBuffer, v_Width, abs(v_Height), v_Channel);
+
+ int len = v_Channel * v_Width * abs(v_Height);
+
+ /* åºåã¢ã¦ããã¼ãè¨å® */
+ m_FIN_OUTPORT.pixels.length(len);
+ m_FIN_OUTPORT.width = v_Width;
+ m_FIN_OUTPORT.height = abs(v_Height);
+
+ memcpy((void *)&(m_FIN_OUTPORT.pixels[0]), pBuffer, len);
+
+ m_FIN_OUTPORTOut.write();
+
+ if (count > 100)
+ {
+ count = 0;
+ coil::TimeValue tm;
+ tm = coil::gettimeofday();
+
+ double sec(tm - tm_pre);
+
+ if (sec > 1.0 && sec < 1000.0)
+ {
+ std::cout << 100/sec << " [FPS]" << std::endl;
+ }
+
+ tm_pre = tm;
+ }
+ ++count;
+
+ return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t DirectShowCam::onAborting(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t DirectShowCam::onError(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t DirectShowCam::onReset(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t DirectShowCam::onStateUpdate(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t DirectShowCam::onRateChanged(RTC::UniqueId ec_id)
+{
+ return RTC::RTC_OK;
+}
+*/
+
+
+
+extern "C"
+{
+
+ void DirectShowCamInit(RTC::Manager* manager)
+ {
+ coil::Properties profile(directshowcam_spec);
+ manager->registerFactory(profile,
+ RTC::Create<DirectShowCam>,
+ RTC::Delete<DirectShowCam>);
+ }
+
+};
+
+
More information about the openrtm-commit
mailing list