I N S I D E M A C I N T O S H
QuickTime Components
Addison-Wesley Publishing Company
Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan Paris Seoul Milan Mexico City Taipei
Apple Computer, Inc.
LIMITED WARRANTY ON MEDIA AND REPLACEMENT
© 1993, Apple Computer, Inc. All rights reserved.
ALL IMPLIED WARRANTIES ON THIS MANUAL, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE LIMITED IN DURATION TO NINETY (90) DAYS FROM THE DATE OF THE ORIGINAL RETAIL PURCHASE OF THIS PRODUCT.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Computer, Inc. Printed in the United States of America.
Even though Apple has reviewed this manual, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS MANUAL, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS MANUAL IS SOLD “AS IS,” AND YOU, THE PURCHASER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY.
No licenses, express or implied, are granted with respect to any of the technology described in this book. Apple retains all intellectual property rights associated with the technology described in this book. This book is intended to assist application developers to develop applications only for Apple Macintosh computers.
Apple Computer, Inc. 20525 Mariani Avenue Cupertino, CA 95014 408-996-1010
IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS MANUAL, even if advised of the possibility of such damages.
Apple, the Apple logo, APDA, AppleLink, LaserWriter, Macintosh, MPW, and MultiFinder are trademarks of Apple Computer, Inc., registered in the United States and other countries.
THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is
Balloon Help, QuickDraw, QuickTime, and System 7 are trademarks of Apple Computer, Inc. Adobe Illustrator and PostScript are trademarks of Adobe Systems Incorporated, which may be registered in certain jurisdictions.
authorized to make any modification, extension, or addition to this warranty.
Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you
AGFA is a trademark of Agfa-Gevaert. America Online is a service mark of Quantum Computer Services, Inc.
ISBN 0-201-62202-5 1 2 3 4 5 6 7 8 9-MU-9796959493 First Printing, May 1993
Classic is a registered trademark licensed to Apple Computer, Inc.
specific legal rights, and you may also have other rights which vary from state to state.
CompuServe is a registered service mark of CompuServe, Inc. FrameMaker is a registered trademark of Frame Technology Corporation. Helvetica and Palatino are registered trademarks of Linotype Company. Internet is a trademark of Digital Equipment Corporation. ITC Zapf Dingbats is a registered trademark of International Typeface Corporation. Windows is a registered trademark of Microsoft.
Simultaneously published in the United States and Canada.
Contents
- Figures and Listings
- xiii
xvii
Preface
About This Book
Format of a Typical Chapter Conventions Used in This Book xviii xix
Special Fonts Types of Notes xix xix
Development Environment For More Information xx xx
Chapter 1
Overview
1-1
- Providing Movie Playback
- 1-3
- Capturing Sequences of Images
- 1-6
Compressing and Decompressing Still Images Converting Data for Use in QuickTime Movies
1-8
1-11
- Creating Previews of QuickTime Movies
- 1-11
Chapter 2
Movie Controller Components
2-1
About Movie Controller Components
The Elements of a Movie Controller
2-4 2-4
Badges
Spatial Properties Using Movie Controller Components
Playing Movies 2-10 Customizing Movie Controllers
Movie Controller Components Reference
2-6
2-6
2-10
2-13
2-14
Movie Controller Actions Movie Controller Functions
2-15
2-28
Associating Movies With Controllers Managing Controller Attributes 2-33 Handling Movie Events 2-44 Editing Movies 2-50 Getting and Setting Movie Controller Time
2-28
2-56
Customizing Event Processing
Application-Defined Function
2-58
2-61
iii
- Summary of Movie Controller Components
- 2-63
C Summary
Constants
2-63 2-63
- Data Types
- 2-66
Movie Controller Functions Application-Defined Function
2-67
2-69
Pascal Summary
Constants
2-69
2-69
- 2-73
- Data Types
Movie Controller Routines Application-Defined Routine
2-73
2-75
- Result Codes
- 2-75
Chapter 3
Standard Image-Compression Dialog Components
3-1
About Standard Image-Compression Dialog Components Using Standard Image-Compression Dialog Components
3-4 3-6
Opening a Connection to a Standard Image-Compression Dialog
Component 3-8
- Displaying the Dialog Box to the User
- 3-8
Setting Default Parameters Designating a Test Image
3-8
3-9
Displaying the Dialog Box and Retrieving Parameters
Extending the Basic Dialog Box 3-11
3-10
Creating a Standard Image-Compression Dialog Component Standard Image-Compression Dialog Components Reference
3-14 3-15
- Request Types
- 3-15
The Spatial Settings Request Type The Temporal Settings Request Type The Data-Rate Settings Request Type The Color Table Settings Request Type The Progress Function Request Type The Extended Functions Request Type The Preference Flags Request Type
3-15
3-17 3-19
3-20
3-20
3-21
3-22
3-24
3-24
The Settings State Request Type The Sequence ID Request Type The Window Position Request Type The Control Flags Request Type
3-25
3-25
- Standard Image-Compression Dialog Component Functions
- 3-25
- Getting Default Settings for an Image or a Sequence
- 3-26
- Displaying the Standard Image-Compression Dialog Box
- 3-28
Compressing Still Images Compressing Image Sequences Working With Image or Sequence Settings Specifying a Test Image 3-37
3-29
3-31
3-34
iv
Positioning Dialog Boxes and Rectangles Utility Function 3-44
Application-Defined Function
Summary of Standard Image-Compression Dialog Components
3-42
3-45
3-47
3-50
C Summary
Constants
3-47 3-47
- Data Types
- 3-49
Standard Image-Compression Dialog Component Functions Application-Defined Function 3-52
Pascal Summary
Constants
3-52
3-52
- 3-54
- Data Types
Standard Image-Compression Dialog Component Routines Application-Defined Routine 3-57
Result Codes 3-57
3-55
Chapter 4
Image Compressor Components
4-1
- About Image Compressor Components
- 4-3
Banding and Extending Images Spooling of Compressed Data
4-4
4-6
Data Loading Data Unloading
4-6
4-7
Compressing or Decompressing Images Asynchronously Progress Functions 4-9
4-8
Using Image Compressor Components
Performing Image Compression
4-10
4-10
- Choosing a Compressor
- 4-10
- Compressing a Horizontal Band of an Image
- 4-13
Decompressing an Image
Choosing a Decompressor
4-16
4-17
Decompressing a Horizontal Band of an Image
Image Compressor Components Reference 4-26
Constants 4-26
Image Compressor Component Capabilities Format of Compressed Data and Files 4-32
Data Types 4-35
4-21
4-26
The Compressor Capability Structure The Compression Parameters Structure The Decompression Parameters Structure
4-35
4-40
4-46
- Functions
- 4-53
Direct Functions Indirect Functions
4-54
4-62
- Image Compression Manager Utility Functions
- 4-65
v
- Summary of Image Compressor Components
- 4-69
C Summary
Constants Data Types Functions
4-69 4-69
4-72
4-76
- Image Compression Manager Utility Functions
- 4-77
4-84
Pascal Summary
Constants
4-77
4-77
4-80
4-83
Image Compression Manager Utility Functions
Result Codes 4-84
Data Types Routines
Chapter 5
Sequence Grabber Components
5-1
About Sequence Grabber Components Using Sequence Grabber Components
5-3 5-5
- Previewing and Recording Captured Data
- 5-9
Previewing Recording
5-9
5-10
- Playing Captured Data and Saving It in a QuickTime Movie
- 5-11
Initializing a Sequence Grabber Component Creating a Sound Channel and a Video Channel
5-11
5-12
Previewing Sound and Video Sequences in a Window Capturing Sound and Video Data 5-18 Setting Up the Video Bottleneck Functions Drawing Information Over Video Frames During Capture
Sequence Grabber Components Reference 5-22
Data Types 5-22
The Compression Information Structure
5-14
5-19
5-20
5-22
- The Frame Information Structure
- 5-23
- Sequence Grabber Component Functions
- 5-24
Configuring Sequence Grabber Components Controlling Sequence Grabber Components Working With Sequence Grabber Settings
5-24
5-36
5-47
Working With Sequence Grabber Characteristics Working With Channel Characteristics 5-58
5-53
Working With Channel Devices Working With Video Channels Working With Sound Channels Video Channel Callback Functions
5-72
5-77
5-92
5-99
Utility Functions for Video Channel Callback Functions
Application-Defined Functions 5-111
Summary of Sequence Grabber Components
5-102
5-123
C Summary
Constants
5-123 5-123
vi
Data Types Sequence Grabber Component Functions Application-Defined Functions 5-135
5-127
5-129
5-141
Pascal Summary
Constants
5-136
5-136
- 5-140
- Data Types
Sequence Grabber Component Routines Application-Defined Routines 5-148
Result Codes 5-149
Chapter 6
Sequence Grabber Channel Components
6-1
About Sequence Grabber Channel Components Creating Sequence Grabber Channel Components
6-3
6-5
Component Type and Subtype Values Required Functions 6-6 Component Manager Request Codes A Sample Sequence Grabber Channel Component
Implementing the Required Component Functions Initializing the Sequence Grabber Channel Component Setting and Retrieving the Channel State 6-16 Managing Spatial Properties 6-17 Controlling Previewing and Recording Operations Managing Channel Devices 6-24 Utility Functions for Recording Image Data
6-6
6-7
6-10
6-10
6-15
6-20
6-24
Providing Media-Specific Functions Managing the Settings Dialog Box
6-28
6-29
Displaying Channel Information in the Settings Dialog Box
Using Sequence Grabber Channel Components 6-33
6-31
Previewing Recording
6-33
6-34
Working With Callback Functions
Using Callback Functions for Video Channel Components Using Utility Functions for Video Channel Component Callback
Functions 6-36
Sequence Grabber Channel Components Reference
Functions 6-37
6-35
6-35
6-37
Configuring Sequence Grabber Channel Components Controlling Sequence Grabber Channel Components Configuration Functions for All Channel Components
6-38
6-39
6-46
- Working With Channel Devices
- 6-58
Configuration Functions for Video Channel Components Configuration Functions for Sound Channel Components Utility Functions for Sequence Grabber Channel Components
6-61
6-77
6-84
vii
- Summary of Sequence Grabber Channel Components
- 6-91
C Summary
Constants
6-91 6-91
Data Types Functions
6-94
6-94
Pascal Summary
Constants
6-99
6-99
Data Types Routines
Result Codes
6-101
6-102
6-107
Chapter 7
Sequence Grabber Panel Components
7-1
7-9
About Sequence Grabber Panel Components Creating Sequence Grabber Panel Components
7-4
7-7
Implementing the Required Component Functions Managing the Dialog Box 7-11 Managing Your Panel’s Settings
Sequence Grabber Panel Components Reference
Component Flags for Sequence Grabber Panel Components Functions 7-15
7-13
7-14
7-15
Managing Your Panel Component Processing Your Panel’s Events Managing Your Panel’s Settings
7-15
7-21
7-24
- Summary of Sequence Grabber Panel Components
- 7-27
C Summary
Constants Functions
7-27 7-27 7-28
Pascal Summary
Constants
7-29
7-29
Routines
Result Codes
7-29
7-30
Chapter 8
Video Digitizer Components
8-1
8-5
About Video Digitizer Components
Types of Video Digitizer Components
8-3 8-7
Source Coordinate Systems
Using Video Digitizer Components
Specifying Destinations 8-7 Starting and Stopping the Digitizer Multiple Buffering 8-8
8-6
8-7
viii
- Obtaining an Accurate Time of Frame Capture
- 8-8
Creating Video Digitizer Components
Component Type and Subtype Values
8-8
8-11
Required Functions Optional Functions
8-11 8-12
Frame Grabbers Without Playthrough Frame Grabbers With Hardware Playthrough Key Color and Alpha Channel Devices 8-13 Compressed Source Devices 8-13
Video Digitizer Components Reference
Constants 8-14
8-12
8-12
8-14
Capability Flags Current Flags
8-14
8-19
- Data Types
- 8-20
- The Digitizer Information Structure
- 8-20
The Buffer List Structure The Buffer Structure
8-22
8-23
- Video Digitizer Component Functions
- 8-23
- Getting Information About Video Digitizer Components
- 8-24
Setting Source Characteristics Selecting an Input Source Setting Video Destinations
8-26
8-30
8-34
Controlling Compressed Source Devices Controlling Digitization 8-52
8-42
- Controlling Color
- 8-60
Controlling Analog Video Selectively Displaying Video
8-65
8-81
Clipping Utility Functions
Application-Defined Function
Summary of Video Digitizer Components
8-89
8-92
8-98
8-99
C Summary
Constants
8-99 8-99
- Data Types
- 8-104
Video Digitizer Component Functions Application-Defined Function 8-111
8-105
8-117
Pascal Summary
Constants
8-111
8-111
- 8-116
- Data Types
Video Digitizer Component Routines Application-Defined Routine 8-123
Result Codes 8-124
ix
Chapter 9
Movie Data Exchange Components
9-1
About Movie Data Exchange Components Using Movie Data Exchange Components
Importing and Exporting Movie Data
9-3 9-5
9-6
Configuring a Movie Data Exchange Component Finding a Specific Movie Data Exchange Component
Creating a Movie Data Exchange Component 9-8
A Sample Movie Import Component 9-9
Implementing the Required Import Component Functions Importing a Scrapbook File 9-12
A Sample Movie Export Component
Implementing the Required Export Component Functions Exporting Data to a PICS File 9-18
Movie Data Exchange Components Reference
Importing Movie Data 9-20 Configuring Movie Data Import Components Exporting Movie Data 9-34
9-6
9-6
9-10 9-16
9-15
9-20
9-26
Configuring Movie Data Export Components
Summary of Movie Data Exchange Components
9-37
9-41
C Summary
Constants Data Type Functions
9-41 9-41 9-42 9-42
Pascal Summary
Constants Data Type
9-44
9-44 9-45
Routines
Result Codes
9-45
9-47
Chapter 10
Derived Media Handler Components
10-1
About Derived Media Handler Components
Media Handler Components 10-4 Derived Media Handler Components
10-4
10-6
Creating a Derived Media Handler Component
Component Flags for Derived Media Handlers
10-7
10-8
- Request Processing
- 10-8
- A Sample Derived Media Handler Component
- 10-9
Implementing the Required Component Functions Initializing a Derived Media Handler Component
10-9
10-12
Drawing the Media Sample
Derived Media Handler Components Reference
Data Type 10-15
10-13
10-15
x
- Functions
- 10-18
- Managing Your Media Handler Component
- 10-18
General Data Management Graphics Data Management Sound Data Management
10-23
10-31
10-37
- Base Media Handler Utility Function
- 10-38
- Summary of Derived Media Handler Components
- 10-41
C Summary
Constants Data Type Functions
10-41 10-41 10-43 10-43
Pascal Summary
Constants
10-45
10-45
- 10-46
- Data Type
- Routines
- 10-47
Chapter 11
Clock Components
11-1
- 11-3
- About Clock Components
- Clock Components Reference
- 11-5
- Component Capability Flags for Clocks
- 11-5
Component Types for Clocks Data Type 11-6
11-6
Clock Component Functions
Getting the Current Time Using the Callback Functions
11-7
11-9
11-9
- Managing the Time
- 11-15
- Movie Toolbox Clock Support Functions
- 11-18
- Summary of Clock Components
- 11-22
C Summary
Constants Data Type
11-22 11-22 11-24
- Clock Component Functions
- 11-24
- Movie Toolbox Clock Support Functions
- 11-25
Pascal Summary
Constants Data Type
11-25
11-25 11-27
- Clock Component Routines
- 11-27
- Movie Toolbox Clock Support Routines
- 11-28
xi
Chapter 12
Preview Components
12-1
- 12-3
- About Preview Components
- Obtaining Preview Data
- 12-3
- Storing Preview Data in Files
- 12-5
- Using the Preview Data
- 12-5
- Creating Preview Components
- 12-6
Implementing Required Component Functions Displaying Image Data as a Preview 12-8
Preview Components Reference 12-10
Functions 12-10
12-7
Displaying Previews Handling Events Creating Previews
12-10
12-11
12-11
Resources
The Preview Resource The Preview Resource Item Structure
Summary of Preview Components 12-16
12-13
12-14
12-15
C Summary
Constants Data Types Functions
12-16 12-16
12-16
12-17
Pascal Summary
Constants Data Types
12-17
12-17
12-18
- Routines
- 12-19