Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/quicktime/apple/qtkit_export.m')
-rw-r--r--source/blender/quicktime/apple/qtkit_export.m95
1 files changed, 62 insertions, 33 deletions
diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m
index 6788c22d9a1..59cd669d738 100644
--- a/source/blender/quicktime/apple/qtkit_export.m
+++ b/source/blender/quicktime/apple/qtkit_export.m
@@ -49,10 +49,6 @@
#include "MEM_guardedalloc.h"
-#include "quicktime_import.h"
-#include "quicktime_export.h"
-
-
#ifdef __APPLE__
/* evil */
#ifndef __AIFF__
@@ -65,6 +61,9 @@
#error OSX 10.5 minimum is needed for QTKit
#endif
+#include "quicktime_import.h"
+#include "quicktime_export.h"
+
#endif /* __APPLE__ */
typedef struct QuicktimeExport {
@@ -78,36 +77,65 @@ typedef struct QuicktimeExport {
static struct QuicktimeExport *qtexport;
+#pragma mark rna helper functions
-static NSString *stringWithCodecType(int codecType) {
- switch (codecType) {
- case QT_CODECTYPE_RAW:
- return @"raw ";
- case QT_CODECTYPE_MJPEGA:
- return @"mjpa";
- case QT_CODECTYPE_MJPEGB:
- return @"mjpb";
- case QT_CODECTYPE_DVCPAL:
- return @"dvcp";
- case QT_CODECTYPE_DVCNTSC:
- return @"dvc ";
- case QT_CODECTYPE_MPEG4:
- return @"mp4v";
- case QT_CODECTYPE_H263:
- return @"h263";
- case QT_CODECTYPE_H264:
- return @"avc1";
- case QT_CODECTYPE_DVCPROHD720p:
- return @"dvhp";
- case QT_CODECTYPE_DVCPROHD1080i50:
- return @"dvh5";
- case QT_CODECTYPE_DVCPROHD1080i60:
- return @"dvh6";
-
- case QT_CODECTYPE_JPEG:
- default:
- return @"jpeg";
+
+static QuicktimeCodecTypeDesc qtCodecList[] = {
+ {kRawCodecType, 1, "Uncompressed"},
+ {kJPEGCodecType, 2, "JPEG"},
+ {kMotionJPEGACodecType, 3, "M-JPEG A"},
+ {kMotionJPEGBCodecType, 4, "M-JPEG B"},
+ {kDVCPALCodecType, 5, "DV PAL"},
+ {kDVCNTSCCodecType, 6, "DV/DVCPRO NTSC"},
+ {kDVCPROHD720pCodecType, 7, "DVCPRO HD 720p"},
+ {kDVCPROHD1080i50CodecType, 8, "DVCPRO HD 1080i50"},
+ {kDVCPROHD1080i60CodecType, 9, "DVCPRO HD 1080i60"},
+ {kMPEG4VisualCodecType, 10, "MPEG4"},
+ {kH263CodecType, 11, "H.263"},
+ {kH264CodecType, 12, "H.264"},
+ {0,0,NULL}};
+
+static int qtCodecCount = 12;
+
+int quicktime_get_num_codecs() {
+ return qtCodecCount;
+}
+
+QuicktimeCodecTypeDesc* quicktime_get_codecType_desc(int indexValue) {
+ if ((indexValue>=0) && (indexValue < qtCodecCount))
+ return &qtCodecList[indexValue];
+ else
+ return NULL;
+}
+
+int quicktime_rnatmpvalue_from_codectype(int codecType) {
+ int i;
+ for (i=0;i<qtCodecCount;i++) {
+ if (qtCodecList[i].codecType == codecType)
+ return qtCodecList[i].rnatmpvalue;
}
+
+ return 0;
+}
+
+int quicktime_codecType_from_rnatmpvalue(int rnatmpvalue) {
+ int i;
+ for (i=0;i<qtCodecCount;i++) {
+ if (qtCodecList[i].rnatmpvalue == rnatmpvalue)
+ return qtCodecList[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) {
@@ -124,6 +152,7 @@ void makeqtstring (RenderData *rd, char *string) {
}
}
+#pragma mark export functions
void start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty)
{
@@ -264,7 +293,7 @@ void quicktime_verify_image_type(RenderData *rd)
(rd->qtcodecsettings.codecSpatialQuality <0) ||
(rd->qtcodecsettings.codecSpatialQuality > 100)) {
- rd->qtcodecsettings.codecType = QT_CODECTYPE_JPEG;
+ rd->qtcodecsettings.codecType = kJPEGCodecType;
rd->qtcodecsettings.codecSpatialQuality = (codecHighQuality*100)/codecLosslessQuality;
}
}