Re: Codec type from QTMovie/QTMedia/QTTrack
Re: Codec type from QTMovie/QTMedia/QTTrack
- Subject: Re: Codec type from QTMovie/QTMedia/QTTrack
- From: Tim Monroe <email@hidden>
- Date: Mon, 8 Aug 2005 08:51:43 -0700
On Aug 7, 2005, at 11:28 AM, Ben Braken wrote:
I've been trawling through the QuickTime / Cocoa API and have been
unsuccessful in finding a simple way to determine the codec type of
separate tracks in QTMovie/QTTrack/QTMedia objects. I'm relatively new
to programming on Macs, and have been pretty much confined to Cocoa and
Objective-C, so finding/using the pure C functions which are the
quicktime API is quite a tedious and time consuming task.
[SNIP]
What I'm wonder if there's a high level method for a QTTrack or QTMedia
object for retrieving codec type, or a single function from the
QuickTime API which I've just totally missed, or is going through and
using 4 separate functions to get 4 bytes of information the only way?
Try this:
ImageDescriptionHandle desc =
(ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription));
GetMediaSampleDescription([media quickTimeMedia], 1,
(SampleDescriptionHandle)desc);
After calling GetMediaSampleDescription, then (**desc).cType should
have the codec type you are looking for. Don;t forget to dispose of the
memory:
...
DisposeHandle((Handle)desc);
Tim Monroe
QuickTime Engineering
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden