Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

quicktime - once more into the breech

 
   Macintosh computer (Home) -> General Discussion RSS
Next:  Does Mac OS 9/8 have an IrDA stack?  
Author Message
edens morgan mair

External


Since: Jun 07, 2004
Posts: 3



(Msg. 1) Posted: Mon Jun 07, 2004 4:33 pm
Post subject: quicktime - once more into the breech
Archived from groups: comp>sys>mac>programmer>misc (more info?)

for a osx project i need to extract the first frame of a movie into a png image
i think i found the code

GraphicsExportComponent ge = 0;
CFStringRef outpath;
CFURLRef outurl;
FSRef outfsref;
FSSpec outfsspec;
outpath = CFStringCreateWithCString(NULL,"./image.png",
kCFStringEncodingASCII);
outurl = CFURLCreateWithFileSystemPath(NULL,outpath,
kCFURLPOSIXPathStyle,false);
CFURLGetFSRef(outurl,&outfsref);
FSGetCatalogInfo(&outfsref,kFSCatInfoNone,
NULL,NULL,&outfsspec,NULL);
OpenADefaultComponent(GraphicsExporterComponentType,
kQTFileTypePNG,&ge);
ComponentResult GraphicsExportSetInputGraphicsImporter(ge,movie);
GraphicsExportSetOutputFile(ge,&outfsspec);
GraphicsExportDoExport(ge,nil);
CloseComponent(ge);

if anybody knows if that looks correct

also
where are the damn headers that define
GraphicsExportComponent
and all the rest if anybody knows

geez
i wish apple could figure out how to write man pages

 >> Stay informed about: quicktime - once more into the breech 
Back to top
Login to vote
Tom Dowdy

External


Since: Feb 26, 2004
Posts: 116



