Revision: 25521
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25521
Author:   blendix
Date:     2009-12-22 16:20:31 +0100 (Tue, 22 Dec 2009)

Log Message:
-----------
Attempt to fix compilation of quicktime after reporting changes
(can't build this file myself, only qtkit seems to work here).

Modified Paths:
--------------
    trunk/blender/source/blender/quicktime/apple/qtkit_export.m
    trunk/blender/source/blender/quicktime/apple/quicktime_export.c
    trunk/blender/source/blender/quicktime/quicktime_export.h

Modified: trunk/blender/source/blender/quicktime/apple/qtkit_export.m
===================================================================
--- trunk/blender/source/blender/quicktime/apple/qtkit_export.m 2009-12-22 
12:01:32 UTC (rev 25520)
+++ trunk/blender/source/blender/quicktime/apple/qtkit_export.m 2009-12-22 
15:20:31 UTC (rev 25521)
@@ -39,6 +39,7 @@
 
 #include "BKE_global.h"
 #include "BKE_scene.h"
+#include "BKE_report.h"
 
 #include "BLI_blenlib.h"
 
@@ -167,7 +168,7 @@
        
        /* 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_EROR, "\nUnable to create quicktime 
movie, need Quicktime rev 7.2.1 or later");
+               BKE_report(reports, RPT_ERROR, "\nUnable to create quicktime 
movie, need Quicktime rev 7.2.1 or later");
                success= 0;
        }
        else {

Modified: trunk/blender/source/blender/quicktime/apple/quicktime_export.c
===================================================================
--- trunk/blender/source/blender/quicktime/apple/quicktime_export.c     
2009-12-22 12:01:32 UTC (rev 25520)
+++ trunk/blender/source/blender/quicktime/apple/quicktime_export.c     
2009-12-22 15:20:31 UTC (rev 25521)
@@ -37,9 +37,10 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+#include "BKE_context.h"
 #include "BKE_global.h"
+#include "BKE_report.h"
 #include "BKE_scene.h"
-#include "BKE_context.h"
 
 #include "BLI_blenlib.h"
 
@@ -76,13 +77,13 @@
 #define        kTrackStart             0
 #define        kMediaStart             0
 
-static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, 
int recty);
-static void QT_DoAddVideoSamplesToMedia (int frame, int *pixels, int rectx, 
int recty);
+static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, 
int recty, struct ReportList *reports);
+static void QT_DoAddVideoSamplesToMedia (int frame, int *pixels, int rectx, 
int recty, struct ReportList *reports);
 static void QT_EndAddVideoSamplesToMedia (void);
-static void QT_CreateMyVideoTrack (int rectx, int recty);
-static void QT_EndCreateMyVideoTrack (void);
-static void check_renderbutton_framerate(struct RenderData *rd);
-static int get_qtcodec_settings(struct RenderData *rd);
+static void QT_CreateMyVideoTrack (int rectx, int recty, struct ReportList 
*reports);
+static void QT_EndCreateMyVideoTrack (struct ReportList *reports);
+static void check_renderbutton_framerate(struct RenderData *rd, struct 
ReportList *reports);
+static int get_qtcodec_settings(struct RenderData *rd, struct ReportList 
*reports);
 
 typedef struct QuicktimeExport {
 
@@ -171,9 +172,12 @@
 
 
 
-static void CheckError(OSErr err, char *msg)
+static void CheckError(OSErr err, char *msg, ReportList *reports)
 {
-       if(err != noErr) printf("%s: %d\n", msg, err);
+       if(err != noErr) {
+               printf("%s: %d\n", msg, err);
+               BKE_reportf(reports, RPT_ERROR, "%s: %d", msg, err);
+       }
 }
 
 
@@ -316,7 +320,7 @@
 }
 
 
-static void QT_CreateMyVideoTrack(int rectx, int recty)
+static void QT_CreateMyVideoTrack(int rectx, int recty, ReportList *reports)
 {
        OSErr err = noErr;
        Rect trackFrame;
@@ -331,7 +335,7 @@
                                                        
FixRatio(trackFrame.right,1),
                                                        
FixRatio(trackFrame.bottom,1), 
                                                        0);
-       CheckError( GetMoviesError(), "NewMovieTrack error" );
+       CheckError( GetMoviesError(), "NewMovieTrack error", reports );
 
 //     SetIdentityMatrix(&myMatrix);
 //     ScaleMatrix(&myMatrix, fixed1, Long2Fix(-1), 0, 0);
@@ -343,34 +347,34 @@
                                                        qtdata->kVideoTimeScale,
                                                        nil,
                                                        0);
-       CheckError( GetMoviesError(), "NewTrackMedia error" );
+       CheckError( GetMoviesError(), "NewTrackMedia error", reports );
 
        err = BeginMediaEdits (qtexport->theMedia);
-       CheckError( err, "BeginMediaEdits error" );
+       CheckError( err, "BeginMediaEdits error", reports );
 
-       QT_StartAddVideoSamplesToMedia (&trackFrame, rectx, recty);
+       QT_StartAddVideoSamplesToMedia (&trackFrame, rectx, recty, reports);
 } 
 
 
-static void QT_EndCreateMyVideoTrack(void)
+static void QT_EndCreateMyVideoTrack(ReportList *reports)
 {
        OSErr err = noErr;
 
        QT_EndAddVideoSamplesToMedia ();
 
        err = EndMediaEdits (qtexport->theMedia);
-       CheckError( err, "EndMediaEdits error" );
+       CheckError( err, "EndMediaEdits error", reports );
 
        err = InsertMediaIntoTrack (qtexport->theTrack,
                                                                kTrackStart,/* 
track start time */
                                                                kMediaStart,/* 
media start time */
                                                                
GetMediaDuration (qtexport->theMedia),
                                                                fixed1);
-       CheckError( err, "InsertMediaIntoTrack error" );
+       CheckError( err, "InsertMediaIntoTrack error", reports );
 } 
 
 
-static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, 
int recty)
+static void QT_StartAddVideoSamplesToMedia (const Rect *trackFrame, int rectx, 
int recty, ReportList *reports)
 {
        SCTemporalSettings gTemporalSettings;
        OSErr err = noErr;
@@ -384,7 +388,7 @@
                                                        NULL, NULL, 0,
                                                        
(Ptr)qtexport->ibuf->rect,
                                                        rectx * 4 );
-       CheckError (err, "NewGWorldFromPtr error");
+       CheckError (err, "NewGWorldFromPtr error", reports);
 
        qtexport->thePixMap = GetGWorldPixMap(qtexport->theGWorld);
        LockPixels(qtexport->thePixMap);
@@ -407,11 +411,11 @@
        SCSetInfo(qtdata->theComponent, scDataRateSettingsType, 
&qtdata->aDataRateSetting);
 
        err = SCCompressSequenceBegin(qtdata->theComponent, 
qtexport->thePixMap, NULL, &qtexport->anImageDescription); 
-       CheckError (err, "SCCompressSequenceBegin error" );
+       CheckError (err, "SCCompressSequenceBegin error", reports );
 }
 
 
-static void QT_DoAddVideoSamplesToMedia (int frame, int *pixels, int rectx, 
int recty)
+static void QT_DoAddVideoSamplesToMedia (int frame, int *pixels, int rectx, 
int recty, ReportList *reports)
 {
        OSErr   err = noErr;
        Rect    imageRect;
@@ -453,7 +457,7 @@
                &compressedData,
                &dataSize,
                &syncFlag);
-       CheckError(err, "SCCompressSequenceFrame error");
+       CheckError(err, "SCCompressSequenceFrame error", reports);
 
        err = AddMediaSample(qtexport->theMedia,
                compressedData,
@@ -464,7 +468,7 @@
                1,
                syncFlag,
                NULL);
-       CheckError(err, "AddMediaSample error");
+       CheckError(err, "AddMediaSample error", reports);
 
        printf ("added frame %3d (frame %3d in movie): ", frame, frame-sframe);
 }
@@ -527,12 +531,12 @@
        qtdata = MEM_callocN(sizeof(QuicktimeComponentData), 
"QuicktimeCodecDataExt");
 
        if(rd->qtcodecdata == NULL || rd->qtcodecdata->cdParms == NULL) {
-               get_qtcodec_settings(rd);
+               get_qtcodec_settings(rd, reports);
        } else {
                qtdata->theComponent = 
OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
 
-               QT_GetCodecSettingsFromScene(rd);
-               check_renderbutton_framerate(rd);
+               QT_GetCodecSettingsFromScene(rd, reports);
+               check_renderbutton_framerate(rd, reports);
        }
        
        sframe = (rd->sfra);
@@ -551,9 +555,9 @@
        }
        close(myFile);
        err = FSPathMakeRef((const UInt8 *)theFullPath, &myRef, 0);
