Merge branch 'master' into blender2.8

This commit is contained in:
Sergey Sharybin 2017-09-25 18:56:34 +05:00
commit 98ba302f70
74 changed files with 176 additions and 2186 deletions

@ -336,10 +336,6 @@ option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd
option(WITH_ALEMBIC "Enable Alembic Support" OFF)
option(WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF)
if(APPLE)
option(WITH_CODEC_QUICKTIME "Enable Quicktime Support" OFF)
endif()
# 3D format support
# Disable opencollada when we don't have precompiled libs
option(WITH_OPENCOLLADA "Enable OpenCollada Support (http://www.opencollada.org)" ${_init_OPENCOLLADA})
@ -711,10 +707,6 @@ if(WITH_AUDASPACE)
endif()
endif()
if(APPLE)
apple_check_quicktime()
endif()
#-----------------------------------------------------------------------------
# Check for valid directories
# ... a partial checkout may cause this.
@ -1712,4 +1704,3 @@ endif()
if(0)
print_all_vars()
endif()

@ -78,7 +78,9 @@ include(cmake/openvdb.cmake)
include(cmake/python.cmake)
include(cmake/python_site_packages.cmake)
include(cmake/numpy.cmake)
if (WITH_WEBP)
include(cmake/webp.cmake)
endif()
if(WIN32)
include(cmake/hidapi.cmake)
endif()
@ -94,6 +96,7 @@ else()
endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/openjpeg.cmake)
if(BUILD_MODE STREQUAL Release)
if(WIN32)
include(cmake/zlib_mingw.cmake)
@ -107,7 +110,6 @@ if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/schroedinger.cmake)
include(cmake/x264.cmake)
include(cmake/xvidcore.cmake)
include(cmake/openjpeg.cmake)
include(cmake/faad.cmake)
include(cmake/ffmpeg.cmake)
include(cmake/fftw.cmake)

@ -32,12 +32,31 @@ endif()
if(WIN32)
set(PNG_LIBNAME libpng16_static${LIBEXT})
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2)
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2 -DOPJ_STATIC=1)
set(OPENJPEG_POSTFIX _msvc)
else()
set(PNG_LIBNAME libpng${LIBEXT})
set(OIIO_SIMD_FLAGS)
endif()
if (WITH_WEBP)
set(WEBP_ARGS -DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT} )
set(WEBP_DEP external_webp)
endif()
if (MSVC)
set(OPENJPEG_FLAGS -DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
-DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjpeg${LIBEXT}
)
else()
set(OPENJPEG_FLAGS -DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
)
endif()
set(OPENIMAGEIO_EXTRA_ARGS
-DBUILDSTATIC=ON
${OPENIMAGEIO_LINKSTATIC}
@ -78,8 +97,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DTIFF_INCLUDE_DIR=${LIBDIR}/tiff/include
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
${OPENJPEG_FLAGS}
-DOCIO_PATH=${LIBDIR}/opencolorio/
-DOpenEXR_USE_STATIC_LIBS=On
-DOPENEXR_HOME=${LIBDIR}/openexr/
@ -93,8 +111,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf-2_2${LIBEXT}
-DSTOP_ON_WARNING=OFF
-DWEBP_INCLUDE_DIR=${LIBDIR}/webp/include
-DWEBP_LIBRARY=${LIBDIR}/webp/lib/${LIBPREFIX}webp${LIBEXT}
${WEBP_FLAGS}
${OIIO_SIMD_FLAGS}
)
@ -109,7 +126,7 @@ ExternalProject_Add(external_openimageio
INSTALL_DIR ${LIBDIR}/openimageio
)
add_dependencies(external_openimageio external_png external_zlib external_ilmbase external_openexr external_jpeg external_boost external_tiff external_webp external_opencolorio external_openjpeg)
add_dependencies(external_openimageio external_png external_zlib external_ilmbase external_openexr external_jpeg external_boost external_tiff external_opencolorio external_openjpeg${OPENJPEG_POSTFIX} ${WEBP_DEP})
if(NOT WIN32)
add_dependencies(external_openimageio external_opencolorio_extra)
endif()

@ -38,6 +38,19 @@ ExternalProject_Add(external_openjpeg
INSTALL_DIR ${LIBDIR}/openjpeg
)
#on windows ffmpeg wants a mingw build, while oiio needs a msvc build
if (MSVC)
set(OPENJPEG_EXTRA_ARGS ${DEFAULT_CMAKE_FLAGS})
ExternalProject_Add(external_openjpeg_msvc
URL ${OPENJPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${OPENJPEG_HASH}
PREFIX ${BUILD_DIR}/openjpeg_msvc
CMAKE_ARGS ${OPENJPEG_EXTRA_ARGS} -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openjpeg_msvc -DBUILD_SHARED_LIBS=Off -DBUILD_THIRDPARTY=OFF
INSTALL_DIR ${LIBDIR}/openjpeg_msvc
)
endif()
set(OPENJPEG_LIBRARY libopenjpeg${LIBEXT})
if(MSVC)
set_target_properties(external_openjpeg PROPERTIES FOLDER Mingw)

@ -19,6 +19,7 @@
if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/lapack/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
if(NOT BUILD_MODE)

@ -195,9 +195,11 @@ set(XVIDCORE_VERSION 1.3.4)
set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH 4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f)
set(OPENJPEG_VERSION 1.5)
#this has to be in sync with the version in blenders /extern folder
set(OPENJPEG_VERSION 1.5.2)
set(OPENJPEG_SHORT_VERSION 1.5)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/version.${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 60662566595e02104c0f6d1052f8b1669624c646e62b6280d5fd5a66d4e92f8d)
set(OPENJPEG_HASH 3734e95edd0bef6e056815591755efd822228dc3cd866894e00a2c929026b16d)
set(FAAD_VERSION 2-2.7)
set(FAAD_URI http://downloads.sourceforge.net/faac/faad${FAAD_VERSION}.tar.bz2)

@ -731,7 +731,7 @@ PRINT ""
# This has to be done here, because user might force some versions...
PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
NUMPY_SOURCE=( "https://github.com/numpy/numpy/releases/download/v$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
_boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" )

@ -1,10 +1,11 @@
--- CMakeLists.txt 2016-11-01 01:03:44 -0600
+++ CMakeLists.txt 2016-12-01 09:20:12 -0700
@@ -454,7 +454,6 @@
@@ -454,7 +454,7 @@
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
add_definitions (-DJAS_WIN_MSVC_BUILD)
- add_definitions (-DOPENEXR_DLL)
+ add_definitions (-DOPJ_STATIC)
if (LINKSTATIC)
add_definitions (-DBoost_USE_STATIC_LIBS=1)
else ()

@ -72,7 +72,6 @@ if 'cmake' in builder:
# Set up OSX architecture
if builder.endswith('x86_64_10_6_cmake'):
cmake_extra_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
cmake_extra_options.append('-DWITH_CODEC_QUICKTIME=OFF')
cmake_extra_options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.6')
cmake_extra_options.append('-DCUDA_HOST_COMPILER=/usr/local/cuda-hack/clang')
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-hack/nvcc')

@ -66,9 +66,7 @@ elseif(WIN32)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
elseif(APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
# include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake")
# apple_check_quicktime()
endif()

@ -56,7 +56,3 @@ set(WITH_SDL OFF CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT OFF CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE OFF CACHE BOOL "" FORCE)
if(APPLE)
set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE)
endif()

@ -67,9 +67,7 @@ elseif(WIN32)
set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE)
elseif(APPLE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE)
set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE)
# include("${CMAKE_CURRENT_SOURCE_DIR}/../platform/platform_apple_xcode.cmake")
# apple_check_quicktime()
endif()