(Msg. 2) Posted: Mon Jun 07, 2004 6:10 pm
Post subject: Re: quicktime - once more into the breech [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <mair_fheal-403B8E.13325907062004.DeleteThis@corp.supernews.com>,
edens morgan mair fheal greykitten tomys des anges
<mair_fheal.DeleteThis@yahoo.com> wrote:

 > GraphicsExportSetInputGraphicsImporter(ge,movie);

A movie isn't a graphics importer. If you have any kind of param
checking turned on in your compiler, this should have kicked out tons of
errors.

You probably want to get the Picture from the movie via GetMoviePict and
then use GraphicsExportSetInputPicture.

 > also
 > where are the damn headers that define
 > GraphicsExportComponent
 > and all the rest if anybody knows

Movies.h ImageCompression.h
If using framework style includes, QuickTime/QuickTime.h will haul all
of them in.

 > i wish apple could figure out how to write man pages

There's gobs of QuickTime documentation and sample code online. It
isn't man pages, but there is quite a bit of it there.
<http://developer.apple.com/quicktime/><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: quicktime - once more into the breech 
Back to top
Login to vote
edens morgan mair

External


Since: Jun 07, 2004
Posts: 3



(Msg. 3) Posted: Mon Jun 07, 2004 7:38 pm
Post subject: Re: quicktime - once more into the breech [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <dowdy-230A9B.15100107062004.TakeThisOut@news.apple.com>,
Tom Dowdy <dowdy.TakeThisOut@apple.com> wrote:

 > In article <mair_fheal-403B8E.13325907062004.TakeThisOut@corp.supernews.com>,
 > edens morgan mair fheal greykitten tomys des anges
 > <mair_fheal.TakeThisOut@yahoo.com> wrote:
 >
  > > GraphicsExportSetInputGraphicsImporter(ge,movie);
 >
 > A movie isn't a graphics importer. If you have any kind of param
 > checking turned on in your compiler, this should have kicked out tons of
 > errors.

most of these things are void pointers so checking is turned off

 > You probably want to get the Picture from the movie via GetMoviePict and
 > then use GraphicsExportSetInputPicture.

thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you
thank you

it works
exactly what i need

thank you

  > > also
  > > where are the damn headers that define
  > > GraphicsExportComponent
  > > and all the rest if anybody knows
 >
 > Movies.h ImageCompression.h
 > If using framework style includes, QuickTime/QuickTime.h will haul all
 > of them in.

with cocoa the documentation gives the import directive
everytime with carbon i have to spend a hour or two looking
for the framework and include and all
cause i cant find any documenting map on what is where

offhand ive forgotten again find out what macos error numbers mean
while i can get unix errnos in one or two tries

  > > i wish apple could figure out how to write man pages
 >
 > There's gobs of QuickTime documentation and sample code online. It
 > isn't man pages, but there is quite a bit of it there.

it returns a pict handle
if you look up the documentation on how to write out the pict to a file
you end up with pascal code use fs-specs

it takes a half-dozen calls to go from a c string to cfstring to url
to fsref to ?fsspec to a file desingator
and still it didnt work (error -35)

since osx can use the extension instead of the finder info
i was able to open the file with
int fd = open("temp.pict",O_WRONLY|O_CREAT|O_TRUNC,0644);
and do it in one step

the carbon interfaces and their documentation are real mess<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: quicktime - once more into the breech 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 1083



(Msg. 4) Posted: Wed Jun 09, 2004 8:03 am
Post subject: Re: quicktime - once more into the breech [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <mair_fheal-416658.16384407062004.TakeThisOut@corp.supernews.com>,
edens morgan mair fheal greykitten tomys des anges
<mair_fheal.TakeThisOut@yahoo.com> wrote:

 > since osx can use the extension instead of the finder info
 > i was able to open the file with
 > int fd = open("temp.pict",O_WRONLY|O_CREAT|O_TRUNC,0644);

 > it takes a half-dozen calls to go from a c string to cfstring to url
 > to fsref to ?fsspec to a file desingator
 > and still it didnt work (error -35)

That's only because you don't know what you are doing. For your example,
with the error checking that is missing from your POSIX example:

#include <Movies.h>
#include <TextUtils.h>

Str255 s;
OSStatus e = noErr;
short ref = 0;
FSSpec fs;

CopyCStringToPascal("temp.pict", s);
if(noErr == e){ e = FSMakeFSSpec(0, 0, s, &fs); }
if(noErr == e){ e = OpenMovieFile(&fs, &ref, fsRdPerm); }
..... do the work
if(0 != ref){ e = CloseMovieFile(ref); }


error codes are mostly in MacErrors.h.

Most people set up their editor to search recursively in:

.../Metrowerks CodeWarrior 8.3/Metrowerks CodeWarrior/MacOS
Support/Universal/Interfaces/CIncludes


and if that doesn't work, the newer stuff can be found by the slower
recursive search of:

/System/Library/Frameworks/

David Phillip Oster<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: quicktime - once more into the breech 
Back to top
Login to vote
edens morgan mair

External


Since: Jun 07, 2004
Posts: 3



(Msg. 5) Posted: Wed Jun 09, 2004 8:03 am
Post subject: Re: quicktime - once more into the breech [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <oster-4AE361.22025808062004.RemoveThis@news.sf.sbcglobal.net>,
David Phillip Oster <oster.RemoveThis@ieee.org> wrote:

 > In article <mair_fheal-416658.16384407062004.RemoveThis@corp.supernews.com>,
 > edens morgan mair fheal greykitten tomys des anges
 > <mair_fheal.RemoveThis@yahoo.com> wrote:
 >
  > > since osx can use the extension instead of the finder info
  > > i was able to open the file with
  > > int fd = open("temp.pict",O_WRONLY|O_CREAT|O_TRUNC,0644);
 >
  > > it takes a half-dozen calls to go from a c string to cfstring to url
  > > to fsref to ?fsspec to a file desingator
  > > and still it didnt work (error -35)
 >
 > That's only because you don't know what you are doing. For your example,
 > with the error checking that is missing from your POSIX example:

actually its the call to convert an fs-ref to an fs-spec
required the file to already exists
and i couldnt find the equivalent of fspcreate

thats when i punted the whole thing and used the unix calls
because i remember osx can identify off the extension instead of finder info

if youve done as much unix program as i have
you see what a mess the macintosh interface is
you still have interfaces that go all the back to 1984
that should be shuffled off to appendices as strongly deprecated

for example there is no need any longer for things like fsread
when read and fread do the same thing more portably

cocoa is redoing the interfaces
and its much better
perhaps even better than traditional unix interfaces

i hope apple plans to put a cocoa interface for everyting

 > and if that doesn't work, the newer stuff can be found by the slower
 > recursive search of:
 >
 > /System/Library/Frameworks/

(find /System/Library/Frameworks -type f -print | xargs grep plover | more)

but still it misses some things

arf arf<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: quicktime - once more into the breech 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How do i embed Quicktime in my Mac OS X app? - How do I embed a Quicktime 'object' in my Mac OS X app, quickly a easily? TIA

Quicktime preview problems? - Hi, writing an app to edit quicktime movies.... I can add one modifier track and there are no problems, but if I have two tracks (stacked effects) then the calls MakeFilePreview(); return a black frame.... Also the call to GetMoviePict() reutns the sam...

quicktime callbacks problem - Hello, I'm working on a Director plugin that plays tracks off of a CD. I'm a bit stumped as to how to get it to play more than one track in sequence. Here's what I'd *like* to do: Set a callback to be triggered at the end of the track. This callback ...

Job: Looking for expert QuickTime programmer - I'd like to hire someone very familiar with QuickTime to assist me with a project over the next few weeks. I'll be asking design-level questions, such as "what's the best approach to this issue?" and "what should I watch out for?" ra...

Quicktime callback issue (2nd try) - Howdy, I'm trying to install a callback in a faceless q&#118;icktime app I'm developing in Codewarrior &#118;sing Carbon. For the life of me I can't get it to work. My playback code goes basically like this: EnterMovies(); OpenMovieFil...
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]