From 23786604c6cdacd2e1821bde0cc37a62226c65b7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 4 Oct 2012 13:45:54 +0000 Subject: [PATCH] From Stephan Huber, "attached you'll find a fix for Registry.cpp not using the QTKit-plugin for video-files. W/o this fix you had to preload the plugin to open movie-files." --- CMakeModules/FindQuickTime.cmake | 6 ++++++ src/osgDB/CMakeLists.txt | 4 +++- src/osgDB/Registry.cpp | 9 ++++----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CMakeModules/FindQuickTime.cmake b/CMakeModules/FindQuickTime.cmake index cc6767f05..240cb8e23 100644 --- a/CMakeModules/FindQuickTime.cmake +++ b/CMakeModules/FindQuickTime.cmake @@ -63,4 +63,10 @@ IF(APPLE) SET(QUICKTIME_FOUND "NO") ENDIF() ENDIF() + # Disable quicktime for >= 10.7, as it's officially deprecated + + IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9") + MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}") + SET(QUICKTIME_FOUND "NO") + ENDIF() ENDIF() diff --git a/src/osgDB/CMakeLists.txt b/src/osgDB/CMakeLists.txt index d72ecd1ce..db49b50bc 100644 --- a/src/osgDB/CMakeLists.txt +++ b/src/osgDB/CMakeLists.txt @@ -133,7 +133,9 @@ IF(APPLE) ADD_DEFINITIONS(-DDARWIN_IMAGEIO) ENDIF() ENDIF() - +IF(QTKIT_FOUND) + ADD_DEFINITIONS(-DUSE_QTKIT) +ENDIF() IF(QUICKTIME_FOUND) ADD_DEFINITIONS(-DUSE_QUICKTIME) ENDIF() diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 22093d92f..2aae0f56c 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -317,7 +317,7 @@ Registry::Registry() #endif -#if defined(DARWIN_QTKIT) +#if defined(USE_QTKIT) addFileExtensionAlias("mov", "QTKit"); addFileExtensionAlias("mp4", "QTKit"); addFileExtensionAlias("mov", "QTKit"); @@ -326,7 +326,6 @@ Registry::Registry() addFileExtensionAlias("mpv", "QTKit"); addFileExtensionAlias("m4v", "QTKit"); addFileExtensionAlias("3gp", "QTKit"); - addFileExtensionAlias("live", "QTKit"); // Requires Perian addFileExtensionAlias("avi", "QTKit"); addFileExtensionAlias("xvid", "QTKit"); @@ -347,8 +346,8 @@ Registry::Registry() addFileExtensionAlias("tga", "qt"); addFileExtensionAlias("flv", "qt"); addFileExtensionAlias("dv", "qt"); - #if !defined(DARWIN_QTKIT) - + + #if !defined(USE_QTKIT) addFileExtensionAlias("mov", "qt"); addFileExtensionAlias("avi", "qt"); addFileExtensionAlias("mpg", "qt"); @@ -380,7 +379,7 @@ Registry::Registry() // support QuickTime for Windows // Logic error here. It is possible for Apple to not define Quicktime and end up in // this Quicktime for Windows block. So add an extra check to avoid QTKit clashes. - #if defined(USE_QUICKTIME) && !defined(DARWIN_QTKIT) + #if defined(USE_QUICKTIME) && !defined(USE_QTKIT) addFileExtensionAlias("mov", "qt"); addFileExtensionAlias("live", "qt");