@ -403,9 +403,6 @@ function(setup_liblinks
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
target_link_libraries(${target} ${SDL_LIBRARY})
endif()
if(WITH_CODEC_QUICKTIME)
target_link_libraries(${target} ${QUICKTIME_LIBRARIES})
endif()
if(WITH_IMAGE_TIFF)
target_link_libraries(${target} ${TIFF_LIBRARY})
endif()
@ -730,10 +727,6 @@ function(SETUP_BLENDER_SORTED_LIBS)
list(APPEND BLENDER_SORTED_LIBS bf_intern_itasc)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
endif()
if(WITH_MOD_BOOLEAN)
list(APPEND BLENDER_SORTED_LIBS extern_carve)
endif()

@ -201,13 +201,6 @@ set(PLATFORM_CFLAGS "-pipe -funsigned-char")
set(PLATFORM_LINKFLAGS
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio"
)
if(WITH_CODEC_QUICKTIME)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QTKit")
if(CMAKE_OSX_ARCHITECTURES MATCHES i386)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -framework QuickTime")
# libSDL still needs 32bit carbon quicktime
endif()
endif()
if(WITH_CXX11)
list(APPEND PLATFORM_LINKLIBS c++)

@ -124,12 +124,3 @@ if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
add_definitions("-DMACOSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}")
endif()
macro(apple_check_quicktime)
# QuickTime framework is no longer available in SDK 10.12+
if(WITH_CODEC_QUICKTIME AND ${OSX_SYSTEM} VERSION_GREATER 10.11)
set(WITH_CODEC_QUICKTIME OFF CACHE BOOL "" FORCE)
message(STATUS "QuickTime not supported by SDK ${OSX_SYSTEM}, disabling WITH_CODEC_QUICKTIME")
endif()
endmacro()

@ -160,9 +160,6 @@
* merged in docs.
*/
/** \defgroup quicktime QuickTime
* \ingroup blender
/** \defgroup gui GUI */
/** \defgroup wm Window Manager

@ -108,6 +108,8 @@ ATOMIC_INLINE unsigned int atomic_fetch_and_add_u(unsigned int *p, unsigned int
ATOMIC_INLINE unsigned int atomic_fetch_and_sub_u(unsigned int *p, unsigned int x);
ATOMIC_INLINE unsigned int atomic_cas_u(unsigned int *v, unsigned int old, unsigned int _new);
ATOMIC_INLINE void *atomic_cas_ptr(void **v, void *old, void *_new);
/* WARNING! Float 'atomics' are really faked ones, those are actually closer to some kind of spinlock-sync'ed operation,
* which means they are only efficient if collisions are highly unlikely (i.e. if probability of two threads
* working on the same pointer at the same time is very low). */

@ -179,6 +179,18 @@ ATOMIC_INLINE unsigned int atomic_cas_u(unsigned int *v, unsigned int old, unsig
#endif
}
/******************************************************************************/
/* Pointer operations. */
ATOMIC_INLINE void *atomic_cas_ptr(void **v, void *old, void *_new)
{
#if (LG_SIZEOF_PTR == 8)
return (void *)atomic_cas_uint64((uint64_t *)v, *(uint64_t *)&old, *(uint64_t *)&_new);
#elif (LG_SIZEOF_PTR == 4)
return (void *)atomic_cas_uint32((uint32_t *)v, *(uint32_t *)&old, *(uint32_t *)&_new);
#endif
}
/******************************************************************************/
/* float operations. */

@ -710,7 +710,7 @@ ccl_device_inline int shader_bsdf_sample(KernelGlobals *kg,
float *pdf)
{
const ShaderClosure *sc = shader_bsdf_pick(sd, &randu);
if(!sc) {
if(sc == NULL) {
*pdf = 0.0f;
return LABEL_NONE;
}

@ -540,6 +540,7 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg,
# else /* __SHADOW_RECORD_ALL__ */
/* Fallback to a slowest version which works on all devices. */
return shadow_blocked_transparent_stepped(kg,
sd,
shadow_sd,
state,
visibility,

@ -168,10 +168,6 @@ elseif(APPLE AND NOT WITH_X11)
)
endif()
if(WITH_CODEC_QUICKTIME)
add_definitions(-DWITH_QUICKTIME)
endif()
elseif(WITH_X11)
list(APPEND INC_SYS
${X11_X11_INCLUDE_PATH}

@ -45,7 +45,11 @@ void OpenVDBWriter::insert(const openvdb::GridBase::Ptr &grid)
void OpenVDBWriter::insert(const openvdb::GridBase &grid)
{
#if (OPENVDB_LIBRARY_MAJOR_VERSION_NUMBER == 3)
m_grids->push_back(grid.copyGrid());
#else
m_grids->push_back(grid.copyGridWithNewTree());
#endif
}
void OpenVDBWriter::insertFloatMeta(const openvdb::Name &name, const float value)

@ -571,8 +571,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
col.label(text="Textures:")
col.prop(md, "use_mirror_u", text="U")
col.prop(md, "use_mirror_v", text="V")
col.prop(md, "use_mirror_u", text="Flip U")
col.prop(md, "use_mirror_v", text="Flip V")
col = layout.column(align=True)
@ -582,6 +582,10 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
if md.use_mirror_v:
col.prop(md, "mirror_offset_v")
col = layout.column(align=True)
col.prop(md, "offset_u")
col.prop(md, "offset_v")
col = layout.column()
if md.use_mirror_merge is True:

@ -410,37 +410,6 @@ class RENDER_PT_output(RenderButtonsPanel, Panel):
if rd.use_multiview:
layout.template_image_views(image_settings)
if file_format == 'QUICKTIME':
quicktime = rd.quicktime
split = layout.split()
col = split.column()
col.prop(quicktime, "codec_type", text="Video Codec")
col.prop(quicktime, "codec_spatial_quality", text="Quality")
# Audio
col.prop(quicktime, "audiocodec_type", text="Audio Codec")
if quicktime.audiocodec_type != 'No audio':
split = layout.split()
if quicktime.audiocodec_type == 'LPCM':
split.prop(quicktime, "audio_bitdepth", text="")
split.prop(quicktime, "audio_samplerate", text="")
split = layout.split()
col = split.column()
if quicktime.audiocodec_type == 'AAC':
col.prop(quicktime, "audio_bitrate")
subsplit = split.split()
col = subsplit.column()
if quicktime.audiocodec_type == 'AAC':
col.prop(quicktime, "audio_codec_isvbr")
col = subsplit.column()
col.prop(quicktime, "audio_resampling_hq")
class RENDER_PT_encoding(RenderButtonsPanel, Panel):
bl_label = "Encoding"

@ -142,10 +142,6 @@ if(WITH_CODEC_AVI)
add_subdirectory(avi)
endif()
if(WITH_CODEC_QUICKTIME)
add_subdirectory(quicktime)
endif()
if(WITH_PYTHON)
add_subdirectory(python)
endif()

@ -174,6 +174,11 @@ void BKE_pose_eval_init(const struct EvaluationContext *eval_ctx,
struct Object *ob,
struct bPose *pose);
void BKE_pose_eval_init_ik(const struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *ob,
struct bPose *pose);
void BKE_pose_eval_bone(const struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *ob,

@ -83,8 +83,6 @@ typedef struct Global {
/* debug flag, G_DEBUG, G_DEBUG_PYTHON & friends, set python or command line args */
int debug;
bool have_quicktime;
/* this variable is written to / read from FileGlobal->fileflags */
int fileflags;

@ -43,8 +43,6 @@ struct Depsgraph;
struct EvaluationContext;
struct Main;
struct Object;
struct Base;
struct QuicktimeCodecData;
struct RenderData;
struct SceneLayer;
struct SceneRenderLayer;
@ -71,7 +69,6 @@ typedef enum eSceneCopyMethod {
struct Base *_setlooper_base_step(struct Scene **sce_iter, struct Base *base);
void free_avicodecdata(struct AviCodecData *acd);
void free_qtcodecdata(struct QuicktimeCodecData *acd);
void BKE_scene_free_ex(struct Scene *sce, const bool do_id_user);
void BKE_scene_free(struct Scene *sce);
@ -198,4 +195,3 @@ struct Depsgraph* BKE_scene_get_depsgraph(struct Scene *scene, struct SceneLayer
#endif
#endif

@ -397,16 +397,6 @@ if(WITH_CODEC_AVI)
add_definitions(-DWITH_AVI)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../quicktime
)
list(APPEND INC_SYS
${QUICKTIME_INCLUDE_DIRS}
)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_CODEC_FFMPEG)
list(APPEND SRC
intern/writeffmpeg.c

@ -559,12 +559,11 @@ void BKE_splineik_execute_tree(
/* *************** Depsgraph evaluation callbacks ************ */
void BKE_pose_eval_init(const struct EvaluationContext *eval_ctx,
Scene *scene,
void BKE_pose_eval_init(const struct EvaluationContext *UNUSED(eval_ctx),
Scene *UNUSED(scene),
Object *ob,
bPose *pose)
{
float ctime = BKE_scene_frame_get(scene); /* not accurate... */
bPoseChannel *pchan;
DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
@ -582,6 +581,16 @@ void BKE_pose_eval_init(const struct EvaluationContext *eval_ctx,
for (pchan = pose->chanbase.first; pchan != NULL; pchan = pchan->next) {
pchan->flag &= ~(POSE_DONE | POSE_CHAIN | POSE_IKTREE | POSE_IKSPLINE);
}
}
void BKE_pose_eval_init_ik(const struct EvaluationContext *eval_ctx,
Scene *scene,
Object *ob,
bPose *UNUSED(pose))
{
float ctime = BKE_scene_frame_get(scene); /* not accurate... */
DEBUG_PRINT("%s on %s\n", __func__, ob->id.name);
/* 2a. construct the IK tree (standard IK) */
BIK_initialize_tree(eval_ctx, scene, ob, ctime);

@ -34,6 +34,8 @@
* \ingroup bke
*/
#include "atomic_ops.h"
#include "BLI_math.h"
#include "BLI_edgehash.h"
#include "BLI_utildefines.h"
@ -1808,7 +1810,8 @@ void CDDM_recalc_looptri(DerivedMesh *dm)
cddm->dm.looptris.array_wip);
BLI_assert(cddm->dm.looptris.array == NULL);
SWAP(MLoopTri *, cddm->dm.looptris.array, cddm->dm.looptris.array_wip);
atomic_cas_ptr((void **)&cddm->dm.looptris.array, cddm->dm.looptris.array, cddm->dm.looptris.array_wip);
cddm->dm.looptris.array_wip = NULL;
}
static void cdDM_free_internal(CDDerivedMesh *cddm)

@ -41,6 +41,8 @@
* is likely to be a little slow.
*/
#include "atomic_ops.h"
#include "BLI_math.h"
#include "BLI_jitter.h"
#include "BLI_bitmap.h"
@ -300,7 +302,8 @@ static void emDM_recalcLoopTri(DerivedMesh *dm)
}
BLI_assert(dm->looptris.array == NULL);
SWAP(MLoopTri *, dm->looptris.array, dm->looptris.array_wip);
atomic_cas_ptr((void **)&dm->looptris.array, dm->looptris.array, dm->looptris.array_wip);
dm->looptris.array_wip = NULL;
}
static void emDM_foreachMappedVert(

@ -1204,7 +1204,6 @@ bool BKE_imtype_is_movie(const char imtype)
switch (imtype) {
case R_IMF_IMTYPE_AVIRAW:
case R_IMF_IMTYPE_AVIJPEG:
case R_IMF_IMTYPE_QUICKTIME:
case R_IMF_IMTYPE_FFMPEG:
case R_IMF_IMTYPE_H264:
case R_IMF_IMTYPE_THEORA:
@ -1276,7 +1275,6 @@ char BKE_imtype_valid_channels(const char imtype, bool write_file)
case R_IMF_IMTYPE_MULTILAYER:
case R_IMF_IMTYPE_DDS:
case R_IMF_IMTYPE_JP2:
case R_IMF_IMTYPE_QUICKTIME:
case R_IMF_IMTYPE_DPX:
chan_flag |= IMA_CHAN_FLAG_ALPHA;
break;
@ -1339,7 +1337,6 @@ char BKE_imtype_from_arg(const char *imtype_arg)
else if (STREQ(imtype_arg, "AVIRAW")) return R_IMF_IMTYPE_AVIRAW;
else if (STREQ(imtype_arg, "AVIJPEG")) return R_IMF_IMTYPE_AVIJPEG;
else if (STREQ(imtype_arg, "PNG")) return R_IMF_IMTYPE_PNG;
else if (STREQ(imtype_arg, "QUICKTIME")) return R_IMF_IMTYPE_QUICKTIME;
else if (STREQ(imtype_arg, "BMP")) return R_IMF_IMTYPE_BMP;
#ifdef WITH_HDR
else if (STREQ(imtype_arg, "HDR")) return R_IMF_IMTYPE_RADHDR;
@ -1450,7 +1447,7 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
}
}
#endif
else { // R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90, R_IMF_IMTYPE_QUICKTIME etc
else { // R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90 etc
if (!(BLI_testextensie_n(string, extension_test = ".jpg", ".jpeg", NULL)))
extension = extension_test;
}
@ -1458,8 +1455,7 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
if (extension) {
/* prefer this in many cases to avoid .png.tga, but in certain cases it breaks */
/* remove any other known image extension */
if (BLI_testextensie_array(string, imb_ext_image) ||
(G.have_quicktime && BLI_testextensie_array(string, imb_ext_image_qt)))
if (BLI_testextensie_array(string, imb_ext_image))
{
return BLI_replace_extension(string, FILE_MAX, extension);
}

@ -131,17 +131,6 @@ void free_avicodecdata(AviCodecData *acd)
}
}
void free_qtcodecdata(QuicktimeCodecData *qcd)
{
if (qcd) {
if (qcd->cdParms) {
MEM_freeN(qcd->cdParms);
qcd->cdParms = NULL;
qcd->cdSize = 0;
}
}
}
static void remove_sequencer_fcurves(Scene *sce)
{
AnimData *adt = BKE_animdata_from_id(&sce->id);
@ -402,12 +391,6 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
sce_dst->r.avicodecdata->lpParms = MEM_dupallocN(sce_dst->r.avicodecdata->lpParms);
}
/* make a private copy of the qtcodecdata */
if (sce_src->r.qtcodecdata) {
sce_dst->r.qtcodecdata = MEM_dupallocN(sce_src->r.qtcodecdata);
sce_dst->r.qtcodecdata->cdParms = MEM_dupallocN(sce_dst->r.qtcodecdata->cdParms);
}
if (sce_src->r.ffcodecdata.properties) { /* intentionally check sce_dst not sce_src. */ /* XXX ??? comment outdated... */
sce_dst->r.ffcodecdata.properties = IDP_CopyProperty_ex(sce_src->r.ffcodecdata.properties, flag_subdata);
}
@ -529,12 +512,6 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
sce_copy->r.avicodecdata->lpParms = MEM_dupallocN(sce_copy->r.avicodecdata->lpParms);
}
/* make a private copy of the qtcodecdata */
if (sce->r.qtcodecdata) {
sce_copy->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata);
sce_copy->r.qtcodecdata->cdParms = MEM_dupallocN(sce_copy->r.qtcodecdata->cdParms);
}
if (sce->r.ffcodecdata.properties) { /* intentionally check scen not sce. */
sce_copy->r.ffcodecdata.properties = IDP_CopyProperty(sce->r.ffcodecdata.properties);
}
@ -641,11 +618,6 @@ void BKE_scene_free_ex(Scene *sce, const bool do_id_user)
MEM_freeN(sce->r.avicodecdata);
sce->r.avicodecdata = NULL;
}
if (sce->r.qtcodecdata) {
free_qtcodecdata(sce->r.qtcodecdata);
MEM_freeN(sce->r.qtcodecdata);
sce->r.qtcodecdata = NULL;
}
if (sce->r.ffcodecdata.properties) {
IDP_FreeProperty(sce->r.ffcodecdata.properties);
MEM_freeN(sce->r.ffcodecdata.properties);

@ -42,6 +42,8 @@
#include <math.h>
#include <float.h>
#include "atomic_ops.h"
#include "MEM_guardedalloc.h"
#include "DNA_mesh_types.h"
@ -4251,7 +4253,8 @@ static void ccgDM_recalcLoopTri(DerivedMesh *dm)
}
BLI_assert(dm->looptris.array == NULL);
SWAP(MLoopTri *, dm->looptris.array, dm->looptris.array_wip);
atomic_cas_ptr((void **)&dm->looptris.array, dm->looptris.array, dm->looptris.array_wip);
dm->looptris.array_wip = NULL;
}
static void ccgDM_calcNormals(DerivedMesh *dm)

@ -80,10 +80,6 @@ static void *context_create_avi(void);
static void context_free_avi(void *context_v);
#endif /* WITH_AVI */
#ifdef WITH_QUICKTIME
# include "quicktime_export.h"
#endif
#ifdef WITH_FFMPEG
# include "BKE_writeffmpeg.h"
#endif
@ -115,16 +111,6 @@ bMovieHandle *BKE_movie_handle_get(const char imtype)
#endif
/* do the platform specific handles */
#ifdef WITH_QUICKTIME
if (imtype == R_IMF_IMTYPE_QUICKTIME) {
mh.start_movie = start_qt;
mh.append_movie = append_qt;
mh.end_movie = end_qt;
mh.get_movie_path = filepath_qt;
mh.context_create = context_create_qt;
mh.context_free = context_free_qt;
}
#endif
#ifdef WITH_FFMPEG
if (ELEM(imtype, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_XVID, R_IMF_IMTYPE_THEORA)) {
mh.start_movie = BKE_ffmpeg_start;

@ -133,12 +133,21 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(
{
/* not a loop (only to be able to break out) */
do {
const float area_2x_234 = cross_tri_v2(v2, v3, v4);
const float area_2x_241 = cross_tri_v2(v2, v4, v1);
bool is_zero_a, is_zero_b;
const float area_2x_123 = cross_tri_v2(v1, v2, v3);
const float area_2x_134 = cross_tri_v2(v1, v3, v4);
is_zero_a = (fabsf(area_2x_123) <= FLT_EPSILON);
is_zero_b = (fabsf(area_2x_134) <= FLT_EPSILON);
if (lock_degenerate && is_zero_a && is_zero_b) {
break;
}
const float area_2x_234 = cross_tri_v2(v2, v3, v4);
const float area_2x_241 = cross_tri_v2(v2, v4, v1);
BLI_assert((ELEM(v1, v2, v3, v4) == false) &&
(ELEM(v2, v1, v3, v4) == false) &&
(ELEM(v3, v1, v2, v4) == false) &&
@ -149,9 +158,7 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(
* - Area sign flipping to check faces aren't going to point in opposite directions.
* - Area epsilon check that the one of the faces won't be zero area.
*/
if (((area_2x_123 >= 0.0f) != (area_2x_134 >= 0.0f)) ||
(fabsf(area_2x_123) <= FLT_EPSILON) || (fabsf(area_2x_134) <= FLT_EPSILON))
{
if (is_zero_a || is_zero_b || ((area_2x_123 >= 0.0f) != (area_2x_134 >= 0.0f))) {
break;
}
@ -159,13 +166,8 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(
if (((area_2x_234 >= 0.0f) != (area_2x_241 >= 0.0f)) ||
((fabsf(area_2x_234) <= FLT_EPSILON) || (fabsf(area_2x_241) <= FLT_EPSILON)))
{
if (lock_degenerate) {
break;
}
else {
return -FLT_MAX; /* always rotate */
}
}
{
/* testing rule: the area divided by the perimeter,

@ -6289,11 +6289,6 @@ static void direct_link_scene(FileData *fd, Scene *sce, Main *bmain)
sce->r.avicodecdata->lpFormat = newdataadr(fd, sce->r.avicodecdata->lpFormat);
sce->r.avicodecdata->lpParms = newdataadr(fd, sce->r.avicodecdata->lpParms);
}
sce->r.qtcodecdata = newdataadr(fd, sce->r.qtcodecdata);
if (sce->r.qtcodecdata) {
sce->r.qtcodecdata->cdParms = newdataadr(fd, sce->r.qtcodecdata->cdParms);
}
if (sce->r.ffcodecdata.properties) {
sce->r.ffcodecdata.properties = newdataadr(fd, sce->r.ffcodecdata.properties);
IDP_DirectLinkGroup_OrFree(&sce->r.ffcodecdata.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);

@ -2739,13 +2739,6 @@ static void write_scene(WriteData *wd, Scene *sce)
writedata(wd, DATA, sce->r.avicodecdata->cbParms, sce->r.avicodecdata->lpParms);
}
}
if (sce->r.qtcodecdata) {
writestruct(wd, DATA, QuicktimeCodecData, 1, sce->r.qtcodecdata);
if (sce->r.qtcodecdata->cdParms) {
writedata(wd, DATA, sce->r.qtcodecdata->cdSize, sce->r.qtcodecdata->cdParms);
}
}
if (sce->r.ffcodecdata.properties) {
IDP_WriteProperty(sce->r.ffcodecdata.properties, wd);
}

@ -222,6 +222,15 @@ void DepsgraphNodeBuilder::build_rig(Scene *scene, Object *object)
DEG_OPCODE_POSE_INIT);
op_node->set_as_entry();
op_node = add_operation_node(&object->id,
DEG_NODE_TYPE_EVAL_POSE,
function_bind(BKE_pose_eval_init_ik,
_1,
scene_cow,
object_cow,
object_cow->pose),
DEG_OPCODE_POSE_INIT_IK);
op_node = add_operation_node(&object->id,
DEG_NODE_TYPE_EVAL_POSE,
function_bind(BKE_pose_eval_flush,

@ -83,7 +83,15 @@ void DepsgraphRelationBuilder::build_ik_pose(Object *ob,
* - see notes on direction of rel below...
*/
bPoseChannel *rootchan = BKE_armature_ik_solver_find_root(pchan, data);
OperationKey solver_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, rootchan->name, DEG_OPCODE_POSE_IK_SOLVER);
OperationKey pchan_local_key(&ob->id, DEG_NODE_TYPE_BONE,
pchan->name, DEG_OPCODE_BONE_LOCAL);
OperationKey init_ik_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT_IK);
OperationKey solver_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE,
rootchan->name,
DEG_OPCODE_POSE_IK_SOLVER);
add_relation(pchan_local_key, init_ik_key, "IK Constraint -> Init IK Tree");
add_relation(init_ik_key, solver_key, "Init IK -> IK Solver");
/* IK target */
// XXX: this should get handled as part of the constraint code
@ -300,9 +308,11 @@ void DepsgraphRelationBuilder::build_rig(Main *bmain, Scene *scene, Object *ob)
/* attach links between pose operations */
OperationKey init_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT);
OperationKey init_ik_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT_IK);
OperationKey flush_key(&ob->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE);
add_relation(init_key, flush_key, "[Pose Init -> Pose Cleanup]");
add_relation(init_key, init_ik_key, "Pose Init -> Pose Init IK");
add_relation(init_ik_key, flush_key, "Pose Init IK -> Pose Cleanup");
/* Make sure pose is up-to-date with armature updates. */
OperationKey armature_key(&arm->id,

@ -119,6 +119,7 @@ static const char *stringify_opcode(eDepsOperation_Code opcode)
STRINGIFY_OPCODE(GEOMETRY_UBEREVAL);
/* Pose. */
STRINGIFY_OPCODE(POSE_INIT);
STRINGIFY_OPCODE(POSE_INIT_IK);
STRINGIFY_OPCODE(POSE_DONE);
STRINGIFY_OPCODE(POSE_IK_SOLVER);
STRINGIFY_OPCODE(POSE_SPLINE_IK_SOLVER);

@ -178,8 +178,10 @@ typedef enum eDepsOperation_Code {
DEG_OPCODE_GEOMETRY_UBEREVAL,
/* Pose. -------------------------------------------- */
/* Init IK Trees, etc. */
/* Init pose, clear flags, etc. */
DEG_OPCODE_POSE_INIT,
/* Initialize IK solver related pose stuff. */
DEG_OPCODE_POSE_INIT_IK,
/* Free IK Trees + Compute Deform Matrices */
DEG_OPCODE_POSE_DONE,
/* IK/Spline Solvers */

@ -52,16 +52,6 @@ set(SRC
render_intern.h
)
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../../quicktime
)
list(APPEND INC_SYS
${QUICKTIME_INCLUDE_DIRS}
)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_HEADLESS)
add_definitions(-DWITH_HEADLESS)
endif()

@ -165,7 +165,7 @@ static int track_markers_initjob(bContext *C,
track_init_markers(sc, clip, framenr, &frames_limit);
tmj->sfra = ED_space_clip_get_clip_frame_number(sc);
tmj->sfra = framenr;
tmj->clip = clip;
tmj->backwards = backwards;
@ -176,6 +176,7 @@ static int track_markers_initjob(bContext *C,
else {
tmj->efra = EFRA;
}
tmj->efra = BKE_movieclip_remap_scene_to_clip_frame(clip, tmj->efra);
}
else {
if (backwards) {
@ -196,8 +197,6 @@ static int track_markers_initjob(bContext *C,
}
}
tmj->efra = BKE_movieclip_remap_scene_to_clip_frame(clip, tmj->efra);
if (settings->speed != TRACKING_SPEED_FASTEST) {
tmj->delay = 1.0f / scene->r.frs_sec * 1000.0f;
@ -310,6 +309,7 @@ static void track_markers_endjob(void *tmv)
static void track_markers_freejob(void *tmv)
{
TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
tmj->clip->tracking_context = NULL;
BKE_autotrack_context_free(tmj->context);
MEM_freeN(tmj);
}

@ -1994,8 +1994,7 @@ int ED_path_extension_type(const char *path)
else if (BLI_testextensie(path, ".abc")) {
return FILE_TYPE_ALEMBIC;
}
else if (BLI_testextensie_array(path, imb_ext_image) ||
(G.have_quicktime && BLI_testextensie_array(path, imb_ext_image_qt)))
else if (BLI_testextensie_array(path, imb_ext_image))
{
return FILE_TYPE_IMAGE;
}

@ -130,16 +130,6 @@ if(WITH_CODEC_AVI)
add_definitions(-DWITH_AVI)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../quicktime
)
list(APPEND INC_SYS
${QUICKTIME_INCLUDE_DIRS}
)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_CODEC_FFMPEG)
list(APPEND INC
../../../intern/ffmpeg

@ -295,7 +295,6 @@ typedef struct ImBuf {
#endif /* DDS */
extern const char *imb_ext_image[];
extern const char *imb_ext_image_qt[];
extern const char *imb_ext_movie[];
extern const char *imb_ext_audio[];

@ -63,12 +63,6 @@
# include "AVI_avi.h"
#endif
#ifdef WITH_QUICKTIME
# if defined(_WIN32) || defined(__APPLE__)
# include "quicktime_import.h"
# endif /* _WIN32 || __APPLE__ */
#endif /* WITH_QUICKTIME */
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@ -137,11 +131,6 @@ struct anim {
PGETFRAME pgf;
#endif
#ifdef WITH_QUICKTIME
/* quicktime */
struct _QuicktimeMovie *qtime;
#endif /* WITH_QUICKTIME */
#ifdef WITH_FFMPEG
AVFormatContext *pFormatCtx;
AVCodecContext *pCodecCtx;

@ -73,12 +73,6 @@
# include "AVI_avi.h"
#endif
#ifdef WITH_QUICKTIME
#if defined(_WIN32) || defined(__APPLE__)
#include "quicktime_import.h"
#endif /* _WIN32 || __APPLE__ */
#endif /* WITH_QUICKTIME */
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
@ -221,9 +215,6 @@ void IMB_free_anim(struct anim *anim)
free_anim_avi(anim);
#endif
#ifdef WITH_QUICKTIME
free_anim_quicktime(anim);
#endif
#ifdef WITH_FFMPEG
free_anim_ffmpeg(anim);
#endif
@ -1219,9 +1210,6 @@ static ImBuf *anim_getnew(struct anim *anim)
free_anim_avi(anim);
#endif
#ifdef WITH_QUICKTIME
free_anim_quicktime(anim);
#endif
#ifdef WITH_FFMPEG
free_anim_ffmpeg(anim);
#endif
@ -1250,12 +1238,6 @@ static ImBuf *anim_getnew(struct anim *anim)
ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0);
break;
#endif
#ifdef WITH_QUICKTIME
case ANIM_QTIME:
if (startquicktime(anim)) return (0);
ibuf = IMB_allocImBuf(anim->x, anim->y, 24, 0);
break;
#endif
#ifdef WITH_FFMPEG
case ANIM_FFMPEG:
if (startffmpeg(anim)) return (0);
@ -1345,21 +1327,6 @@ struct ImBuf *IMB_anim_absolute(struct anim *anim, int position,
anim->curposition = position;
break;
#endif
#ifdef WITH_QUICKTIME
case ANIM_QTIME:
ibuf = qtime_fetchibuf(anim, position);
if (ibuf) {
if (ibuf->rect) {
/* OCIO_TODO: should happen in quicktime module, but it currently doesn't have access
* to color management's internals
*/
ibuf->rect_colorspace = colormanage_colorspace_get_named(anim->colorspace);
}
anim->curposition = position;
}
break;
#endif
#ifdef WITH_FFMPEG
case ANIM_FFMPEG:
ibuf = ffmpeg_fetchibuf(anim, position, tc);

@ -47,10 +47,6 @@
#include "dds/dds_api.h"
#endif
#ifdef WITH_QUICKTIME
#include "quicktime_import.h"
#endif
static int imb_ftype_default(const ImFileType *type, ImBuf *ibuf)
{
return (ibuf->ftype == type->filetype);
@ -101,10 +97,6 @@ void imb_filetypes_init(void)
for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++)
if (type->init)
type->init();
#ifdef WITH_QUICKTIME
quicktime_init();
#endif
}
void imb_filetypes_exit(void)
@ -114,9 +106,5 @@ void imb_filetypes_exit(void)
for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++)
if (type->exit)
type->exit();
#ifdef WITH_QUICKTIME
quicktime_exit();
#endif
}

@ -52,10 +52,6 @@
#include "IMB_anim.h"
#ifdef WITH_QUICKTIME
#include "quicktime_import.h"
#endif
#ifdef WITH_FFMPEG
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
@ -107,28 +103,6 @@ const char *imb_ext_image_filepath_only[] = {
NULL
};
const char *imb_ext_image_qt[] = {
".gif",
".psd",
".pct", ".pict",
".pntg",
".qtif",
NULL
};
#if 0 /* UNUSED */
const char *imb_ext_movie_qt[] = {
".avi",
".flc",
".dv",
".r3d",
".mov",
".movie",
".mv",
NULL
};
#endif
const char *imb_ext_movie[] = {
".avi",
".flc",
@ -247,13 +221,6 @@ static int isavi(const char *name)
#endif
}
#ifdef WITH_QUICKTIME
static int isqtime(const char *name)
{
return anim_is_quicktime(name);
}
#endif
#ifdef WITH_FFMPEG
/* BLI_vsnprintf in ffmpeg_log_callback() causes invalid warning */
@ -383,9 +350,6 @@ int imb_get_anim_type(const char *name)
if (UTIL_DEBUG) printf("%s: %s\n", __func__, name);
#ifndef _WIN32
# ifdef WITH_QUICKTIME
if (isqtime(name)) return (ANIM_QTIME);
# endif
# ifdef WITH_FFMPEG
/* stat test below fails on large files > 4GB */
if (isffmpeg(name)) return (ANIM_FFMPEG);
@ -401,9 +365,6 @@ int imb_get_anim_type(const char *name)
if (((st.st_mode) & S_IFMT) != S_IFREG) return(0);
if (ismovie(name)) return (ANIM_MOVIE);
# ifdef WITH_QUICKTIME
if (isqtime(name)) return (ANIM_QTIME);
# endif
# ifdef WITH_FFMPEG
if (isffmpeg(name)) return (ANIM_FFMPEG);
# endif

@ -278,6 +278,7 @@ typedef struct MirrorModifierData {
short flag;
float tolerance;
float uv_offset[2];
float uv_offset_copy[2];
struct Object *mirror_ob;
} MirrorModifierData;

@ -96,42 +96,6 @@ typedef struct AviCodecData {
char avicodecname[128];
} AviCodecData;
typedef struct QuicktimeCodecData {
/*Old quicktime implementation compatibility fields, read only in 2.5 - deprecated*/
void *cdParms; /* codec/compressor options */
void *pad; /* padding */
unsigned int cdSize; /* size of cdParms buffer */
unsigned int pad2; /* padding */
char qtcodecname[128];
} QuicktimeCodecData;
typedef struct QuicktimeCodecSettings {
/* Codec settings detailed for 2.5 implementation*/
int codecType; /* Types defined in quicktime_export.h */
int codecSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
/* Settings not available in current QTKit API */
int codec;
int codecFlags;
int colorDepth;
int codecTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
int minSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
int minTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
int keyFrameRate;
int bitRate; /* bitrate in bps */
/* Audio Codec settings */
int audiocodecType;
int audioSampleRate;
short audioBitDepth;
short audioChannels;
int audioCodecFlags;
int audioBitRate;
int pad1;
} QuicktimeCodecSettings;
typedef enum FFMpegPreset {
FFM_PRESET_NONE,
FFM_PRESET_ULTRAFAST,
@ -453,7 +417,7 @@ typedef struct ImageFormatData {
#define R_IMF_IMTYPE_AVIJPEG 16
#define R_IMF_IMTYPE_PNG 17
/* #define R_IMF_IMTYPE_AVICODEC 18 */ /* avicodec is nomore */
#define R_IMF_IMTYPE_QUICKTIME 19
/* #define R_IMF_IMTYPE_QUICKTIME 19 */ /* quicktime is nomore */
#define R_IMF_IMTYPE_BMP 20
#define R_IMF_IMTYPE_RADHDR 21
#define R_IMF_IMTYPE_TIFF 22
@ -588,8 +552,6 @@ typedef struct RenderData {
struct ImageFormatData im_format;
struct AviCodecData *avicodecdata;
struct QuicktimeCodecData *qtcodecdata;
struct QuicktimeCodecSettings qtcodecsettings;
struct FFMpegCodecData ffcodecdata;
int cfra, sfra, efra; /* frames as in 'images' */

@ -499,7 +499,6 @@ extern StructRNA RNA_PropertyGroupItem;
extern StructRNA RNA_PropertySensor;
extern StructRNA RNA_PythonConstraint;
extern StructRNA RNA_PythonController;
extern StructRNA RNA_QuickTimeSettings;
extern StructRNA RNA_RadarSensor;
extern StructRNA RNA_RandomSensor;
extern StructRNA RNA_RaySensor;

@ -240,13 +240,6 @@ if(WITH_AUDASPACE)
)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../../quicktime
)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_CODEC_FFMPEG)
list(APPEND INC
../../../../intern/ffmpeg

@ -64,7 +64,7 @@
static void rna_ImagePackedFile_save(ImagePackedFile *imapf, ReportList *reports)
{
if (writePackedFile(reports, imapf->filepath, imapf->packedfile, 0) != RET_OK) {
BKE_reportf(reports, RPT_ERROR, "Image could not save packed file to '%s'",
BKE_reportf(reports, RPT_ERROR, "Could not save packed file to disk as '%s'",
imapf->filepath);
}
}

@ -1520,26 +1520,40 @@ static void rna_def_modifier_mirror(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_mirror_u", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U);
RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the 0.5 point");
RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the flip offset point");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "use_mirror_v", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_V);
RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point");
RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the flip offset point");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "mirror_offset_u", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "uv_offset[0]");
RNA_def_property_range(prop, -1, 1);
RNA_def_property_ui_range(prop, -1, 1, 2, 4);
RNA_def_property_ui_text(prop, "U Offset", "Amount to offset mirrored UVs from the 0.5 point on the U axis");
RNA_def_property_ui_text(prop, "Flip U Offset", "Amount to offset mirrored UVs flipping point from the 0.5 on the U axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "mirror_offset_v", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "uv_offset[1]");
RNA_def_property_range(prop, -1, 1);
RNA_def_property_ui_range(prop, -1, 1, 2, 4);
RNA_def_property_ui_text(prop, "V Offset", "Amount to offset mirrored UVs from the 0.5 point on the V axis");
RNA_def_property_ui_text(prop, "Flip V Offset", "Amount to offset mirrored UVs flipping point from the 0.5 point on the V axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "offset_u", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "uv_offset_copy[0]");
RNA_def_property_range(prop, -10000.0f, 10000.0f);
RNA_def_property_ui_range(prop, -1, 1, 2, 4);
RNA_def_property_ui_text(prop, "U Offset", "Mirrored UV offset on the U axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "offset_v", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "uv_offset_copy[1]");
RNA_def_property_range(prop, -10000.0f, 10000.0f);
RNA_def_property_ui_range(prop, -1, 1, 2, 4);
RNA_def_property_ui_text(prop, "V Offset", "Mirrored UV offset on the V axis");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE);

@ -63,11 +63,6 @@
#include "RE_engine.h"
#include "RE_pipeline.h"
#ifdef WITH_QUICKTIME
# include "quicktime_export.h"
# include <AUD_Types.h>
#endif
#ifdef WITH_FFMPEG
# include "BKE_writeffmpeg.h"
# include <libavcodec/avcodec.h>
@ -296,9 +291,6 @@ EnumPropertyItem rna_enum_image_type_items[] = {
#endif
#ifdef WITH_FFMPEG
{R_IMF_IMTYPE_FFMPEG, "FFMPEG", ICON_FILE_MOVIE, "FFmpeg video", "The most versatile way to output video files"},
#endif
#ifdef WITH_QUICKTIME
{R_IMF_IMTYPE_QUICKTIME, "QUICKTIME", ICON_FILE_MOVIE, "QuickTime", "Output video in Quicktime format"},
#endif
{0, NULL, 0, NULL, NULL}
};
@ -1150,9 +1142,6 @@ static void rna_ImageFormatSettings_file_format_set(PointerRNA *ptr, int value)
RenderData *rd = &scene->r;
#ifdef WITH_FFMPEG
BKE_ffmpeg_image_type_verify(rd, imf);
#endif
#ifdef WITH_QUICKTIME
quicktime_verify_image_type(rd, imf);
#endif
(void)rd;
}
@ -1342,84 +1331,6 @@ static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
BKE_image_path_ensure_ext_from_imformat(str, &rd->im_format);
}
#ifdef WITH_QUICKTIME
static int rna_RenderSettings_qtcodecsettings_codecType_get(PointerRNA *ptr)
{
QuicktimeCodecSettings *settings = (QuicktimeCodecSettings *)ptr->data;
return quicktime_rnatmpvalue_from_videocodectype(settings->codecType);
}
static void rna_RenderSettings_qtcodecsettings_codecType_set(PointerRNA *ptr, int value)
{
QuicktimeCodecSettings *settings = (QuicktimeCodecSettings *)ptr->data;
settings->codecType = quicktime_videocodecType_from_rnatmpvalue(value);
}
static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_codecType_itemf(
bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
{
EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
QuicktimeCodecTypeDesc *codecTypeDesc;
int i = 1, totitem = 0;
for (i = 0; i < quicktime_get_num_videocodecs(); i++) {
codecTypeDesc = quicktime_get_videocodecType_desc(i);
if (!codecTypeDesc) break;
tmp.value = codecTypeDesc->rnatmpvalue;
tmp.identifier = codecTypeDesc->codecName;
tmp.name = codecTypeDesc->codecName;
RNA_enum_item_add(&item, &totitem, &tmp);
}
RNA_enum_item_end(&item, &totitem);
*r_free = true;
return item;
}
static int rna_RenderSettings_qtcodecsettings_audiocodecType_get(PointerRNA *ptr)
{
QuicktimeCodecSettings *settings = (QuicktimeCodecSettings *)ptr->data;
return quicktime_rnatmpvalue_from_audiocodectype(settings->audiocodecType);
}
static void rna_RenderSettings_qtcodecsettings_audiocodecType_set(PointerRNA *ptr, int value)
{
QuicktimeCodecSettings *settings = (QuicktimeCodecSettings *)ptr->data;
settings->audiocodecType = quicktime_audiocodecType_from_rnatmpvalue(value);
}
static EnumPropertyItem *rna_RenderSettings_qtcodecsettings_audiocodecType_itemf(
bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free)
{
EnumPropertyItem *item = NULL;
EnumPropertyItem tmp = {0, "", 0, "", ""};
QuicktimeCodecTypeDesc *codecTypeDesc;
int i = 1, totitem = 0;
for (i = 0; i < quicktime_get_num_audiocodecs(); i++) {
codecTypeDesc = quicktime_get_audiocodecType_desc(i);
if (!codecTypeDesc) break;
tmp.value = codecTypeDesc->rnatmpvalue;
tmp.identifier = codecTypeDesc->codecName;
tmp.name = codecTypeDesc->codecName;
RNA_enum_item_add(&item, &totitem, &tmp);
}
RNA_enum_item_end(&item, &totitem);
*r_free = true;
return item;
}
#endif
#ifdef WITH_FFMPEG
static void rna_FFmpegSettings_lossless_output_set(PointerRNA *ptr, int value)
{
@ -7889,106 +7800,6 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
}
#ifdef WITH_QUICKTIME
static void rna_def_scene_quicktime_settings(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
static EnumPropertyItem quicktime_codec_type_items[] = {
{0, "codec", 0, "codec", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem quicktime_audio_samplerate_items[] = {
{22050, "22050", 0, "22kHz", ""},
{44100, "44100", 0, "44.1kHz", ""},
{48000, "48000", 0, "48kHz", ""},
{88200, "88200", 0, "88.2kHz", ""},
{96000, "96000", 0, "96kHz", ""},
{192000, "192000", 0, "192kHz", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem quicktime_audio_bitdepth_items[] = {
{AUD_FORMAT_U8, "8BIT", 0, "8bit", ""},
{AUD_FORMAT_S16, "16BIT", 0, "16bit", ""},
{AUD_FORMAT_S24, "24BIT", 0, "24bit", ""},
{AUD_FORMAT_S32, "32BIT", 0, "32bit", ""},
{AUD_FORMAT_FLOAT32, "FLOAT32", 0, "float32", ""},
{AUD_FORMAT_FLOAT64, "FLOAT64", 0, "float64", ""},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem quicktime_audio_bitrate_items[] = {
{64000, "64000", 0, "64kbps", ""},
{112000, "112000", 0, "112kpbs", ""},
{128000, "128000", 0, "128kbps", ""},
{192000, "192000", 0, "192kbps", ""},
{256000, "256000", 0, "256kbps", ""},
{320000, "320000", 0, "320kbps", ""},
{0, NULL, 0, NULL, NULL}
};
/* QuickTime */
srna = RNA_def_struct(brna, "QuickTimeSettings", NULL);
RNA_def_struct_sdna(srna, "QuicktimeCodecSettings");
RNA_def_struct_ui_text(srna, "QuickTime Settings", "QuickTime related settings for the scene");
prop = RNA_def_property(srna, "codec_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "codecType");
RNA_def_property_enum_items(prop, quicktime_codec_type_items);
RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_codecType_get",
"rna_RenderSettings_qtcodecsettings_codecType_set",
"rna_RenderSettings_qtcodecsettings_codecType_itemf");
RNA_def_property_ui_text(prop, "Codec", "QuickTime codec type");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "codec_spatial_quality", PROP_INT, PROP_PERCENTAGE);
RNA_def_property_int_sdna(prop, NULL, "codecSpatialQuality");
RNA_def_property_range(prop, 0, 100);
RNA_def_property_ui_text(prop, "Spatial quality", "Intra-frame spatial quality level");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "audiocodec_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "audiocodecType");
RNA_def_property_enum_items(prop, quicktime_codec_type_items);
RNA_def_property_enum_funcs(prop, "rna_RenderSettings_qtcodecsettings_audiocodecType_get",
"rna_RenderSettings_qtcodecsettings_audiocodecType_set",
"rna_RenderSettings_qtcodecsettings_audiocodecType_itemf");
RNA_def_property_ui_text(prop, "Audio Codec", "QuickTime audio codec type");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "audio_samplerate", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "audioSampleRate");
RNA_def_property_enum_items(prop, quicktime_audio_samplerate_items);
RNA_def_property_ui_text(prop, "Smp Rate", "Sample Rate");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "audio_bitdepth", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "audioBitDepth");
RNA_def_property_enum_items(prop, quicktime_audio_bitdepth_items);
RNA_def_property_ui_text(prop, "Bit Depth", "Bit Depth");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "audio_resampling_hq", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "audioCodecFlags", QTAUDIO_FLAG_RESAMPLE_NOHQ);
RNA_def_property_ui_text(prop, "HQ", "Use High Quality resampling algorithm");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "audio_codec_isvbr", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "audioCodecFlags", QTAUDIO_FLAG_CODEC_ISCBR);
RNA_def_property_ui_text(prop, "VBR", "Use Variable Bit Rate compression (improves quality at same bitrate)");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
prop = RNA_def_property(srna, "audio_bitrate", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "audioBitRate");
RNA_def_property_enum_items(prop, quicktime_audio_bitrate_items);
RNA_def_property_ui_text(prop, "Bitrate", "Compressed audio bitrate");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
}
#endif
static void rna_def_scene_render_data(BlenderRNA *brna)
{
StructRNA *srna;
@ -8122,9 +7933,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
rna_def_scene_ffmpeg_settings(brna);
#ifdef WITH_QUICKTIME
rna_def_scene_quicktime_settings(brna);
#endif
srna = RNA_def_struct(brna, "RenderSettings", NULL);
RNA_def_struct_sdna(srna, "RenderData");
@ -8209,14 +8017,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
"Vertical aspect ratio - for anamorphic or non-square pixel output");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_SceneCamera_update");
#ifdef WITH_QUICKTIME
prop = RNA_def_property(srna, "quicktime", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "QuickTimeSettings");
RNA_def_property_pointer_sdna(prop, NULL, "qtcodecsettings");
RNA_def_property_flag(prop, PROP_NEVER_UNLINK);
RNA_def_property_ui_text(prop, "QuickTime Settings", "QuickTime related settings for the scene");
#endif
prop = RNA_def_property(srna, "ffmpeg", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "FFmpegSettings");
RNA_def_property_pointer_sdna(prop, NULL, "ffcodecdata");

@ -725,8 +725,9 @@ static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), Poin
static void rna_Sequence_sound_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Sequence *seq = (Sequence *) ptr->data;
if (seq->sound != NULL) {
BKE_sound_update_scene_sound(seq->scene_sound, seq->sound);
}
rna_Sequence_update(bmain, scene, ptr);
}

@ -249,7 +249,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
/* handle uvs,
* let tessface recalc handle updating the MTFace data */
if (mmd->flag & (MOD_MIR_MIRROR_U | MOD_MIR_MIRROR_V)) {
if (mmd->flag & (MOD_MIR_MIRROR_U | MOD_MIR_MIRROR_V) || (is_zero_v2(mmd->uv_offset_copy) == false)) {
const bool do_mirr_u = (mmd->flag & MOD_MIR_MIRROR_U) != 0;
const bool do_mirr_v = (mmd->flag & MOD_MIR_MIRROR_V) != 0;
@ -262,6 +262,8 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
for (; j-- > 0; dmloopuv++) {
if (do_mirr_u) dmloopuv->uv[0] = 1.0f - dmloopuv->uv[0] + mmd->uv_offset[0];
if (do_mirr_v) dmloopuv->uv[1] = 1.0f - dmloopuv->uv[1] + mmd->uv_offset[1];
dmloopuv->uv[0] += mmd->uv_offset_copy[0];
dmloopuv->uv[1] += mmd->uv_offset_copy[1];
}
}
}

@ -153,10 +153,6 @@ if(WITH_CODEC_FFMPEG)
add_definitions(-DWITH_FFMPEG)
endif()
if(WITH_CODEC_QUICKTIME)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_CODEC_SNDFILE)
add_definitions(-DWITH_SNDFILE)
endif()

@ -37,7 +37,6 @@ static PyStructSequence_Field app_builtopts_info_fields[] = {
{(char *)"bullet", NULL},
{(char *)"codec_avi", NULL},
{(char *)"codec_ffmpeg", NULL},
{(char *)"codec_quicktime", NULL},
{(char *)"codec_sndfile", NULL},
{(char *)"compositor", NULL},
{(char *)"cycles", NULL},
@ -112,12 +111,6 @@ static PyObject *make_builtopts_info(void)
SetObjIncref(Py_False);
#endif
#ifdef WITH_QUICKTIME
SetObjIncref(Py_True);
#else
SetObjIncref(Py_False);
#endif
#ifdef WITH_SNDFILE
SetObjIncref(Py_True);
#else

@ -1,62 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
set(INC
.
../avi
../blenkernel
../blenlib
../imbuf
../imbuf/intern
../makesdna
../makesrna
../render/extern/include
../windowmanager
../../../intern/guardedalloc
)
set(INC_SYS
${QUICKTIME_INCLUDE_DIRS}
)
set(SRC
apple/qtkit_import.m
apple/qtkit_export.m
quicktime_export.h
quicktime_import.h
)
add_definitions(-DWITH_QUICKTIME)
if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE)
list(APPEND INC_SYS
${AUDASPACE_C_INCLUDE_DIRS}
)
endif()
blender_add_lib(bf_quicktime "${SRC}" "${INC}" "${INC_SYS}")

@ -1,884 +0,0 @@
/*
* Code to create QuickTime Movies with Blender
*
* ***** BEGIN GPL LICENSE BLOCK *****
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Original Code is written by Rob Haarsma (phase)
*
* Contributor(s): Stefan Gartner (sgefant)
* Damien Plisson 11/2009
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef WITH_QUICKTIME
#if defined(_WIN32) || defined(__APPLE__)
#include <stdio.h>
#include <string.h>
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#ifdef WITH_AUDASPACE
# include <AUD_Device.h>
#endif
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_scene.h"
#include "BKE_report.h"
#include "BLI_blenlib.h"
#include "BLI_sys_types.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "MEM_guardedalloc.h"
#ifdef __APPLE__
/* evil */
#ifndef __AIFF__
#define __AIFF__
#endif
#import <Cocoa/Cocoa.h>
#import <QTKit/QTKit.h>
#include <AudioToolbox/AudioToolbox.h>
#include "quicktime_import.h"
#include "quicktime_export.h"
#endif /* __APPLE__ */
typedef struct QuicktimeExport {
QTMovie *movie;
NSString *filename;
QTTime frameDuration;
NSDictionary *frameAttributes;
NSString *videoTempFileName;
/* Audio section */
AUD_Device *audioInputDevice;
AudioFileID audioFile;
NSString *audioFileName;
AudioConverterRef audioConverter;
AudioBufferList audioBufferList;
AudioStreamBasicDescription audioInputFormat, audioOutputFormat;
AudioStreamPacketDescription *audioOutputPktDesc;
SInt64 audioFilePos;
char *audioInputBuffer;
char *audioOutputBuffer;
UInt32 audioCodecMaxOutputPacketSize;
UInt64 audioTotalExportedFrames, audioTotalSavedFrames;
UInt64 audioLastFrame;
SInt64 audioOutputPktPos;
} QuicktimeExport;
#define AUDIOOUTPUTBUFFERSIZE 65536
#pragma mark rna helper functions
/* Video codec */
static QuicktimeCodecTypeDesc qtVideoCodecList[] = {
{kRawCodecType, 1, "Uncompressed"},
{k422YpCbCr8CodecType, 2, "Uncompressed 8-bit 4:2:2"},
{k422YpCbCr10CodecType, 3, "Uncompressed 10-bit 4:2:2"},
{kComponentVideoCodecType, 4, "Component Video"},
{kPixletCodecType, 5, "Pixlet"},
{kPNGCodecType, 6, "PNG"},
{kJPEGCodecType, 7, "JPEG"},
{kMotionJPEGACodecType, 8, "M-JPEG A"},
{kMotionJPEGBCodecType, 9, "M-JPEG B"},
{kDVCPALCodecType, 10, "DV PAL"},
{kDVCNTSCCodecType, 11, "DV/DVCPRO NTSC"},
{kDVCPROHD720pCodecType, 12, "DVCPRO HD 720p"},
{kDVCPROHD1080i50CodecType, 13, "DVCPRO HD 1080i50"},
{kDVCPROHD1080i60CodecType, 14, "DVCPRO HD 1080i60"},
{kMPEG4VisualCodecType, 15, "MPEG4"},
{kH263CodecType, 16, "H.263"},
{kH264CodecType, 17, "H.264"},
{kAnimationCodecType, 18, "Animation"},
{0,0,NULL}};
static int qtVideoCodecCount = 18;
int quicktime_get_num_videocodecs()
{
return qtVideoCodecCount;
}
QuicktimeCodecTypeDesc* quicktime_get_videocodecType_desc(int indexValue)
{
if ((indexValue>=0) && (indexValue < qtVideoCodecCount))
return &qtVideoCodecList[indexValue];
else
return NULL;
}
int quicktime_rnatmpvalue_from_videocodectype(int codecType)
{
int i;
for (i = 0; i < qtVideoCodecCount; i++) {
if (qtVideoCodecList[i].codecType == codecType)
return qtVideoCodecList[i].rnatmpvalue;
}
return 0;
}
int quicktime_videocodecType_from_rnatmpvalue(int rnatmpvalue)
{
int i;
for (i = 0; i < qtVideoCodecCount; i++) {
if (qtVideoCodecList[i].rnatmpvalue == rnatmpvalue)
return qtVideoCodecList[i].codecType;
}
return 0;
}
/* Audio codec */
static QuicktimeCodecTypeDesc qtAudioCodecList[] = {
{0, 0, "No audio"},
{kAudioFormatLinearPCM, 1, "LPCM"},
{kAudioFormatAppleLossless, 2, "Apple Lossless"},
{kAudioFormatMPEG4AAC, 3, "AAC"},
{0,0,NULL}};
static int qtAudioCodecCount = 4;
int quicktime_get_num_audiocodecs()
{
return qtAudioCodecCount;
}
QuicktimeCodecTypeDesc* quicktime_get_audiocodecType_desc(int indexValue)
{
if ((indexValue>=0) && (indexValue < qtAudioCodecCount))
return &qtAudioCodecList[indexValue];
else
return NULL;
}
int quicktime_rnatmpvalue_from_audiocodectype(int codecType)
{
int i;
for (i = 0; i < qtAudioCodecCount; i++) {
if (qtAudioCodecList[i].codecType == codecType)
return qtAudioCodecList[i].rnatmpvalue;
}
return 0;
}
int quicktime_audiocodecType_from_rnatmpvalue(int rnatmpvalue)
{
int i;
for (i = 0; i < qtAudioCodecCount; i++) {
if (qtAudioCodecList[i].rnatmpvalue == rnatmpvalue)
return qtAudioCodecList[i].codecType;
}
return 0;
}
static NSString *stringWithCodecType(int codecType)
{
char str[5];
*((int *)str) = EndianU32_NtoB(codecType);
str[4] = 0;
return [NSString stringWithCString:str encoding:NSASCIIStringEncoding];
}
void makeqtstring(RenderData *rd, char *string, bool preview)
{
int sfra, efra;
char txt[64];
if (preview) {
sfra = rd->psfra;
efra = rd->pefra;
}
else {
sfra = rd->sfra;
efra = rd->efra;
}
strcpy(string, rd->pic);
BLI_path_abs(string, G.main->name);
BLI_make_existing_file(string);
if (BLI_strcasecmp(string + strlen(string) - 4, ".mov")) {
sprintf(txt, "%04d-%04d.mov", (rd->sfra) , (rd->efra) );
strcat(string, txt);
}
}
void filepath_qt(char *string, RenderData *rd, bool preview, const char *suffix)
{
int sfra, efra;
if (string == NULL) return;
if (preview) {
sfra = rd->psfra;
efra = rd->pefra;
}
else {
sfra = rd->sfra;
efra = rd->efra;
}
strcpy(string, rd->pic);
BLI_path_abs(string, G.main->name);
BLI_make_existing_file(string);
if (rd->scemode & R_EXTENSION) {
if (!BLI_testextensie(string, ".mov")) {
BLI_path_frame_range(string, sfra, efra, 4);
strcat(string, ".mov");
}
}
else {
if (BLI_path_frame_check_chars(string)) {
BLI_path_frame_range(string, sfra, efra, 4);
}
}
BLI_path_suffix(string, FILE_MAX, suffix, "");
}
void *context_create_qt(void)
{
QuicktimeExport *qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport");
return qtexport;
}
void context_free_qt(void *context_v)
{
QuicktimeExport *qtexport = context_v;
if (qtexport) {
MEM_freeN(qtexport);
}
}
#pragma mark audio export functions
static OSStatus write_cookie(AudioConverterRef converter, AudioFileID outfile)
{
// grab the cookie from the converter and write it to the file
UInt32 cookieSize = 0;
OSStatus err = AudioConverterGetPropertyInfo(converter, kAudioConverterCompressionMagicCookie, &cookieSize, NULL);
// if there is an error here, then the format doesn't have a cookie, so on we go
if (!err && cookieSize) {
char* cookie = malloc(cookieSize);
err = AudioConverterGetProperty(converter, kAudioConverterCompressionMagicCookie, &cookieSize, cookie);
if (!err)
err = AudioFileSetProperty (outfile, kAudioFilePropertyMagicCookieData, cookieSize, cookie);
// even though some formats have cookies, some files don't take them
free(cookie);
}
return err;
}
/* AudioConverter input stream callback */
static OSStatus AudioConverterInputCallback(AudioConverterRef inAudioConverter,
UInt32* ioNumberDataPackets,
AudioBufferList* ioData,
AudioStreamPacketDescription** outDataPacketDescription,
void* inUserData)
{
QuicktimeExport *qtexport = inUserData;
if (qtexport->audioTotalExportedFrames >= qtexport->audioLastFrame) { /* EOF */
*ioNumberDataPackets = 0;
return noErr;
}
if (qtexport->audioInputFormat.mBytesPerPacket * *ioNumberDataPackets > AUDIOOUTPUTBUFFERSIZE)
*ioNumberDataPackets = AUDIOOUTPUTBUFFERSIZE / qtexport->audioInputFormat.mBytesPerPacket;
if ((qtexport->audioTotalExportedFrames + *ioNumberDataPackets) > qtexport->audioLastFrame)
*ioNumberDataPackets = (qtexport->audioLastFrame - qtexport->audioTotalExportedFrames) / qtexport->audioInputFormat.mFramesPerPacket;
qtexport->audioTotalExportedFrames += *ioNumberDataPackets;
AUD_Device_read(qtexport->audioInputDevice, (UInt8 *)qtexport->audioInputBuffer,
qtexport->audioInputFormat.mFramesPerPacket * *ioNumberDataPackets);
ioData->mBuffers[0].mDataByteSize = qtexport->audioInputFormat.mBytesPerPacket * *ioNumberDataPackets;
ioData->mBuffers[0].mData = qtexport->audioInputBuffer;
ioData->mBuffers[0].mNumberChannels = qtexport->audioInputFormat.mChannelsPerFrame;
return noErr;
}
#pragma mark export functions
int start_qt(
void *context_v, struct Scene *scene, struct RenderData *rd, int UNUSED(rectx), int UNUSED(recty),
ReportList *reports, bool preview, const char *UNUSED(suffix))
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSError *error;
char name[1024];
int success = 1;
OSStatus err = noErr;
int sfra, efra;
QuicktimeExport *qtexport = context_v;
if (preview) {
sfra = rd->psfra;
efra = rd->pefra;
}
else {
sfra = rd->sfra;
efra = rd->efra;
}
[QTMovie enterQTKitOnThread];
/* Check first if the QuickTime 7.2.1 initToWritableFile: method is available */
if ([[[[QTMovie alloc] init] autorelease] respondsToSelector:@selector(initToWritableFile:error:)] != YES) {
BKE_report(reports, RPT_ERROR, "\nUnable to create quicktime movie, need Quicktime rev 7.2.1 or later");
success = 0;
}
else {
makeqtstring(rd, name, preview);
qtexport->filename = [[NSString alloc] initWithUTF8String:name];
qtexport->movie = nil;
qtexport->audioFile = NULL;
if (rd->qtcodecsettings.audiocodecType) {
// generate a name for our video & audio files
/* Init audio file */
CFURLRef outputFileURL;
char extension[32];
AudioFileTypeID audioFileType;
switch (rd->qtcodecsettings.audiocodecType) {
case kAudioFormatLinearPCM:
audioFileType = kAudioFileWAVEType;
strcpy(extension,".wav");
break;
case kAudioFormatMPEG4AAC:
case kAudioFormatAppleLossless:
audioFileType = kAudioFileM4AType;
strcpy(extension, ".m4a");
break;
default:
audioFileType = kAudioFileAIFFType;
strcpy(extension,".aiff");
break;
}
tmpnam(name);
strcat(name, extension);
outputFileURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,(UInt8 *)name, strlen(name), false);
if (outputFileURL) {
qtexport->audioFileName = [[NSString alloc] initWithCString:name
encoding:[NSString defaultCStringEncoding]];
qtexport->audioInputFormat.mSampleRate = U.audiorate;
qtexport->audioInputFormat.mFormatID = kAudioFormatLinearPCM;
qtexport->audioInputFormat.mChannelsPerFrame = U.audiochannels;
switch (U.audioformat) {
case AUD_FORMAT_U8:
qtexport->audioInputFormat.mBitsPerChannel = 8;
qtexport->audioInputFormat.mFormatFlags = 0;
break;
case AUD_FORMAT_S24:
qtexport->audioInputFormat.mBitsPerChannel = 24;
qtexport->audioInputFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
break;
case AUD_FORMAT_S32:
qtexport->audioInputFormat.mBitsPerChannel = 32;
qtexport->audioInputFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
break;
case AUD_FORMAT_FLOAT32:
qtexport->audioInputFormat.mBitsPerChannel = 32;
qtexport->audioInputFormat.mFormatFlags = kLinearPCMFormatFlagIsFloat;
break;
case AUD_FORMAT_FLOAT64:
qtexport->audioInputFormat.mBitsPerChannel = 64;
qtexport->audioInputFormat.mFormatFlags = kLinearPCMFormatFlagIsFloat;
break;
case AUD_FORMAT_S16:
default:
qtexport->audioInputFormat.mBitsPerChannel = 16;
qtexport->audioInputFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
break;
}
qtexport->audioInputFormat.mBytesPerFrame = qtexport->audioInputFormat.mChannelsPerFrame * qtexport->audioInputFormat.mBitsPerChannel / 8;
qtexport->audioInputFormat.mFramesPerPacket = 1; /*If not ==1, then need to check input callback for "rounding" issues"*/
qtexport->audioInputFormat.mBytesPerPacket = qtexport->audioInputFormat.mBytesPerFrame;
qtexport->audioInputFormat.mFormatFlags |= kLinearPCMFormatFlagIsPacked;
/*Output format*/
qtexport->audioOutputFormat.mFormatID = rd->qtcodecsettings.audiocodecType;
//TODO: set audio channels
qtexport->audioOutputFormat.mChannelsPerFrame = 2;
qtexport->audioOutputFormat.mSampleRate = rd->qtcodecsettings.audioSampleRate;
/* Default value for compressed formats, overridden after if not the case */
qtexport->audioOutputFormat.mFramesPerPacket = 0;
qtexport->audioOutputFormat.mBytesPerFrame = 0;
qtexport->audioOutputFormat.mBytesPerPacket = 0;
qtexport->audioOutputFormat.mBitsPerChannel = 0;
switch (rd->qtcodecsettings.audiocodecType) {
case kAudioFormatMPEG4AAC:
qtexport->audioOutputFormat.mFormatFlags = kMPEG4Object_AAC_Main;
/* AAC codec does not handle sample rates above 48kHz, force this limit instead of getting an error afterwards */
if (qtexport->audioOutputFormat.mSampleRate > 48000) qtexport->audioOutputFormat.mSampleRate = 48000;
break;
case kAudioFormatAppleLossless:
switch (U.audioformat) {
case AUD_FORMAT_S16:
qtexport->audioOutputFormat.mFormatFlags = kAppleLosslessFormatFlag_16BitSourceData;
break;
case AUD_FORMAT_S24:
qtexport->audioOutputFormat.mFormatFlags = kAppleLosslessFormatFlag_24BitSourceData;
break;
case AUD_FORMAT_S32:
qtexport->audioOutputFormat.mFormatFlags = kAppleLosslessFormatFlag_32BitSourceData;
break;
case AUD_FORMAT_U8:
case AUD_FORMAT_FLOAT32:
case AUD_FORMAT_FLOAT64:
default:
break;
}
break;
case kAudioFormatLinearPCM:
default:
switch (rd->qtcodecsettings.audioBitDepth) {
case AUD_FORMAT_U8:
qtexport->audioOutputFormat.mBitsPerChannel = 8;
qtexport->audioOutputFormat.mFormatFlags = 0;
break;
case AUD_FORMAT_S24:
qtexport->audioOutputFormat.mBitsPerChannel = 24;
qtexport->audioOutputFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
break;
case AUD_FORMAT_S32:
qtexport->audioOutputFormat.mBitsPerChannel = 32;
qtexport->audioOutputFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
break;
case AUD_FORMAT_FLOAT32:
qtexport->audioOutputFormat.mBitsPerChannel = 32;
qtexport->audioOutputFormat.mFormatFlags = kLinearPCMFormatFlagIsFloat;
break;
case AUD_FORMAT_FLOAT64:
qtexport->audioOutputFormat.mBitsPerChannel = 64;
qtexport->audioOutputFormat.mFormatFlags = kLinearPCMFormatFlagIsFloat;
break;
case AUD_FORMAT_S16:
default:
qtexport->audioOutputFormat.mBitsPerChannel = 16;
qtexport->audioOutputFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger;
break;
}
qtexport->audioOutputFormat.mFormatFlags |= kLinearPCMFormatFlagIsPacked;
qtexport->audioOutputFormat.mBytesPerPacket = qtexport->audioOutputFormat.mChannelsPerFrame * (qtexport->audioOutputFormat.mBitsPerChannel / 8);
qtexport->audioOutputFormat.mFramesPerPacket = 1;
qtexport->audioOutputFormat.mBytesPerFrame = qtexport->audioOutputFormat.mBytesPerPacket;
break;
}
err = AudioFileCreateWithURL(outputFileURL, audioFileType, &qtexport->audioOutputFormat, kAudioFileFlags_EraseFile, &qtexport->audioFile);
CFRelease(outputFileURL);
if (err)
BKE_report(reports, RPT_ERROR, "\nQuicktime: unable to create temporary audio file. Format error ?");
else {
err = AudioConverterNew(&qtexport->audioInputFormat, &qtexport->audioOutputFormat, &qtexport->audioConverter);
if (err) {
BKE_report(reports, RPT_ERROR, "\nQuicktime: unable to initialize audio codec converter. Format error ?");
AudioFileClose(qtexport->audioFile);
qtexport->audioFile = NULL;
[qtexport->audioFileName release];
qtexport->audioFileName = nil;
}
else {
UInt32 prop,propSize;
/* Set up codec properties */
if (rd->qtcodecsettings.audiocodecType == kAudioFormatMPEG4AAC) { /* Lossy compressed format */
prop = rd->qtcodecsettings.audioBitRate;
AudioConverterSetProperty(qtexport->audioConverter, kAudioConverterEncodeBitRate,
sizeof(prop), &prop);
if (rd->qtcodecsettings.audioCodecFlags & QTAUDIO_FLAG_CODEC_ISCBR)
prop = kAudioCodecBitRateControlMode_Constant;
else
prop = kAudioCodecBitRateControlMode_LongTermAverage;
AudioConverterSetProperty(qtexport->audioConverter, kAudioCodecPropertyBitRateControlMode,
sizeof(prop), &prop);
}
/* Conversion quality : if performance impact then offer degraded option */
if ((rd->qtcodecsettings.audioCodecFlags & QTAUDIO_FLAG_RESAMPLE_NOHQ) == 0) {
prop = kAudioConverterSampleRateConverterComplexity_Mastering;
AudioConverterSetProperty(qtexport->audioConverter, kAudioConverterSampleRateConverterComplexity,
sizeof(prop), &prop);
prop = kAudioConverterQuality_Max;
AudioConverterSetProperty(qtexport->audioConverter, kAudioConverterSampleRateConverterQuality,
sizeof(prop), &prop);
}
write_cookie(qtexport->audioConverter, qtexport->audioFile);
/* Allocate output buffer */
if (qtexport->audioOutputFormat.mBytesPerPacket ==0) /* VBR */
AudioConverterGetProperty(qtexport->audioConverter, kAudioConverterPropertyMaximumOutputPacketSize,
&propSize, &qtexport->audioCodecMaxOutputPacketSize);
else
qtexport->audioCodecMaxOutputPacketSize = qtexport->audioOutputFormat.mBytesPerPacket;
qtexport->audioInputBuffer = MEM_mallocN(AUDIOOUTPUTBUFFERSIZE, "qt_audio_inputPacket");
qtexport->audioOutputBuffer = MEM_mallocN(AUDIOOUTPUTBUFFERSIZE, "qt_audio_outputPacket");
qtexport->audioOutputPktDesc = MEM_mallocN(sizeof(AudioStreamPacketDescription) * AUDIOOUTPUTBUFFERSIZE / qtexport->audioCodecMaxOutputPacketSize,
"qt_audio_pktdesc");
}
}
}
if (err == noErr) {
qtexport->videoTempFileName = [[NSString alloc] initWithCString:tmpnam(nil)
encoding:[NSString defaultCStringEncoding]];
if (qtexport->videoTempFileName) {
qtexport->movie = [[QTMovie alloc] initToWritableFile:qtexport->videoTempFileName error:&error];
}
}
}
else
qtexport->movie = [[QTMovie alloc] initToWritableFile:qtexport->filename error:&error];
if (qtexport->movie == nil) {
BKE_report(reports, RPT_ERROR, "Unable to create quicktime movie.");
success = 0;
if (qtexport->filename) [qtexport->filename release];
qtexport->filename = nil;
if (qtexport->audioFileName) [qtexport->audioFileName release];
qtexport->audioFileName = nil;
if (qtexport->videoTempFileName) [qtexport->videoTempFileName release];
qtexport->videoTempFileName = nil;
[QTMovie exitQTKitOnThread];
}
else {
[qtexport->movie retain];
[qtexport->movie setAttribute:[NSNumber numberWithBool:YES] forKey:QTMovieEditableAttribute];
[qtexport->movie setAttribute:@"Made with Blender" forKey:QTMovieCopyrightAttribute];
qtexport->frameDuration = QTMakeTime(rd->frs_sec_base * 1000, rd->frs_sec * 1000);
/* specifying the codec attributes : try to retrieve them from render data first*/
if (rd->qtcodecsettings.codecType) {
qtexport->frameAttributes = [
NSDictionary dictionaryWithObjectsAndKeys:
stringWithCodecType(rd->qtcodecsettings.codecType),
QTAddImageCodecType,
[NSNumber numberWithLong:((rd->qtcodecsettings.codecSpatialQuality)*codecLosslessQuality)/100],
QTAddImageCodecQuality,
nil];
}
else {
qtexport->frameAttributes = [
NSDictionary dictionaryWithObjectsAndKeys:@"jpeg",
QTAddImageCodecType,
[NSNumber numberWithLong:codecHighQuality],
QTAddImageCodecQuality,
nil];
}
[qtexport->frameAttributes retain];
if (qtexport->audioFile) {
/* Init audio input stream */
AUD_DeviceSpecs specs;
specs.channels = U.audiochannels;
specs.format = U.audioformat;
specs.rate = U.audiorate;
qtexport->audioInputDevice = AUD_openReadDevice(specs);
AUD_playDevice(qtexport->audioInputDevice, scene->sound_scene, sfra * rd->frs_sec_base / rd->frs_sec);
qtexport->audioOutputPktPos = 0;
qtexport->audioTotalExportedFrames = 0;
qtexport->audioTotalSavedFrames = 0;
qtexport->audioLastFrame = (efra - sfra) * qtexport->audioInputFormat.mSampleRate * rd->frs_sec_base / rd->frs_sec;
}
}
}
[pool drain];
return success;
}
int append_qt(
void *context_v, struct RenderData *rd, int start_frame, int frame, int *pixels, int rectx, int recty,
const char *UNUSED(suffix), ReportList *reports)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSBitmapImageRep *blBitmapFormatImage;
NSImage *frameImage;
OSStatus err = noErr;
unsigned char *from_Ptr,*to_Ptr;
int y,from_i,to_i;
QuicktimeExport *qtexport = context_v;
/* Create bitmap image rep in blender format (32bit RGBA) */
blBitmapFormatImage = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:rectx
pixelsHigh:recty
bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO
colorSpaceName:NSCalibratedRGBColorSpace
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
bytesPerRow:rectx*4
bitsPerPixel:32];
if (!blBitmapFormatImage) {
[pool drain];
return 0;
}
from_Ptr = (unsigned char *)pixels;
to_Ptr = (unsigned char *)[blBitmapFormatImage bitmapData];
for (y = 0; y < recty; y++) {
to_i = (recty-y-1)*rectx;
from_i = y*rectx;
memcpy(to_Ptr+4*to_i, from_Ptr+4*from_i, 4*rectx);
}
frameImage = [[NSImage alloc] initWithSize:NSMakeSize(rectx, recty)];
[frameImage addRepresentation:blBitmapFormatImage];
/* Add the image to the movie clip */
[qtexport->movie addImage:frameImage
forDuration:qtexport->frameDuration
withAttributes:qtexport->frameAttributes];
[blBitmapFormatImage release];
[frameImage release];
if (qtexport->audioFile) {
UInt32 audioPacketsConverted;
// Upper limit on total exported audio frames for this particular video frame
const UInt64 exportedAudioFrameLimit = (frame - start_frame) * qtexport->audioInputFormat.mSampleRate * rd->frs_sec_base / rd->frs_sec;
/* Append audio */
while (qtexport->audioTotalExportedFrames < exportedAudioFrameLimit) {
qtexport->audioBufferList.mNumberBuffers = 1;
qtexport->audioBufferList.mBuffers[0].mNumberChannels = qtexport->audioOutputFormat.mChannelsPerFrame;
qtexport->audioBufferList.mBuffers[0].mDataByteSize = AUDIOOUTPUTBUFFERSIZE;
qtexport->audioBufferList.mBuffers[0].mData = qtexport->audioOutputBuffer;
// Convert one audio packet at a time so that enclosing while loop can
// keep audio processing in sync with video frames.
// Previously, this was set to (AUDIOOUTPUTBUFFERSIZE / qtexport->audioCodecMaxOutputPacketSize),
// however this may cause AudioConverterFillComplexBuffer to convert audio spanning multiple
// video frames, which breaks animation of audio parameters such as volume for fade-in/out.
audioPacketsConverted = 1;
err = AudioConverterFillComplexBuffer(qtexport->audioConverter, AudioConverterInputCallback,
qtexport, &audioPacketsConverted, &qtexport->audioBufferList, qtexport->audioOutputPktDesc);
if (audioPacketsConverted) {
AudioFileWritePackets(qtexport->audioFile, false, qtexport->audioBufferList.mBuffers[0].mDataByteSize,
qtexport->audioOutputPktDesc, qtexport->audioOutputPktPos, &audioPacketsConverted, qtexport->audioOutputBuffer);
qtexport->audioOutputPktPos += audioPacketsConverted;
if (qtexport->audioOutputFormat.mFramesPerPacket) {
// this is the common case: format has constant frames per packet
qtexport->audioTotalSavedFrames += (audioPacketsConverted * qtexport->audioOutputFormat.mFramesPerPacket);
}
else {
unsigned int i;
// if there are variable frames per packet, then we have to do this for each packeet
for (i = 0; i < audioPacketsConverted; ++i)
qtexport->audioTotalSavedFrames += qtexport->audioOutputPktDesc[i].mVariableFramesInPacket;
}
}
else {
//Error getting audio packets
BKE_reportf(reports, RPT_ERROR, "Unable to get further audio packets from frame %i, error = 0x%x",(int)qtexport->audioTotalExportedFrames,err);
break;
}
}
}
[pool drain];
return 1;
}
void end_qt(void *context_v)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
QuicktimeExport *qtexport = context_v;
if (qtexport->movie) {
if (qtexport->audioFile)
{
NSDictionary *dict = nil;
QTMovie *audioTmpMovie = nil;
NSError *error;
NSFileManager *fileManager;
/* Mux video and audio then save file */
/* Write last frames for VBR files */
if (qtexport->audioOutputFormat.mBitsPerChannel == 0) {
OSStatus err = noErr;
AudioConverterPrimeInfo primeInfo;
UInt32 primeSize = sizeof(primeInfo);
err = AudioConverterGetProperty(qtexport->audioConverter, kAudioConverterPrimeInfo, &primeSize, &primeInfo);
if (err == noErr) {
// there's priming to write out to the file
AudioFilePacketTableInfo pti;
pti.mPrimingFrames = primeInfo.leadingFrames;
pti.mRemainderFrames = primeInfo.trailingFrames;
pti.mNumberValidFrames = qtexport->audioTotalSavedFrames - pti.mPrimingFrames - pti.mRemainderFrames;
AudioFileSetProperty(qtexport->audioFile, kAudioFilePropertyPacketTableInfo, sizeof(pti), &pti);
}
}
write_cookie(qtexport->audioConverter, qtexport->audioFile);
AudioConverterDispose(qtexport->audioConverter);
AudioFileClose(qtexport->audioFile);
AUD_Device_free(qtexport->audioInputDevice);
qtexport->audioFile = NULL;
qtexport->audioInputDevice = NULL;
MEM_freeN(qtexport->audioInputBuffer);
MEM_freeN(qtexport->audioOutputBuffer);
MEM_freeN(qtexport->audioOutputPktDesc);
/* Reopen audio file and merge it */
audioTmpMovie = [QTMovie movieWithFile:qtexport->audioFileName error:&error];
if (audioTmpMovie) {
NSArray *audioTracks = [audioTmpMovie tracksOfMediaType:QTMediaTypeSound];
QTTrack *audioTrack = nil;
if ( [audioTracks count] > 0 ) {
audioTrack = [audioTracks objectAtIndex:0];
}
if (audioTrack) {
QTTimeRange totalRange;
totalRange.time = QTZeroTime;
totalRange.duration = [[audioTmpMovie attributeForKey:QTMovieDurationAttribute] QTTimeValue];
[qtexport->movie insertSegmentOfTrack:audioTrack timeRange:totalRange atTime:QTZeroTime];
}
}
/* Save file */
dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
forKey:QTMovieFlatten];
if (dict) {
[qtexport->movie writeToFile:qtexport->filename withAttributes:dict];
}
/* Delete temp files */
fileManager = [[NSFileManager alloc] init];
[fileManager removeItemAtPath:qtexport->audioFileName error:&error];
[fileManager removeItemAtPath:qtexport->videoTempFileName error:&error];
[fileManager release];
}
else {
/* Flush update of the movie file */
[qtexport->movie updateMovieFile];
[qtexport->movie invalidate];
}
/* Clean up movie structure */
if (qtexport->filename) [qtexport->filename release];
qtexport->filename = nil;
if (qtexport->audioFileName) [qtexport->audioFileName release];
qtexport->audioFileName = nil;
if (qtexport->videoTempFileName) [qtexport->videoTempFileName release];
qtexport->videoTempFileName = nil;
[qtexport->frameAttributes release];
[qtexport->movie release];
}
[QTMovie exitQTKitOnThread];
[pool drain];
}
void free_qtcomponentdata(void)
{
}
void quicktime_verify_image_type(RenderData *rd, ImageFormatData *imf)
{
if (imf->imtype == R_IMF_IMTYPE_QUICKTIME) {
if ((rd->qtcodecsettings.codecType <= 0) ||
(rd->qtcodecsettings.codecSpatialQuality < 0) ||
(rd->qtcodecsettings.codecSpatialQuality > 100))
{
rd->qtcodecsettings.codecType = kJPEGCodecType;
rd->qtcodecsettings.codecSpatialQuality = (codecHighQuality * 100) / codecLosslessQuality;
}
if ((rd->qtcodecsettings.audioSampleRate < 21000) ||
(rd->qtcodecsettings.audioSampleRate > 193000))
{
rd->qtcodecsettings.audioSampleRate = 48000;
}
if (rd->qtcodecsettings.audioBitDepth == 0) {
rd->qtcodecsettings.audioBitDepth = AUD_FORMAT_S16;
}
if (rd->qtcodecsettings.audioBitRate == 0) {
rd->qtcodecsettings.audioBitRate = 256000;
}
}
}
#endif /* _WIN32 || __APPLE__ */
#endif /* WITH_QUICKTIME */

@ -1,400 +0,0 @@
/*
* Code to use Quicktime to load images/movies as texture.
*
* ***** BEGIN GPL LICENSE BLOCK *****
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*
* The Original Code is written by Rob Haarsma (phase)
*
* Contributor(s): Stefan Gartner (sgefant)
* Damien Plisson 11/2009
*
* ***** END GPL LICENSE BLOCK *****
*/
#ifdef WITH_QUICKTIME
#include "MEM_guardedalloc.h"
#include "IMB_anim.h"
#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
#include "BKE_global.h"
#include "BLI_dynstr.h"
#include "BLI_path_util.h"
#import <Cocoa/Cocoa.h>
#import <QTKit/QTKit.h>
#include "quicktime_import.h"
#include "quicktime_export.h"
// quicktime structure definition
// this structure is part of the anim struct
typedef struct _QuicktimeMovie {
QTMovie *movie;
QTMedia *media;
long durationTime;
long durationScale;
long framecount;
ImBuf *ibuf;
long previousPosition;
} QuicktimeMovie;
#define QTIME_DEBUG 0
void quicktime_init(void)
{
G.have_quicktime = true;
}
void quicktime_exit(void)
{
if (G.have_quicktime) {
free_qtcomponentdata();
}
}
int anim_is_quicktime(const char *name)
{
NSAutoreleasePool *pool;
// don't let quicktime movie import handle these
if (BLI_testextensie_n(
name,
".swf",
".txt",
".mpg",
".vob", /* disabled, vob is essential .mpg, don't handle */
".avi", /* wouldn't be appropriate ;) */
".mov", /* disabled, suboptimal decoding speed */
".mp4", /* disabled, suboptimal decoding speed */
".m4v", /* disabled, suboptimal decoding speed */
".tga",
".png",
".bmp",
".jpg",
".tif",
".exr",
".wav",
".zip",
".mp3",
NULL))
{
return 0;
}
if (QTIME_DEBUG) printf("qt: checking as movie: %s\n", name);
pool = [[NSAutoreleasePool alloc] init];
if ([QTMovie canInitWithFile:[NSString stringWithCString:name
encoding:[NSString defaultCStringEncoding]]])
{
[pool drain];
return true;
}
else
{
[pool drain];
return false;
}
}
void free_anim_quicktime(struct anim *anim)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (anim == NULL) return;
if (anim->qtime == NULL) return;
if (anim->qtime->ibuf)
IMB_freeImBuf(anim->qtime->ibuf);
[anim->qtime->media release];
[anim->qtime->movie release];
[QTMovie exitQTKitOnThread];
if (anim->qtime) MEM_freeN (anim->qtime);
anim->qtime = NULL;
anim->duration = 0;
[pool drain];
}
static ImBuf *nsImageToiBuf(NSImage *sourceImage, int width, int height)
{
ImBuf *ibuf = NULL;
uchar *rasterRGB = NULL;
uchar *rasterRGBA = NULL;
uchar *toIBuf = NULL;
int x, y, to_i, from_i;
NSSize bitmapSize;
NSBitmapImageRep *blBitmapFormatImageRGB,*blBitmapFormatImageRGBA, *bitmapImage = nil;
NSEnumerator *enumerator;
NSImageRep *representation;
ibuf = IMB_allocImBuf(width, height, 32, IB_rect);
if (!ibuf) {
if (QTIME_DEBUG) {
printf("quicktime_import: could not allocate memory for the image.\n");
}
return NULL;
}
/*Get the bitmap of the image*/
enumerator = [[sourceImage representations] objectEnumerator];
while ((representation = [enumerator nextObject])) {
if ([representation isKindOfClass:[NSBitmapImageRep class]]) {
bitmapImage = (NSBitmapImageRep *)representation;
break;
}
}
if (bitmapImage == nil) return NULL;
if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0)
&& ![bitmapImage isPlanar]) {
/* Try a fast copy if the image is a meshed RGBA 32bit bitmap*/
toIBuf = (uchar *)ibuf->rect;
rasterRGB = (uchar *)[bitmapImage bitmapData];
for (y = 0; y < height; y++) {
to_i = (height-y-1)*width;
from_i = y*width;
memcpy(toIBuf+4*to_i, rasterRGB+4*from_i, 4*width);
}
}
else {
bitmapSize.width = width;
bitmapSize.height = height;
/* Tell cocoa image resolution is same as current system one */
[bitmapImage setSize:bitmapSize];
/* Convert the image in a RGBA 32bit format */
/* As Core Graphics does not support contextes with non premutliplied alpha,
* we need to get alpha key values in a separate batch */
/* First get RGB values w/o Alpha to avoid pre-multiplication, 32bit but last byte is unused */
blBitmapFormatImageRGB = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:width
pixelsHigh:height
bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO
colorSpaceName:NSDeviceRGBColorSpace
bitmapFormat:0
bytesPerRow:4*width
bitsPerPixel:32/*RGB format padded to 32bits*/];
[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:blBitmapFormatImageRGB]];
[bitmapImage draw];
[NSGraphicsContext restoreGraphicsState];
rasterRGB = (uchar *)[blBitmapFormatImageRGB bitmapData];
if (rasterRGB == NULL) {
[blBitmapFormatImageRGB release];
return NULL;
}
/* Then get Alpha values by getting the RGBA image (that is premultiplied btw) */
blBitmapFormatImageRGBA = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:width
pixelsHigh:height
bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO
colorSpaceName:NSDeviceRGBColorSpace
bitmapFormat:0
bytesPerRow:4*width
bitsPerPixel:32/* RGBA */];
[NSGraphicsContext saveGraphicsState];
[NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:blBitmapFormatImageRGBA]];
[bitmapImage draw];
[NSGraphicsContext restoreGraphicsState];
rasterRGBA = (uchar *)[blBitmapFormatImageRGBA bitmapData];
if (rasterRGBA == NULL) {
[blBitmapFormatImageRGB release];
[blBitmapFormatImageRGBA release];
return NULL;
}
/*Copy the image to ibuf, flipping it vertically*/
toIBuf = (uchar *)ibuf->rect;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
to_i = (height-y-1)*width + x;
from_i = y*width + x;
toIBuf[4*to_i] = rasterRGB[4*from_i]; /* R */
toIBuf[4*to_i+1] = rasterRGB[4*from_i+1]; /* G */
toIBuf[4*to_i+2] = rasterRGB[4*from_i+2]; /* B */
toIBuf[4*to_i+3] = rasterRGBA[4*from_i+3]; /* A */
}
}
[blBitmapFormatImageRGB release];
[blBitmapFormatImageRGBA release];
}
return ibuf;
}
ImBuf *qtime_fetchibuf (struct anim *anim, int position)
{
NSImage *frameImage;
QTTime time;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
ImBuf *ibuf;
if (anim == NULL) {
return (NULL);
}
if (position == anim->qtime->previousPosition+1) { //Optimize sequential read
[anim->qtime->movie stepForward];
frameImage = [anim->qtime->movie currentFrameImage];
anim->qtime->previousPosition++;
}
else {
time.timeScale = anim->qtime->durationScale;
time.timeValue = (anim->qtime->durationTime * position) / anim->qtime->framecount;
[anim->qtime->movie setCurrentTime:time];
frameImage = [anim->qtime->movie currentFrameImage];
anim->qtime->previousPosition = position;
}
if (frameImage == nil) {
if (QTIME_DEBUG) printf ("Error reading frame from Quicktime");
[pool drain];
return NULL;
}
ibuf = nsImageToiBuf(frameImage,anim->x, anim->y);
[pool drain];
return ibuf;
}
int startquicktime(struct anim *anim)
{
NSAutoreleasePool *pool;
NSArray* videoTracks;
NSSize frameSize;
QTTime qtTimeDuration;
NSDictionary *attributes;
anim->qtime = MEM_callocN(sizeof(QuicktimeMovie),"animqt");
if (anim->qtime == NULL) {
if (QTIME_DEBUG) printf("Can't alloc qtime: %s\n", anim->name);
return -1;
}
pool = [[NSAutoreleasePool alloc] init];
[QTMovie enterQTKitOnThread];
attributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithCString:anim->name
encoding:[NSString defaultCStringEncoding]], QTMovieFileNameAttribute,
[NSNumber numberWithBool:NO], QTMovieEditableAttribute,
nil];
anim->qtime->movie = [QTMovie movieWithAttributes:attributes error:NULL];
if (!anim->qtime->movie) {
if (QTIME_DEBUG) printf("qt: bad movie %s\n", anim->name);
MEM_freeN(anim->qtime);
if (QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
[QTMovie exitQTKitOnThread];
[pool drain];
return -1;
}
[anim->qtime->movie retain];
// sets Media and Track!
videoTracks = [anim->qtime->movie tracksOfMediaType:QTMediaTypeVideo];
if ([videoTracks count] == 0) {
if (QTIME_DEBUG) printf("qt: no video tracks for movie %s\n", anim->name);
[anim->qtime->movie release];
MEM_freeN(anim->qtime);
if (QTIME_DEBUG) printf("qt: can't load %s\n", anim->name);
[QTMovie exitQTKitOnThread];
[pool drain];
return -1;
}
anim->qtime->media = [[videoTracks objectAtIndex:0] media];
[anim->qtime->media retain];
frameSize = [[anim->qtime->movie attributeForKey:QTMovieNaturalSizeAttribute] sizeValue];
anim->x = frameSize.width;
anim->y = frameSize.height;
if (anim->x == 0 && anim->y == 0) {
if (QTIME_DEBUG) printf("qt: error, no dimensions\n");
free_anim_quicktime(anim);
[pool drain];
return -1;
}
anim->qtime->ibuf = IMB_allocImBuf(anim->x, anim->y, 32, IB_rect);
qtTimeDuration = [[anim->qtime->media attributeForKey:QTMediaDurationAttribute] QTTimeValue];
anim->qtime->durationTime = qtTimeDuration.timeValue;
anim->qtime->durationScale = qtTimeDuration.timeScale;
anim->qtime->framecount = [[anim->qtime->media attributeForKey:QTMediaSampleCountAttribute] longValue];
anim->qtime->previousPosition = -2; //Force seeking for first read
//fill blender's anim struct
anim->duration = anim->qtime->framecount;
anim->params = 0;
anim->interlacing = 0;
anim->orientation = 0;
anim->framesize = anim->x * anim->y * 4;
anim->curposition = 0;
[pool drain];
return 0;
}
#endif /* WITH_QUICKTIME */

