Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

New QuickTime Restrictions APIs

QuickTime 6 introduces a group of new APIs that provide a mechanism to preflight operations on content that may be restricted. What this means is that, by utilizing these calls, you can determine which QuickTime functions are restricted for the current movie, that is, which operations will fail.

These calls also allow developers to see what restrictions are enforced for a particular version of QuickTime. Previously, in earlier versions of QuickTime, there was no mechanism in place to report restrictions on no save or kiosk movies. Now in QuickTime 6, you can use these new restriction APIs, discussed in this section.

QTGetMovieRestrictions

Returns the restrictions, if any, specified on a given movie.

OSErr QTGetMovieRestrictions (
   Movie theMovie,
   QTRestrictionSet *outRestrictionSet,
   UInt32 *outSeed);

Parameters
theMovie

The movie for this operation.

outRestrictionSet

A pointer to a variable that holds a reference to a restriction set.

outSeed

A pointer to a long integer. Each change to the restriction set will update this value.

Discussion

If there are no restrictions, this routine returns NIL. You can use seed count to detect changes.

The following is a list of the currently defined restrictions now available in QTContentRestrictions.h:

enum {
    kQTRestrictionClassSave = 'save',
    kQTRestrictionSaveDontAddMovieResource = (1L << 0),
    kQTRestrictionSaveDontFlatten = (1L << 1),
    kQTRestrictionSaveDontExport = (1L << 2),
    kQTRestrictionSaveDontExtract = (1L << 3), // don't allow any form of    // extraction of  content
 
    kQTRestrictionClassEdit = 'edit',
    kQTRestrictionEditDontCopy = (1L << 0), // disable copy
    kQTRestrictionEditDontCut = (1L << 1), // disable cut
    kQTRestrictionEditDontPaste = (1L << 2), // disable paste
    kQTRestrictionEditDontClear = (1L << 3), // disable clear
    kQTRestrictionEditDontModify = (1L << 4), // don't allow modification
                                              // of content
    kQTRestrictionEditDontExtract = (1L << 5) // don't allow any form of
                                            // extraction of content
};

There is also an error called qtOperationNotAuthorizedErr that can be returned if an operation is performed on content that is restricted. Normally, you should use the QuickTime Restrictions API described in this section to preflight operations to determine whether or not to perform the operation. If a restricted operation is attempted, it will fail and will return this error.

qtOperationNotAuthorizedErr = -2168

Introduced in QuickTime 6.

C interface file: Movies.h

Availability
Declared In
Movies.h

QTGetSupportedRestrictions

Use this routine to determine what restrictions are enforced by the currently running version of QuickTime.

QTGetSupportedRestrictions (OSType inRestrictionClass,
UInt32 *  outRestrictionIDs) ;

Availability
Declared In
Movies.h

QTRestrictionsGetInfo

Returns the information about the restrictions designated by the specified restriction set.

OSErr QTRestrictionsGetInfo (
   QTRestrictionSet inRestrictionSet,
   long *outRestrictionClassCount,
   long *outSeed);

Parameters
inRestrictionSet

The restricted set.

outRestrictionClassCount

A value holding the number of classes currently in the restriction set.

outSeed

A pointer to a long integer. Each change to the restriction set will update this value.

Discussion

If you want to determine all of the restrictions, use this routine to determine the count.

Introduced in QuickTime 6.

C interface file: Movies.h

Availability
Declared In
Movies.h

QTRestrictionsGetItem

Returns the restricted items.

OSErr QTRestrictionsGetItem (QTRestrictionSet inRestrictionSet,
   OSType inRestrictionClass,
   UInt32 * outRestrictions);

Parameters
inRestrictionSet

The restricted set.

inRestrictionClass

The restricted class.

outRestrictions

A pointer to a long integer holding flags that indicate individual restrictions.

Discussion

If you have no restrictions, the flags returned will be 0. If class is not available, it won’t return an error, but restrictions will be set to 0.

Introduced in QuickTime 6.

C interface file: Movies.h

Availability
Declared In
Movies.h

QTCreateUUID

Creates a universal unique (UUID)128-bit number.

OSErr QTCreateUUID (
   QTUUID * outUUID,
   long creationFlags);

Parameters
outUUID

A pointer to the unique universal 128-bit number.

creationFlags
Discussion

This routine is used to create a universal unique identifier.

Introduced in QuickTime 6.

C interface file: Movies.h

Availability
Declared In
Movies.h

QTEqualUUIDs

Compares two 128-bit numbers.

Boolean QTEqualUUIDs (const QTUUID * uuid1,
   const QTUUID *uuid2);

Parameters
uuid1

A pointer to the first 128-bit number.

uuid2

A pointer to the second 128-bit number.

Discussion

This routine is used to compare two universal unique identifiers.

Introduced in QuickTime 6.

C interface file: Movies.h

Availability
Declared In
Movies.h

< Previous PageNext Page > Hide TOC


Last updated: 2002-07-01




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice