diff --git a/cmake/dependencies/glew.cmake b/cmake/dependencies/glew.cmake index 00ef19bce..29ed756d5 100644 --- a/cmake/dependencies/glew.cmake +++ b/cmake/dependencies/glew.cmake @@ -52,6 +52,19 @@ EXTERNALPROJECT_ADD( URL_MD5 ${_download_hash} DOWNLOAD_NAME ${_target}_${_version}.zip DOWNLOAD_DIR ${RV_DEPS_DOWNLOAD_DIR} + # Patch to fix the build issue with OpenGL-Registry + # Pinning the OpenGL-Registry version to a specific commit + # https://github.com/nigels-com/glew/issues/449 + # Also clone the required glfixes repository + PATCH_COMMAND + cd auto && + git clone https://github.com/KhronosGroup/OpenGL-Registry.git || true && + cd OpenGL-Registry && + git checkout a77f5b6ffd0b0b74904f755ae977fa278eac4e95 && + cd .. && + git clone --depth=1 --branch glew https://github.com/nigels-com/glfixes glfixes || true && + touch OpenGL-Registry/.dummy && + cd .. CONFIGURE_COMMAND cd auto && ${_make_command} && cd .. && ${_make_command} BUILD_COMMAND ${_make_command} -j${_cpu_count} GLEW_DEST=${_install_dir} INSTALL_COMMAND ${_make_command} install LIBDIR=${_lib_dir} GLEW_DEST=${_install_dir} diff --git a/cmake/dependencies/ocio.cmake b/cmake/dependencies/ocio.cmake index 62ed6cd0d..1a0d586a5 100644 --- a/cmake/dependencies/ocio.cmake +++ b/cmake/dependencies/ocio.cmake @@ -124,7 +124,7 @@ LIST(APPEND _byproducts "${_pyocio_lib}") # Assemble CMake configure options # # The '_configure_options' list gets reset and initialized in 'RV_CREATE_STANDARD_DEPS_VARIABLES' -LIST(APPEND _configure_options "-DOCIO_BUILD_TESTS=ON") +LIST(APPEND _configure_options "-DOCIO_BUILD_TESTS=OFF") LIST(APPEND _configure_options "-DOCIO_BUILD_GPU_TESTS=OFF") LIST(APPEND _configure_options "-DOCIO_BUILD_PYTHON=ON") # This build PyOpenColorIO diff --git a/src/lib/image/MovieFFMpeg/CMakeLists.txt b/src/lib/image/MovieFFMpeg/CMakeLists.txt index 5a8ba29a6..c0029ecd1 100644 --- a/src/lib/image/MovieFFMpeg/CMakeLists.txt +++ b/src/lib/image/MovieFFMpeg/CMakeLists.txt @@ -24,14 +24,13 @@ TARGET_INCLUDE_DIRECTORIES( TARGET_LINK_LIBRARIES( ${_target} - PUBLIC TwkMovie + PUBLIC TwkMovie ffmpeg::avutil PRIVATE mp4v2Utils Boost::filesystem TwkUtil TwkFB ffmpeg::avcodec ffmpeg::avformat - ffmpeg::avutil ffmpeg::swscale ) diff --git a/src/lib/image/MovieFFMpeg/MovieFFMpeg.cpp b/src/lib/image/MovieFFMpeg/MovieFFMpeg.cpp index 2ef45dfee..d97d3ee82 100644 --- a/src/lib/image/MovieFFMpeg/MovieFFMpeg.cpp +++ b/src/lib/image/MovieFFMpeg/MovieFFMpeg.cpp @@ -1480,6 +1480,7 @@ namespace TwkMovie avcodec_free_context(avCodecContext); return false; } + m_pxlFormatOnOpen = nativeFormat; } // @@ -3912,6 +3913,26 @@ namespace TwkMovie AVPixelFormat nativeFormat = videoCodecContext->sw_pix_fmt; outFrame->format = nativeFormat; const AVPixFmtDescriptor* desc = av_pix_fmt_desc_get(nativeFormat); + if (!desc && nativeFormat == AV_PIX_FMT_NONE) + { + static bool warned = false; + if (!warned) + { + std::cout << "WARNING: FFmpeg detected pixel format " + "AV_PIX_FMT_NONE for frames in " + << m_filename << ". Using fallback pixel format: " + << av_get_pix_fmt_name(m_pxlFormatOnOpen) + << std::endl; + warned = true; + } + // Use the pixel format detected when the file was opened as a + // fallback. Assumes that m_pxlFormatOnOpen is set because the file + // was opened. + outFrame->format = m_pxlFormatOnOpen; + nativeFormat = m_pxlFormatOnOpen; + desc = av_pix_fmt_desc_get(nativeFormat); + } + int bitSize = desc->comp[0].depth - desc->comp[0].shift; int numPlanes = 0; bool hasAlpha = (desc->flags & AV_PIX_FMT_FLAG_ALPHA); diff --git a/src/lib/image/MovieFFMpeg/MovieFFMpeg/MovieFFMpeg.h b/src/lib/image/MovieFFMpeg/MovieFFMpeg/MovieFFMpeg.h index 6129ebbba..0fc4cb771 100644 --- a/src/lib/image/MovieFFMpeg/MovieFFMpeg/MovieFFMpeg.h +++ b/src/lib/image/MovieFFMpeg/MovieFFMpeg/MovieFFMpeg.h @@ -11,6 +11,10 @@ #include #include #include +extern "C" +{ +#include +} // // AVClass Forward Declaration Placeholders @@ -284,6 +288,7 @@ namespace TwkMovie AudioState* m_audioState; bool m_cloning{false}; bool m_mustReadFirstFrame{false}; + AVPixelFormat m_pxlFormatOnOpen{AV_PIX_FMT_NONE}; friend class ContextPool; };