@ -1,162 +0,0 @@
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/quicktime/quicktime_export.h
* \ingroup quicktime
*/
#ifndef __QUICKTIME_EXPORT_H__
#define __QUICKTIME_EXPORT_H__
#if defined (_WIN32) || (__APPLE__)
#define __AIFF__
#define QTAUDIO_FLAG_RESAMPLE_NOHQ 1
#define QTAUDIO_FLAG_CODEC_ISCBR 2
/*Codec list*/
typedef struct QuicktimeCodecTypeDesc {
int codecType;
int rnatmpvalue;
const char *codecName;
} QuicktimeCodecTypeDesc;
// quicktime movie output functions
struct ImageFormatData;
struct RenderData;
struct ReportList;
struct Scene;
int start_qt(void *context_v, struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports, bool preview, const char *suffix); //for movie handle (BKE writeavi.c now)
int append_qt(void *context_v, struct RenderData *rd, int start_frame, int frame, int *pixels, int rectx, int recty, const char *suffix, struct ReportList *reports);
void end_qt(void *context_v);
void filepath_qt(char *string, struct RenderData *rd, bool preview, const char *suffix);
void *context_create_qt(void);
void context_free_qt(void *context_v);
/*RNA helper functions */
void quicktime_verify_image_type(struct RenderData *rd, struct ImageFormatData *imf); //used by RNA for defaults values init, if needed
/*Video codec type*/
int quicktime_get_num_videocodecs(void);
QuicktimeCodecTypeDesc *quicktime_get_videocodecType_desc(int indexValue);
int quicktime_rnatmpvalue_from_videocodectype(int codecType);
int quicktime_videocodecType_from_rnatmpvalue(int rnatmpvalue);
/*Audio codec type*/
int quicktime_get_num_audiocodecs(void);
QuicktimeCodecTypeDesc *quicktime_get_audiocodecType_desc(int indexValue);
int quicktime_rnatmpvalue_from_audiocodectype(int codecType);
int quicktime_audiocodecType_from_rnatmpvalue(int rnatmpvalue);
void free_qtcomponentdata(void);
void makeqtstring(struct RenderData *rd, char *string, bool preview); //for playanim.c
#ifdef __APPLE__
//Include the quicktime codec types constants that are missing in QTKitDefines.h
enum {
kRawCodecType = 'raw ',
kCinepakCodecType = 'cvid',
kGraphicsCodecType = 'smc ',
kAnimationCodecType = 'rle ',
kVideoCodecType = 'rpza',
kComponentVideoCodecType = 'yuv2',
kJPEGCodecType = 'jpeg',
kMotionJPEGACodecType = 'mjpa',
kMotionJPEGBCodecType = 'mjpb',
kSGICodecType = '.SGI',
kPlanarRGBCodecType = '8BPS',
kMacPaintCodecType = 'PNTG',
kGIFCodecType = 'gif ',
kPhotoCDCodecType = 'kpcd',
kQuickDrawGXCodecType = 'qdgx',
kAVRJPEGCodecType = 'avr ',
kOpenDMLJPEGCodecType = 'dmb1',
kBMPCodecType = 'WRLE',
kWindowsRawCodecType = 'WRAW',
kVectorCodecType = 'path',
kQuickDrawCodecType = 'qdrw',
kWaterRippleCodecType = 'ripl',
kFireCodecType = 'fire',
kCloudCodecType = 'clou',
kH261CodecType = 'h261',
kH263CodecType = 'h263',
kDVCNTSCCodecType = 'dvc ', /* DV - NTSC and DVCPRO NTSC (available in QuickTime 6.0 or later)*/
/* NOTE: kDVCProNTSCCodecType is deprecated. */
/* Use kDVCNTSCCodecType instead -- as far as the codecs are concerned, */
/* the two data formats are identical.*/
kDVCPALCodecType = 'dvcp',
kDVCProPALCodecType = 'dvpp', /* available in QuickTime 6.0 or later*/
kDVCPro50NTSCCodecType = 'dv5n',
kDVCPro50PALCodecType = 'dv5p',
kDVCPro100NTSCCodecType = 'dv1n',
kDVCPro100PALCodecType = 'dv1p',
kDVCPROHD720pCodecType = 'dvhp',
kDVCPROHD1080i60CodecType = 'dvh6',
kDVCPROHD1080i50CodecType = 'dvh5',
kBaseCodecType = 'base',
kFLCCodecType = 'flic',
kTargaCodecType = 'tga ',
kPNGCodecType = 'png ',
kTIFFCodecType = 'tiff', /* NOTE: despite what might seem obvious from the two constants*/
/* below and their names, they really are correct. 'yuvu' really */
/* does mean signed, and 'yuvs' really does mean unsigned. Really. */
kComponentVideoSigned = 'yuvu',
kComponentVideoUnsigned = 'yuvs',
kCMYKCodecType = 'cmyk',
kMicrosoftVideo1CodecType = 'msvc',
kSorensonCodecType = 'SVQ1',
kSorenson3CodecType = 'SVQ3', /* available in QuickTime 5 and later*/
kIndeo4CodecType = 'IV41',
kMPEG4VisualCodecType = 'mp4v',
k64ARGBCodecType = 'b64a',
k48RGBCodecType = 'b48r',
k32AlphaGrayCodecType = 'b32a',
k16GrayCodecType = 'b16g',
kMpegYUV420CodecType = 'myuv',
kYUV420CodecType = 'y420',
kSorensonYUV9CodecType = 'syv9',
k422YpCbCr8CodecType = '2vuy', /* Component Y'CbCr 8-bit 4:2:2 */
k444YpCbCr8CodecType = 'v308', /* Component Y'CbCr 8-bit 4:4:4 */
k4444YpCbCrA8CodecType = 'v408', /* Component Y'CbCrA 8-bit 4:4:4:4 */
k422YpCbCr16CodecType = 'v216', /* Component Y'CbCr 10,12,14,16-bit 4:2:2*/
k422YpCbCr10CodecType = 'v210', /* Component Y'CbCr 10-bit 4:2:2 */
k444YpCbCr10CodecType = 'v410', /* Component Y'CbCr 10-bit 4:4:4 */
k4444YpCbCrA8RCodecType = 'r408', /* Component Y'CbCrA 8-bit 4:4:4:4, rendering format. full range alpha, zero biased yuv*/
kJPEG2000CodecType = 'mjp2',
kPixletCodecType = 'pxlt',
kH264CodecType = 'avc1'
};
#endif
#endif /* (_WIN32) || (__APPLE__) */
#endif /* __QUICKTIME_IMP_H__ */

