Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QuickTime throwing exceptions on Windows?



Title: QuickTime throwing exceptions on Windows?
Something very weird...

Using the QuickTime for Windows API’s, we are using the GraphicsExportDoExport call in our code to convert from BMP to JPEG in memory, as follows:

ComponentInstance imgImporter = nil;
OpenADefaultComponent(GraphicsImporterComponentType, kQTFileTypeBMP, &imgImporter);
if(imgDataHandle && imgImporter)
{
    HLock(imgDataHandle); -- a handle to contents of a BMP file read into memory
    GraphicsImportSetDataHandle(imgImporter, imgDataHandle);
    ComponentInstance imgExporter = nil;
    OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypeJPEG, &imgExporter);
    if(GraphicsExportSetInputGraphicsImporter(imgExporter, imgImporter) == noErr)
    {
        Handle imgSmallHandle = NewHandle(0);
        GraphicsExportSetCompressionQuality(imgExporter, codecHighQuality);
        GraphicsExportSetOutputHandle(imgExporter, imgSmallHandle);
        unsigned long lSizeWritten = 0;
        if (GraphicsExportDoExport(imgExporter, &lSizeWritten) == noErr)
        {
            ...
        }
        ...
    }
 }

This is all pretty much right out of the QuickTime programmers guide.  However, we’re seeing something VERY strange happen in some cases.  It doesn’t happen all the time, and it doesn’t appear to be related to a specific bitmap file or anything else that we can determine.  This code is part of a server component that is running on Windows, so it gets hammered with hundreds of files an hour, and it has proven quite difficult to pin down.

What we’re seeing is that the call to GraphicsExportDoExport is THROWING a C++ exception...!  After many cups of coffee trying to figure out why things were just exiting unexpectedly, one of our programmers put a try...catch block around the call to GraphicsExportDoExport, and voila, we ended up in the catch block periodically.  We know this because we log an event to our server’s log file when we drop into the catch block, and that event is showing up.

Isn’t QuickTime a “C” API??? What’s a C API doing throwing exceptions I ask you?

I’m at a loss here, and more than a bit concerned, as we have an entire application on the Mac side that makes very heavy use of QuickTime, and we’ve coded the entire thing without a single try...catch block around QuickTime calls, on the understanding that, like most everything else in the Toolbox, errors are reported via return codes, not exceptions.  Is this changing?  Should I be rewriting everything?

Steve.
--------------------------------------------------
Steve Sauder
Chief Technical Officer
North Plains Systems Corp.

P: 416 345 1900 x 500
email@hidden

www.northplains.com

“Bringing FOCUS to Digital Asset Management”

Confidentiality Notice:
The information contained herein is confidential and proprietary to North Plains Systems Corp. ("North Plains") and is intended for review by authorized persons only. Except as may otherwise be agreed to in writing by North Plains, any disclosure, circulation, release or use of the information contained herein is strictly prohibited
 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.