Ask a Question related to Mac Programming, Design and Development.
-
Edward de Jong #1
RE: OpenADefaultComponent
It appears that OpenADefaultComponent doesn't want the codec code as a
parameter; it instead wants to receive the quicktime file type constants.
These are entirely different. For example, the code code for JPEG files is
"jpeg", but the quicktime file type is "JPEG". The PICT file type comes
through the quickdraw codec "qdrw", but the type code is "PICT". How in the
world am I supposed to figure out what the file type was? I want to be able
to re-decode the contents of the file in RAM later on again, and I can get
the codec type from the ImageDescriptionHandle (which has cType field), but
where do I get the file type code???
Edward de Jong Guest
-
OpenADefaultComponent keeps returning -2003 error
I am doing exactly what Apple recommends in Q&A QTMTB56, where I want to explicitly open a graphics converter component. I am calling err =... -
Tom Dowdy #2
Re: OpenADefaultComponent
In article <BB8D5C33.152D8%edward@magicmouse.com>,
Edward de Jong <edward@magicmouse.com> wrote:
The reason is that there is not a one to one mapping. Many file> It appears that OpenADefaultComponent doesn't want the codec code as a
> parameter; it instead wants to receive the quicktime file type constants.
> These are entirely different. For example, the code code for JPEG files is
> "jpeg", but the quicktime file type is "JPEG". The PICT file type comes
> through the quickdraw codec "qdrw", but the type code is "PICT". How in the
> world am I supposed to figure out what the file type was? I want to be able
> to re-decode the contents of the file in RAM later on again, and I can get
> the codec type from the ImageDescriptionHandle (which has cType field), but
> where do I get the file type code???
types/extension will map to JPEG for example.
Well, if you are doing this from RAM "later on again" you could in fact
save away the file type at the time you are storing it in RAM. This
would be my recommendation for performance and speed.
However, if for some reason you can't/don't/won't have additional
storage to contain information about the original source you can use
(for many file types) the call GetGraphicsImporterForDataRef(). This
allows you to find the graphics importer able to draw a stream of data.
This works for popular file formats that contain enough identifying
information in their header. This includes things like GIF, JPEG, PNG,
etc.
Tom Dowdy Guest
-
Edward de Jong #3
RE: OpenADefaultComponent
It appears that GetGraphicsImporterForFile(), once you have opened up a
file, you can get the codec that was used. However, that codec 4 letter code
doesn't always correspond to the 4 letter file type code you need to pass to
OpenADefaultComponent.
I do have the ability to store information about the data stream I have.
But I can't seem to get from Quicktime the data type of the stream when I
first open it using GetGraphicsImporterForFile() - if I examine the codec
field, i see "jpeg", but the OpenADefaultComponent routine wants the
quicktime file types, not the code name. I the case of JPEG files, one
string is "jpeg", and the OpenA.. call wants "JPEG". For PICT files, you
get "qdrw" as the codec, but the file type is "PICT". But for Photoshop and
some others the two codes are the same. Anyway there doesn't seem to be
call that gives you the code you need to send to OpenA..
I am currently building a conversion table, where I manually map one 4
letter codec code into a 4 letter Quicktime file type for later decoding.
Edward de Jong Guest
-
Tom Dowdy #4
Re: OpenADefaultComponent
In article <BB8E0C78.1538C%edward@magicmouse.com>,
Edward de Jong <edward@magicmouse.com> wrote:
This is incorrect. GetComponentInfo() on the graphics importer returned> It appears that GetGraphicsImporterForFile(), once you have opened up a
> file, you can get the codec that was used. However, that codec 4 letter code
> doesn't always correspond to the 4 letter file type code you need to pass to
> OpenADefaultComponent.
by GetGraphicsImporterForFile() will in fact give you a graphics
importer that you can later open for later use rendering this same file.
Tom Dowdy Guest



Reply With Quote