@ -1,63 +0,0 @@
/*
* Quicktime_import.h
*
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* The Original Code is Copyright (C) 2002-2003 by TNCCI Inc.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/quicktime/quicktime_import.h
* \ingroup quicktime
*/
#ifndef __QUICKTIME_IMPORT_H__
#define __QUICKTIME_IMPORT_H__
#define __AIFF__
#include "../imbuf/IMB_imbuf.h"
#include "../imbuf/IMB_imbuf_types.h"
#ifdef _WIN32
# ifndef __FIXMATH__
# include <FixMath.h>
# endif /* __FIXMATH__ */
#endif /* _WIN32 _ */
/* init/exit */
void quicktime_init(void);
void quicktime_exit(void);
/* quicktime movie import functions */
int anim_is_quicktime(const char *name);
int startquicktime(struct anim *anim);
void free_anim_quicktime(struct anim *anim);
ImBuf *qtime_fetchibuf(struct anim *anim, int position);
#endif /* __QUICKTIME_IMPORT_H__ */

@ -149,16 +149,6 @@ if(WITH_FREESTYLE)
add_definitions(-DWITH_FREESTYLE)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../quicktime
)
list(APPEND INC_SYS
${QUICKTIME_INCLUDE_DIRS}
)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_GAMEENGINE)
add_definitions(-DWITH_GAMEENGINE)
endif()

