Next Page > Hide TOC

QTFormatDescription Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/QTKit.framework
Availability
Available in QuickTime 7.2.1 and later.
Declared in
QTFormatDescription.h

Overview

QTFormatDescription objects are used to describe the media format of media samples and of media sources, such as devices and capture connections. Format descriptions include basic information about the media, such as media type and format type (or codec type), as well as extended information specific to each media type. The extended information can be accessed via the object's attributeForKey: and formatDescriptionAttributes methods, using the keys described in the “Core Audio and Video Types” section. In addition to these explicit methods, applications can use key-value coding to get extended attributes. For an object that supports a given attribute, valueForKey: will be functionally identical to attributeForKey:. Applications wishing to observe changes for a given attribute can add a key-value observer where the key path is the attribute key.

Tasks

Formatting Different Types of Media

Instance Methods

attributeForKey:

Returns the current value of the format description attribute for the given key.

- (id)attributeForKey:(NSString *)key

Parameters
key

The key for the desired format description attribute.

Discussion

Use this method to get attributes of a format description. The keys that can be used with this method are described in the Constants section. Applications using key-value coding can also get an attribute for a given key by passing that key to the NSObject valueForKey: method.

Availability
Declared In
QTFormatDescription.h

formatDescriptionAttributes

Returns a dictionary of all attributes set for the receiver.

- (NSDictionary *)formatDescriptionAttributes

Discussion

Applications can use this method to determine what attributes a specific format description supports.

Availability
Declared In
QTFormatDescription.h

formatType

Returns the format type of the described media, a four character code representing the format or codec type.

- (UInt32)formatType

Parameters
formatType

The format type for the described media.

Discussion

This method returns the specific format, or codec, used to represent the media. Video format types are defined in QuickTime/ImageCompression.h and audio format types are defined in CoreAudio/CoreAudioTypes.h.

Availability
Declared In
QTFormatDescription.h

isEqualToFormatDescription:

Returns whether the receiver describes the same format as the given format description.

- (BOOL)isEqualToFormatDescription:(QTFormatDescription *)formatDescription

Parameters
formatDescription

The format description for the QTFormatDescription object.

Availability
Declared In
QTFormatDescription.h

localizedFormatSummary

Returns a localized summary of the media format.

- (NSString *)localizedFormatSummary

Return Value

A localized string summarizing the media format.

Availability
Related Sample Code
Declared In
QTFormatDescription.h

mediaType

Returns the media type of the described media.

- (NSString *)mediaType

Parameters
mediaType

The QuickTime media type of the described media object.

Return Value

A QuickTime media type, such as QTMediaTypeVideo, QTMediaTypeSound, or QTMediaTypeMuxed.

Discussion

Media types are defined in QTMedia.h.

Availability
Declared In
QTFormatDescription.h

quickTimeSampleDescription

Returns the media’s QuickTime SampleDescription.

- (NSData *)quickTimeSampleDescription

Return Value

An NSData containing the SampleDescription for the media.

Discussion

This method returns a QuickTime SampleDescription structure, allowing applications to get detailed information on the media format. The SampleDescription is returned in the native endian byte order for the system.

Availability
Declared In
QTFormatDescription.h

Constants

Core Audio and Video Types

Constants for different core audio and video types.

NSString * const QTFormatDescriptionAudioChannelLayoutAttribute;
NSString * const QTFormatDescriptionAudioMagicCookieAttribute;
NSString * const QTFormatDescriptionAudioStreamBasicDescriptionAttribute;
NSString * const QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute;
NSString * const QTFormatDescriptionVideoEncodedPixelsSizeAttribute;
NSString * const QTFormatDescriptionVideoProductionApertureDisplaySizeAttribute;

Constants
QTFormatDescriptionAudioChannelLayoutAttribute

Returns an NSData interpreted as a Core Audio AudioChannelLayout for audio media.

This string value can be used in key paths for key-value coding, key-value observing, and bindings.

Declared in QTFormatDescription.h.

QuickTime 7.2 and later.

QTFormatDescriptionAudioMagicCookieAttribute

Returns an NSData interpreted as a Core Audio magic cookie for audio media.

This string value can be used in key paths for key-value coding, key-value observing, and bindings.

Declared in QTFormatDescription.h.

QuickTime 7.2 and later.

QTFormatDescriptionAudioStreamBasicDescriptionAttribute

Returns an NSValue interpreted as a Core Audio AudioStreamBasicDescription for audio media.

This string value can be used in key paths for key-value coding, key-value observing, and bindings.

Declared in QTFormatDescription.h.

QuickTime 7.2 and later.

QTFormatDescriptionVideoCleanApertureDisplaySizeAttribute

Returns an NSValue interpreted as an NSSize that indicates the size of video media displayed through its clean aperture and scaled by its pixel aspect ratio.

This string value can be used in key paths for key-value coding, key-value observing, and bindings.

Declared in QTFormatDescription.h.

QuickTime 7.2 and later.

QTFormatDescriptionVideoEncodedPixelsSizeAttribute

Returns an NSValue interpreted as an NSSize that indicates the encoded size of video media.

This string value can be used in key paths for key-value coding, key-value observing, and bindings.

Declared in QTFormatDescription.h.

QuickTime 7.2 and later.

QTFormatDescriptionVideoProductionApertureDisplaySizeAttribute

Returns an NSValue interpreted as an NSSize that indicates the size of video media scaled by its pixel aspect ratio but not displayed through its clean aperture.

This string value can be used in key paths for key-value coding, key-value observing, and bindings.

Declared in QTFormatDescription.h.

QuickTime 7.2 and later.



Next Page > Hide TOC


© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-04-08)


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.