Commit ce41ee9c authored by Cory Quammen's avatar Cory Quammen Committed by Kitware Robot

Merge topic 'ffmpeg-video-source-fix'

15b3bb2d ffmpeg: check for existence of avcodec_end_packet
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !4759
parents 5765319a 15b3bb2d
......@@ -60,4 +60,14 @@ int main()
}\n")
check_c_source_compiles("${_source}" VTK_FFMPEG_AVCODECID)
endif()
if (NOT DEFINED VTK_FFMPEG_AVCODEC_SEND_PACKET)
set(_source "
#include <${FFMEG_CODEC_HEADER_PATH}/avcodec.h>
int main()
{
avcode_send_packet(0, 0);
return 0;
}\n")
check_c_source_compiles("${_source}" VTK_FFMPEG_AVCODEC_SEND_PACKET)
endif()
endif()
......@@ -2,10 +2,16 @@ find_package(FFMPEG)
include(vtkTestFFMPEG)
set(Module_SRCS
vtkFFMPEGVideoSource.cxx
vtkFFMPEGWriter.cxx
)
# vtkFFMPEGVideoSource equires ffmpeg 3.1 or later
if (VTK_FFMPEG_AVCODEC_SEND_PACKET)
list(APPEND Module_SRCS
vtkFFMPEGVideoSource.cxx
)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkFFMPEGConfig.h.in
${CMAKE_CURRENT_BINARY_DIR}/vtkFFMPEGConfig.h @ONLY
)
......
vtk_add_test_cxx(vtkIOFFMPEGCxxTests tests
TestFFMPEGVideoSource.cxx
TestFFMPEGWriter.cxx,NO_VALID
)
if (VTK_FFMPEG_AVCODEC_SEND_PACKET)
vtk_add_test_cxx(vtkIOFFMPEGCxxTests tests
TestFFMPEGVideoSource.cxx
)
endif()
vtk_test_cxx_executable(vtkIOFFMPEGCxxTests tests)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment