[xiph-commits] r13634 - in trunk/xiph-qt: . OggExport/src

arek at svn.xiph.org arek at svn.xiph.org
Sun Aug 26 13:28:21 PDT 2007


Author: arek
Date: 2007-08-26 13:28:21 -0700 (Sun, 26 Aug 2007)
New Revision: 13634

Modified:
   trunk/xiph-qt/ChangeLog
   trunk/xiph-qt/OggExport/src/stream_video.c
Log:
	patch by: mobodo at metakine dot com
	* OggExport/src/stream_video.c:
	Make OggExport use default/pre-configured settings when source
	video component doesn't specify any; don't treat paramErr as error
	while configuring video streams.



Modified: trunk/xiph-qt/ChangeLog
===================================================================
--- trunk/xiph-qt/ChangeLog	2007-08-26 18:41:50 UTC (rev 13633)
+++ trunk/xiph-qt/ChangeLog	2007-08-26 20:28:21 UTC (rev 13634)
@@ -1,5 +1,14 @@
 2007-08-26  Arek Korbik  <arkadini at gmail.com>
 
+	patch by: mobodo at metakine dot com
+
+	* OggExport/src/stream_video.c:
+	Make OggExport use default/pre-configured settings when source
+	video component doesn't specify any; don't treat paramErr as error
+	while configuring video streams.
+
+2007-08-26  Arek Korbik  <arkadini at gmail.com>
+
 	* OggImport/src/OggImport.c:
 	* OggImport/src/importer_types.h:
 	* OggImport/src/stream_theora.c:

Modified: trunk/xiph-qt/OggExport/src/stream_video.c
===================================================================
--- trunk/xiph-qt/OggExport/src/stream_video.c	2007-08-26 18:41:50 UTC (rev 13633)
+++ trunk/xiph-qt/OggExport/src/stream_video.c	2007-08-26 20:28:21 UTC (rev 13634)
@@ -631,10 +631,41 @@
     SCDataRateSettings ds = {0, 0, 0, 0};
     UInt32 tmp = 0;
     Fixed tmp_fixed = 0;
+    Boolean useConfiguredSettings;
 
     dbg_printf("[ vOE]  >> [%08lx] :: configure_stream()\n", (UInt32) globals);
 
     err = InvokeMovieExportGetPropertyUPP(si->refCon, si->trackID,
+                                          movieExportUseConfiguredSettings, &useConfiguredSettings,
+                                          si->getPropertyProc);
+    if (!err && useConfiguredSettings)
+    {
+        // useConfiguredSettings -> if this is set to true, the current settings
+        // should be used as a starting point.  Otherwise,  we should use
+        // default settings as the starting point.  Current settings would
+        // originate, for example, from MovieExportSetSettingsFromAtomContainer
+        // or from doing a MovieExportDoUserDialog
+
+        si->si_v.quality = globals->set_v_quality;
+        si->si_v.bitrate = globals->set_v_bitrate;
+        if (globals->set_v_keyrate != 0)
+            si->si_v.keyrate = globals->set_v_keyrate;
+
+        if (globals->set_v_fps != 0)
+            si->si_v.fps = globals->set_v_fps;
+        else if (globals->movie_fps != 0)
+            si->si_v.fps = globals->movie_fps;
+
+    }
+
+    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    // Temporal Settings
+
+    ts.temporalQuality = codecNormalQuality;
+    ts.frameRate = si->si_v.fps;
+    ts.frameRate = si->si_v.keyrate;
+
+    err = InvokeMovieExportGetPropertyUPP(si->refCon, si->trackID,
                                           scTemporalSettingsType, &ts,
                                           si->getPropertyProc);
     dbg_printf("[ vOE]  ts [%08lx] :: configure_stream() = %ld, [%ld, %f, %ld]\n", (UInt32) globals, err,
@@ -655,6 +686,12 @@
         //else leave the default setting
     }
 
+    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    // Spatial Settings
+
+    ss.spatialQuality = si->si_v.quality;
+    ss.depth = 24;
+
     err = InvokeMovieExportGetPropertyUPP(si->refCon, si->trackID,
                                           scSpatialSettingsType, &ss,
                                           si->getPropertyProc);
@@ -664,6 +701,14 @@
         si->si_v.quality = ss.spatialQuality;
     }
 
+    // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+    // Data Rate Settings
+
+    ds.dataRate = globals->set_v_bitrate;
+    ds.frameDuration = -1;
+    ds.minSpatialQuality = codecMinQuality;
+    ds.minTemporalQuality = codecMinQuality;
+
     err = InvokeMovieExportGetPropertyUPP(si->refCon, si->trackID,
                                           scDataRateSettingsType, &ds,
                                           si->getPropertyProc);
@@ -676,11 +721,13 @@
             si->si_v.bitrate = globals->set_v_bitrate;
     }
 
+    tmp_fixed = si->si_v.width;
     if (InvokeMovieExportGetPropertyUPP(si->refCon, si->trackID,
                                         movieExportWidth, &tmp_fixed,
                                         si->getPropertyProc) == noErr)
         si->si_v.width = tmp_fixed;
 
+    tmp_fixed = si->si_v.height;
     if (InvokeMovieExportGetPropertyUPP(si->refCon, si->trackID,
                                         movieExportHeight, &tmp_fixed,
                                         si->getPropertyProc) == noErr)
@@ -700,6 +747,13 @@
                (UInt32) globals, si->si_v.width / 65536.0,
                si->si_v.height / 65536.0);
 
+    if (err == paramErr) {
+        // don't return the last error from InvokeMovieExportGetPropertyUPP
+        // since it is allowed to return paramErr when it does not want to
+        // specify a parameter...
+        err = noErr;
+    }
+
     dbg_printf("[ vOE] <   [%08lx] :: configure_stream() = %ld\n", (UInt32) globals, err);
     return err;
 }



More information about the commits mailing list