From efd5e3c25401b43cbd7f909418835bb570db1ab3 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Fri, 22 Sep 2017 16:11:24 -0400 Subject: Remove quicktime support It has been deprecated since at least macOS 10.9 and fully removed in 10.12. I am unsure if we should remove it only in 2.8. But you cannot build blender with it supported when using a modern xcode version anyway so I would tend towards just removing it also for 2.79 if that ever happens. Reviewers: mont29, dfelinto, juicyfruit, brecht Reviewed By: mont29, brecht Subscribers: Blendify, brecht Maniphest Tasks: T52807 Differential Revision: https://developer.blender.org/D2333 --- source/blender/CMakeLists.txt | 4 - source/blender/blenkernel/BKE_global.h | 2 - source/blender/blenkernel/BKE_scene.h | 3 - source/blender/blenkernel/CMakeLists.txt | 10 - source/blender/blenkernel/intern/image.c | 8 +- source/blender/blenkernel/intern/scene.c | 22 - source/blender/blenkernel/intern/writeavi.c | 14 - source/blender/blenloader/intern/readfile.c | 5 - source/blender/blenloader/intern/writefile.c | 7 - source/blender/editors/render/CMakeLists.txt | 10 - source/blender/editors/space_file/filelist.c | 3 +- source/blender/imbuf/CMakeLists.txt | 10 - source/blender/imbuf/IMB_imbuf_types.h | 1 - source/blender/imbuf/intern/IMB_anim.h | 11 - source/blender/imbuf/intern/anim_movie.c | 33 - source/blender/imbuf/intern/filetype.c | 12 - source/blender/imbuf/intern/util.c | 39 - source/blender/makesdna/DNA_scene_types.h | 42 +- source/blender/makesrna/RNA_access.h | 1 - source/blender/makesrna/intern/CMakeLists.txt | 7 - source/blender/makesrna/intern/rna_scene.c | 200 ----- source/blender/python/intern/CMakeLists.txt | 4 - .../blender/python/intern/bpy_app_build_options.c | 7 - source/blender/quicktime/CMakeLists.txt | 62 -- source/blender/quicktime/apple/qtkit_export.m | 884 --------------------- source/blender/quicktime/apple/qtkit_import.m | 400 ---------- source/blender/quicktime/quicktime_export.h | 162 ---- source/blender/quicktime/quicktime_import.h | 63 -- source/blender/render/CMakeLists.txt | 10 - source/blender/render/intern/source/initrender.c | 4 - source/blender/windowmanager/CMakeLists.txt | 10 - 31 files changed, 6 insertions(+), 2044 deletions(-) delete mode 100644 source/blender/quicktime/CMakeLists.txt delete mode 100644 source/blender/quicktime/apple/qtkit_export.m delete mode 100644 source/blender/quicktime/apple/qtkit_import.m delete mode 100644 source/blender/quicktime/quicktime_export.h delete mode 100644 source/blender/quicktime/quicktime_import.h (limited to 'source/blender') diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 6f2b78e0845..818d4cd3d89 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -138,10 +138,6 @@ if(WITH_CODEC_AVI) add_subdirectory(avi) endif() -if(WITH_CODEC_QUICKTIME) - add_subdirectory(quicktime) -endif() - if(WITH_PYTHON) add_subdirectory(python) endif() diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 830518906ab..790c8051ace 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -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; diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index b7ecb85819e..481aff3cfa6 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -42,7 +42,6 @@ struct Base; struct EvaluationContext; struct Main; struct Object; -struct QuicktimeCodecData; struct RenderData; struct SceneRenderLayer; struct Scene; @@ -64,7 +63,6 @@ struct Main; 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(struct Scene *sce); void BKE_scene_init(struct Scene *sce); @@ -178,4 +176,3 @@ int BKE_scene_multiview_num_videos_get(const struct RenderData *rd); #endif #endif - diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 157c4408d6a..51598ede862 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -385,16 +385,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 diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index f8ed4843a99..90f2fe3d547 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1203,7 +1203,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: @@ -1275,7 +1274,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; @@ -1338,7 +1336,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; @@ -1449,7 +1446,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; } @@ -1457,8 +1454,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); } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index e8613d9ab9c..f1a6b244344 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -125,17 +125,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); @@ -273,12 +262,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); } @@ -512,11 +495,6 @@ void BKE_scene_free(Scene *sce) 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); diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index 89b2caa5ac7..2fb4ed03603 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -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; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index ff4c52967f3..f2d958adb95 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6162,11 +6162,6 @@ static void direct_link_scene(FileData *fd, Scene *sce) 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); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 6c5bfb01829..2648ebdc395 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2688,13 +2688,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); } diff --git a/source/blender/editors/render/CMakeLists.txt b/source/blender/editors/render/CMakeLists.txt index 971ab9f3458..ec8bf3e955d 100644 --- a/source/blender/editors/render/CMakeLists.txt +++ b/source/blender/editors/render/CMakeLists.txt @@ -51,16 +51,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() diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index d94aad640b7..48f3dd4fde6 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -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; } diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index b32f8c54cd6..c3950d8eb83 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -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 diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index 1701c2ba307..ee51854d7ed 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -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[]; diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h index 6d7ad7985f9..b10ae4f6fe9 100644 --- a/source/blender/imbuf/intern/IMB_anim.h +++ b/source/blender/imbuf/intern/IMB_anim.h @@ -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; diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index 5bb91efe186..25b0c0d7b1a 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -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); diff --git a/source/blender/imbuf/intern/filetype.c b/source/blender/imbuf/intern/filetype.c index 3d3e8a0646a..7ed5c8ffbcb 100644 --- a/source/blender/imbuf/intern/filetype.c +++ b/source/blender/imbuf/intern/filetype.c @@ -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 } diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index ba8480b636f..76a44aa81f7 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -52,10 +52,6 @@ #include "IMB_anim.h" -#ifdef WITH_QUICKTIME -#include "quicktime_import.h" -#endif - #ifdef WITH_FFMPEG #include #include @@ -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 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 34d6aae9717..de3c926c23d 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -99,42 +99,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, @@ -456,7 +420,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 @@ -585,8 +549,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' */ @@ -1729,6 +1691,8 @@ typedef struct Scene { /* Movie Tracking */ struct MovieClip *clip; /* active movie clip */ + void *pad4; + uint64_t customdata_mask; /* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */ uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */ diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index f83608fa24b..b8d12461ca6 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -488,7 +488,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; diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 9d0ba5586af..743d192f0c5 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -232,13 +232,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 diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 71350edeb94..cd0bcaf4cea 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -58,11 +58,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 @@ -291,9 +286,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} }; @@ -1125,9 +1117,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; } @@ -1317,84 +1306,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) { @@ -5738,106 +5649,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; @@ -5971,9 +5782,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"); @@ -6058,14 +5866,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"); diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt index be4db6477fe..dd84ce0ebe1 100644 --- a/source/blender/python/intern/CMakeLists.txt +++ b/source/blender/python/intern/CMakeLists.txt @@ -147,10 +147,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() diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c index a6b98567a9a..501e09dd6ad 100644 --- a/source/blender/python/intern/bpy_app_build_options.c +++ b/source/blender/python/intern/bpy_app_build_options.c @@ -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 diff --git a/source/blender/quicktime/CMakeLists.txt b/source/blender/quicktime/CMakeLists.txt deleted file mode 100644 index f853c35457f..00000000000 --- a/source/blender/quicktime/CMakeLists.txt +++ /dev/null @@ -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(${AUDASPACE_DEFINITIONS}) - - list(APPEND INC_SYS - ${AUDASPACE_C_INCLUDE_DIRS} - ) -endif() - -blender_add_lib(bf_quicktime "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m deleted file mode 100644 index 1ac3c58f888..00000000000 --- a/source/blender/quicktime/apple/qtkit_export.m +++ /dev/null @@ -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 -#include - -#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 -#import -#include - -#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 */ - diff --git a/source/blender/quicktime/apple/qtkit_import.m b/source/blender/quicktime/apple/qtkit_import.m deleted file mode 100644 index ba7ee0a8936..00000000000 --- a/source/blender/quicktime/apple/qtkit_import.m +++ /dev/null @@ -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 -#import - -#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 */ - diff --git a/source/blender/quicktime/quicktime_export.h b/source/blender/quicktime/quicktime_export.h deleted file mode 100644 index aaa3f5c9070..00000000000 --- a/source/blender/quicktime/quicktime_export.h +++ /dev/null @@ -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__ */ diff --git a/source/blender/quicktime/quicktime_import.h b/source/blender/quicktime/quicktime_import.h deleted file mode 100644 index 3c6b2028031..00000000000 --- a/source/blender/quicktime/quicktime_import.h +++ /dev/null @@ -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 -# 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__ */ diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index a12bdd910c3..27ec6bf8ba6 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -148,16 +148,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() diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 970a3937657..fbf18405093 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -48,10 +48,6 @@ #include "BKE_camera.h" -#ifdef WITH_QUICKTIME -#include "quicktime_export.h" -#endif - /* this module */ #include "renderpipeline.h" #include "render_types.h" diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index 925563a0777..f22ed34ca2e 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -100,16 +100,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} -- cgit v1.2.3