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

David Cole david.cole at kitware.com
Thu Aug 18 14:55:04 EDT 2005


OK, objection registered this time. Idea needs more brewing... :-)

Sounds like you want vtkAVIWriter from cygwin, but we can't compile 
vtkWin32VideoSource.cxx there (I'm running a test compile under cygwin 
right now to verify that's still the case.)

Should we leave the VTK_USE_VIDEO_FOR_WINDOWS setting as is and then add 
a new flag that's the internal only result of the TRY_COMPILE to decide 
about including vtkAVIWriter? Is that the optimum solution?


David

Mathieu Malaterre wrote:

> My objection is that people on cygwin will not be able to turn the 
> option ON to get vtkAVIWriter, as I explained in the previous mail. 
> Your test only check for AVI symbols. But nothing is done to make sure 
> that headers files are ready to compile vtkWin32VideoSource.cxx.
>
> Therefore if I update the test cygwin will be recognize as a broken 
> system for both vtkWin32VideoSource.cxx and vtkAVIWriter. Whereas 
> vtkAVIWriter is valid on this system
>
> Hoping to be clear this time,
> Mathieu
>
> David Cole wrote:
>
>> But if the TRY_COMPILE succeeds, it means that the compiler has 
>> successfully found windows.h and vfw.h and that the executable 
>> produced was successfully linked against vfw32.lib... Isn't that 
>> sufficient to decide that we should *try* to enable video for windows 
>> *by default*? If you have a more complete try-compile test that would 
>> make a better decision, feel free to attach it in a response.
>>
>> Users with problems can still explicitly set 
>> VTK_USE_VIDEO_FOR_WINDOWS to OFF.
>>
>> Another alternative I considered was introducing a separate variable 
>> for TRY_COMPILE; say, VTK_HAVE_VFW32, that would then be used to 
>> include the vtkAVIWriter class. And then just leave the 
>> VTK_USE_VIDEO_FOR_WINDOWS stuff as is.
>>
>> Any other thoughts?
>>
>> Still waiting for a solid objection,
>> David
>>
>>
>> Mathieu Malaterre wrote:
>>
>>> 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
>>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> 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