[vtk-developers] Proposed VTK_USE_VIDEO_FOR_WINDOWS / vfw32 / vtkAVIWriter changes

Mathieu Malaterre mathieu.malaterre at kitware.com
Thu Aug 18 12:25:26 EDT 2005


David,

	Unless you have a different vtkTestvfw32.cxx, I believe the test is not 
sufficient. You need to check also for types like:

CAPSTATUS, CAPDRIVERCAPS, CONTROLCALLBACK_PREROLL

cf:
http://vtk.org/Bug/bug.php?op=show&bugid=635&pos=4
and
http://www.cygwin.com/ml/cygwin/2004-03/msg00022.html

	I believe vtkAVIWriter.cxx can be compiled fine on cygwin but not 
vtkWin32VideoSource.cxx

my 2 cents,
Mathieu

David Cole wrote:
> Unless I hear objections, I'll commit the proposed changes within the 
> next day or so. The cvs diff of VTK/CMakeLists.txt appears at the end of 
> the email.
> 
> Currently, VTK_USE_VIDEO_FOR_WINDOWS:
> - defaults to OFF
> - has documentation string : "Use Video for Windows for video input."
> - depends on VTK_USE_RENDERING and WIN32
> - is an "advanced" option
> - if ON, includes Hybrid/vtkWin32VideoSource.cxx and, as of yesterday, 
> IO/vtkAVIWriter.cxx as source files
> - if ON, includes vfw32 as a link library for vtkHybrid and vtkIO
> 
> I propose:
> - Changing the *default* value of VTK_USE_VIDEO_FOR_WINDOWS to the 
> result of a TRY_COMPILE that tells us whether you can successfully 
> compile and link against vfw32. (You would still be able to change it or 
> specify it explicitly.)
> - Changing the documentation string of VTK_USE_VIDEO_FOR_WINDOWS to read 
> "Enable using Video for Windows (vfw32) for video input and output."
> - Eliminating the option's dependence on VTK_USE_RENDERING and WIN32 and 
> relying exlusively on the results of the TRY_COMPILE.
> 
> More info:
> The TRY_COMPILE would only be executed once if VTK_USE_VIDEO_FOR_WINDOWS 
> is NOT already defined (from a previous run, in the  initial cache or on 
> the cmake command line...) The source for the TRY_COMPILE is already 
> checked in to VTK/CMake/vtkTestvfw32.cxx.
> 
> This way, if you can link against vfw32, you'll get the vfw32 dependent 
> stuff included automatically in your VTK build. Our reasoning behind 
> this change is this: we have the TRY_COMPILE technology and we want to 
> get the vtkAVIWriter included on Windows builds by default...
> 
> Thanks,
> David Cole
> Kitware, Inc.
> 
> 
> ===== PROPOSED CHANGE =====
> 
> C:\CvsServers\public.kitware.com\VTK>cvs diff CMakeLists.txt
> Index: CMakeLists.txt
> ===================================================================
> RCS file: /cvsroot/VTK/VTK/CMakeLists.txt,v
> retrieving revision 1.334
> diff -r1.334 CMakeLists.txt
> 717a718,743
>  > # Check for vfw32 support
>  > IF("VTK_USE_VIDEO_FOR_WINDOWS" MATCHES "^VTK_USE_VIDEO_FOR_WINDOWS$")
>  >   MESSAGE(STATUS "Checking if vfw32 is available")
>  >   TRY_COMPILE(VTK_USE_VIDEO_FOR_WINDOWS_TRY_COMPILE
>  >     ${VTK_BINARY_DIR}/CMakeTmp
>  >     ${VTK_SOURCE_DIR}/CMake/vtkTestvfw32.cxx
>  >     CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=vfw32"
>  >     OUTPUT_VARIABLE OUTPUT)
>  >   IF(VTK_USE_VIDEO_FOR_WINDOWS_TRY_COMPILE)
>  >     MESSAGE(STATUS "Checking if vfw32 is available -- yes")
>  >     SET(VTK_USE_VIDEO_FOR_WINDOWS 1 CACHE BOOL "Enable using Video 
> for Windows (vfw32) for video input and output.")
>  >     WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
>  >       "Checking if vfw32 is available "
>  >       "passed with the following output:\n"
>  >       "${OUTPUT}\n" APPEND)
>  >   ELSE(VTK_USE_VIDEO_FOR_WINDOWS_TRY_COMPILE)
>  >     MESSAGE(STATUS "Checking if vfw32 is available -- no")
>  >     SET(VTK_USE_VIDEO_FOR_WINDOWS 0 CACHE BOOL "Enable using Video 
> for Windows (vfw32) for video input and output.")
>  >     WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
>  >       "Checking if vfw32 is available "
>  >       "failed with the following output:\n"
>  >       "${OUTPUT}\n" APPEND)
>  >   ENDIF(VTK_USE_VIDEO_FOR_WINDOWS_TRY_COMPILE)
>  >   MARK_AS_ADVANCED(VTK_USE_VIDEO_FOR_WINDOWS)
>  > ENDIF("VTK_USE_VIDEO_FOR_WINDOWS" MATCHES "^VTK_USE_VIDEO_FOR_WINDOWS$")
>  >
> 851,853d876
> < VTK_DEPENDENT_OPTION(VTK_USE_VIDEO_FOR_WINDOWS
> <                      "Use Video for Windows for video input." OFF
> <                      "VTK_USE_RENDERING;WIN32" OFF)
> 861,862c884
> <                  VTK_USE_MPI
> <                  VTK_USE_VIDEO_FOR_WINDOWS)
> ---
>  >                  VTK_USE_MPI)
> 
> 
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
> 




More information about the vtk-developers mailing list