@ -50,10 +50,6 @@
#include "DEG_depsgraph.h"
#ifdef WITH_QUICKTIME
#include "quicktime_export.h"
#endif
/* this module */
#include "renderpipeline.h"
#include "render_types.h"

@ -114,16 +114,6 @@ if(WITH_OPENCOLLADA)
add_definitions(-DWITH_COLLADA)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND INC
../quicktime
)
list(APPEND INC_SYS
${QUICKTIME_INCLUDE_DIRS}
)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WITH_CODEC_FFMPEG)
list(APPEND INC_SYS
${FFMPEG_INCLUDE_DIRS}

@ -27,10 +27,6 @@
setup_libdirs()
if(WITH_CODEC_QUICKTIME)
add_definitions(-DWITH_QUICKTIME)
endif()
if(WIN32 AND NOT UNIX)
string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
@ -209,10 +205,6 @@ endif()
list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
endif()
if(WITH_CODEC_QUICKTIME)
list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
endif()
if(WITH_CXX_GUARDEDALLOC)
list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
endif()

@ -1113,7 +1113,7 @@ static const char arg_handle_image_type_set_doc[] =
"\t\tTGA RAWTGA JPEG IRIS IRIZ\n"
"\t\tAVIRAW AVIJPEG PNG BMP\n"
"\t(formats that can be compiled into blender, not available on all systems)\n"
"\t\tHDR TIFF EXR MULTILAYER MPEG FRAMESERVER QUICKTIME CINEON DPX DDS JP2"
"\t\tHDR TIFF EXR MULTILAYER MPEG FRAMESERVER CINEON DPX DDS JP2"
;
static int arg_handle_image_type_set(int argc, const char **argv, void *data)
{