Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmake/dependencies/glew.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion cmake/dependencies/ocio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions src/lib/image/MovieFFMpeg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
21 changes: 21 additions & 0 deletions src/lib/image/MovieFFMpeg/MovieFFMpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,7 @@ namespace TwkMovie
avcodec_free_context(avCodecContext);
return false;
}
m_pxlFormatOnOpen = nativeFormat;
}

//
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/lib/image/MovieFFMpeg/MovieFFMpeg/MovieFFMpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#include <TwkMovie/MovieWriter.h>
#include <TwkMovie/MovieIO.h>
#include <stdint.h>
extern "C"
{
#include <libavutil/pixfmt.h>
}

//
// AVClass Forward Declaration Placeholders
Expand Down Expand Up @@ -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;
};
Expand Down
Loading