-       CheckError(err, "FsPathMakeRef error");
+       CheckError(err, "FsPathMakeRef error", reports);
        err = FSGetCatalogInfo(&myRef, kFSCatInfoNone, NULL, NULL, 
&qtexport->theSpec, NULL);
-       CheckError(err, "FsGetCatalogInfoRef error");
+       CheckError(err, "FsGetCatalogInfoRef error", reports);
 #endif
 #ifdef _WIN32
        qtname = get_valid_qtname(name);
@@ -571,7 +575,7 @@
                                                createMovieFileDeleteCurFile | 
createMovieFileDontCreateResFile,
                                                &qtexport->resRefNum, 
                                                &qtexport->theMovie );
-       CheckError(err, "CreateMovieFile error");
+       CheckError(err, "CreateMovieFile error", reports);
 
        if(err != noErr) {
                BKE_reportf(reports, RPT_ERROR, "Unable to create Quicktime 
movie: %s", name);
@@ -582,15 +586,16 @@
        } else {
                printf("Created QuickTime movie: %s\n", name);
 
-               QT_CreateMyVideoTrack(rectx, recty);
+               QT_CreateMyVideoTrack(rectx, recty, reports);
        }
 
        return success;
 }
 
 
-void append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int 
recty) {
-       QT_DoAddVideoSamplesToMedia(frame, pixels, rectx, recty);
+int append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int 
recty, ReportList *reports) {
+       QT_DoAddVideoSamplesToMedia(frame, pixels, rectx, recty, reports);
+       return 1;
 }
 
 
@@ -599,16 +604,16 @@
        short resId = movieInDataForkResID;
 
        if(qtexport->theMovie) {
-               QT_EndCreateMyVideoTrack();
+               QT_EndCreateMyVideoTrack(NULL);
 
                err = AddMovieResource (qtexport->theMovie, 
qtexport->resRefNum, &resId, qtexport->qtfilename);
-               CheckError(err, "AddMovieResource error");
+               CheckError(err, "AddMovieResource error", NULL);
 
                err = QT_AddUserDataTextToMovie(qtexport->theMovie, "Made with 
Blender", kUserDataTextInformation);
-               CheckError(err, "AddUserDataTextToMovie error");
+               CheckError(err, "AddUserDataTextToMovie error", NULL);
 
                err = UpdateMovieResource(qtexport->theMovie, 
qtexport->resRefNum, resId, qtexport->qtfilename);
-               CheckError(err, "UpdateMovieResource error");
+               CheckError(err, "UpdateMovieResource error", NULL);
 
                if(qtexport->resRefNum) CloseMovieFile(qtexport->resRefNum);
 
@@ -635,13 +640,13 @@
 }
 
 
-static void check_renderbutton_framerate(RenderData *rd) 
+static void check_renderbutton_framerate(RenderData *rd, ReportList *reports) 
 {
        // to keep float framerates consistent between the codec dialog and 
frs/sec button.
        OSErr   err;    
 
        err = SCGetInfo(qtdata->theComponent, scTemporalSettingsType,   
&qtdata->gTemporalSettings);
-       CheckError(err, "SCGetInfo fr error");
+       CheckError(err, "SCGetInfo fr error", reports);
 
        if( (rd->frs_sec == 24 || rd->frs_sec == 30 || rd->frs_sec == 60) &&
                (qtdata->gTemporalSettings.frameRate == 1571553 ||
@@ -654,7 +659,7 @@
        }
        
        err = SCSetInfo(qtdata->theComponent, scTemporalSettingsType,   
&qtdata->gTemporalSettings);
-       CheckError( err, "SCSetInfo error" );
+       CheckError( err, "SCSetInfo error", reports );
 
        if(qtdata->gTemporalSettings.frameRate == 1571553) {                    
// 23.98 fps
                qtdata->kVideoTimeScale = 24000;
@@ -688,7 +693,7 @@
        }
 }
 
-int get_qtcodec_settings(RenderData *rd) 
+int get_qtcodec_settings(RenderData *rd, ReportList *reports) 
 {
        OSErr err = noErr;
                // erase any existing codecsetting
@@ -724,14 +729,14 @@
                
                
                err = SCSetInfo(qtdata->theComponent, scTemporalSettingsType,   
&qtdata->gTemporalSettings);
-               CheckError(err, "SCSetInfo1 error");
+               CheckError(err, "SCSetInfo1 error", reports);
                err = SCSetInfo(qtdata->theComponent, scSpatialSettingsType,    
&qtdata->gSpatialSettings);
-               CheckError(err, "SCSetInfo2 error");
+               CheckError(err, "SCSetInfo2 error", reports);

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to