Mailing Lists: Apple Mailing Lists

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

Re: Codec extended settings (again)



Your code for step 1 and 2 is going to look something like:

QTAtomContainer container;
char *straight_C_data;
size_t straight_C_size;

/* create my_comp as needed */
SCRequestSequenceSettings(my_comp);
SCGetSettingsAsAtomContainer(my_comp, &container);
straight_C_size = GetHandleSize((Handle)container);
straight_C_data = malloc(straight_C_size);
memcpy(straight_C_data, *container, straight_C_size);
QTDisposeAtomContainer(container);
 
Okay, now you've got your data in a buffer. Now you can store that to disk or send it over a network, or whatever. When step 3 comes along...

QTAtomContainer container;

/* create my_comp as needed */
PtrToHand(straight_C_data, (Handle *)&container, straight_C_size);
SCSetSettingsFromAtomContainer(my_comp, container);
QTDisposeAtomContainer(container);

...then call CompressSequenceBegin as normal and stuff. The basic trick here is that a QTAtomContainer is really a Handle, which is really a pointer to a pointer with some crazy magic stuck in somewhere so that it can be theoretically relocated and resized and stuff. At some point in the distant past, such a thing made sense, but it doesn't really any more, so new QT APIs don't really use Handles and relocatable memory much. You can read up on classic memory managment somewhere if you're interested in a history lesson.

-Henry

On Wednesday, December 21, 2005, at 10:39PM, Hugh Denman <email@hidden> wrote:

>Hi,
>
>I realise that this has come up here before, but unfortunately the
>information in that thread hasn't helped me.
>
>I want to do the following:
>
>1) display a compression settings dialog via SCRequestSequenceSettings
>2) capture all the information about the configuration into 'straight C' data
>3) in separate code, start image compression using
>CompressSequenceBegin, and have the compression of this sequence use
>the settings specified in '2'
>
>The interface between '2' and '3' cannot be QT-specific.
>
>Everything seems OK as regards the standard settings. However, I can't
>see how to get the extended data from the codec after displaying the
>dialog.
>
>I would like to use ImageCodecGetSettings to get the extended data,
>but how to get at the codec instance via SCGetInfo?
>
>I can access the 'codec' field in the SCSpatialSettings struct, but
>this isn't a ComponentInstance.
>
>scSettingsStateType looks like it returns more than just the codec state.
>
>As for specifying the extended settings, CompressSequenceBegin accepts
>a parameter 'CompressorComponent  codec', which I guess is the same as
>a 'CodecComponent' type. The discussion of this parameter mentions
>that
>
>'Specify a particular compressor by setting this parameter to its
>compressor identifier. Alternatively, you may use a special identifier
>(see below). Specifying a component instance may be useful if you have
>previously set some parameter on a specific instance of a codec field
>and want to make sure that the specified instance is used for that
>operation.
>
>--- but how to specify an instance? Passing a ComponentInstance where
>a CodecComponent is required reports cannot "convert
>'ComponentRecord*' to 'ComponentInstanceRecord*'"
>
>Any help with these questions greatly appreciated.
>
>Hugh Denman
>
>
>--
>email@hidden
>+353876290136
> _______________________________________________
>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
>
>
 _______________________________________________
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

References: 
 >Codec extended settings (again) (From: Hugh Denman <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.