Quicktime Components
Total Page:16
File Type:pdf, Size:1020Kb
INSIDE MACINTOSH 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 © 1993, Apple Computer, Inc. REPLACEMENT All rights reserved. ALL IMPLIED WARRANTIES ON THIS No part of this publication may be MANUAL, INCLUDING IMPLIED reproduced, stored in a retrieval WARRANTIES OF MERCHANTABILITY system, or transmitted, in any form or AND FITNESS FOR A PARTICULAR by any means, mechanical, electronic, PURPOSE, ARE LIMITED IN DURATION photocopying, recording, or otherwise, TO NINETY (90) DAYS FROM THE DATE without prior written permission of OF THE ORIGINAL RETAIL PURCHASE Apple Computer, Inc. Printed in the OF THIS PRODUCT. United States of America. Even though Apple has reviewed this No licenses, express or implied, are manual, APPLE MAKES NO WARRANTY granted with respect to any of the OR REPRESENTATION, EITHER EXPRESS technology described in this book. OR IMPLIED, WITH RESPECT TO THIS Apple retains all intellectual property MANUAL, ITS QUALITY, ACCURACY, rights associated with the technology MERCHANTABILITY, OR FITNESS FOR A described in this book. This book is PARTICULAR PURPOSE. AS A RESULT, intended to assist application THIS MANUAL IS SOLD “AS IS,” AND developers to develop applications only YOU, THE PURCHASER, ARE ASSUMING for Apple Macintosh computers. THE ENTIRE RISK AS TO ITS QUALITY Apple Computer, Inc. AND ACCURACY. 20525 Mariani Avenue IN NO EVENT WILL APPLE BE LIABLE Cupertino, CA 95014 FOR DIRECT, INDIRECT, SPECIAL, 408-996-1010 INCIDENTAL, OR CONSEQUENTIAL Apple, the Apple logo, APDA, DAMAGES RESULTING FROM ANY AppleLink, LaserWriter, Macintosh, DEFECT OR INACCURACY IN THIS MPW, and MultiFinder are trademarks MANUAL, even if advised of the possibility of Apple Computer, Inc., registered in of such damages. the United States and other countries. THE WARRANTY AND REMEDIES SET Balloon Help, QuickDraw, QuickTime, FORTH ABOVE ARE EXCLUSIVE AND IN and System 7 are trademarks of Apple LIEU OF ALL OTHERS, ORAL OR Computer, Inc. WRITTEN, EXPRESS OR IMPLIED. No Adobe Illustrator and PostScript are Apple dealer, agent, or employee is trademarks of Adobe Systems authorized to make any modification, Incorporated, which may be registered extension, or addition to this warranty. in certain jurisdictions. Some states do not allow the exclusion or AGFA is a trademark of Agfa-Gevaert. limitation of implied warranties or liability America Online is a service mark of for incidental or consequential damages, so Quantum Computer Services, Inc. the above limitation or exclusion may not ISBN 0-201-62202-5 apply to you. This warranty gives you 1 2 3 4 5 6 7 8 9-MU-9796959493 Classic is a registered trademark First Printing, May 1993 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 Preface About This Book xvii Format of a Typical Chapter xviii Conventions Used in This Book xix Special Fonts xix Types of Notes xix Development Environment xx For More Information xx Chapter 1 Overview 1-1 Providing Movie Playback 1-3 Capturing Sequences of Images 1-6 Compressing and Decompressing Still Images 1-8 Converting Data for Use in QuickTime Movies 1-11 Creating Previews of QuickTime Movies 1-11 Chapter 2 Movie Controller Components 2-1 About Movie Controller Components 2-4 The Elements of a Movie Controller 2-4 Badges 2-6 Spatial Properties 2-6 Using Movie Controller Components 2-10 Playing Movies 2-10 Customizing Movie Controllers 2-13 Movie Controller Components Reference 2-14 Movie Controller Actions 2-15 Movie Controller Functions 2-28 Associating Movies With Controllers 2-28 Managing Controller Attributes 2-33 Handling Movie Events 2-44 Editing Movies 2-50 Getting and Setting Movie Controller Time 2-56 Customizing Event Processing 2-58 Application-Defined Function 2-61 iii Summary of Movie Controller Components 2-63 C Summary 2-63 Constants 2-63 Data Types 2-66 Movie Controller Functions 2-67 Application-Defined Function 2-69 Pascal Summary 2-69 Constants 2-69 Data Types 2-73 Movie Controller Routines 2-73 Application-Defined Routine 2-75 Result Codes 2-75 Chapter 3 Standard Image-Compression Dialog Components 3-1 About Standard Image-Compression Dialog Components 3-4 Using Standard Image-Compression Dialog Components 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 3-8 Designating a Test Image 3-9 Displaying the Dialog Box and Retrieving Parameters 3-10 Extending the Basic Dialog Box 3-11 Creating a Standard Image-Compression Dialog Component 3-14 Standard Image-Compression Dialog Components Reference 3-15 Request Types 3-15 The Spatial Settings Request Type 3-15 The Temporal Settings Request Type 3-17 The Data-Rate Settings Request Type 3-19 The Color Table Settings Request Type 3-20 The Progress Function Request Type 3-20 The Extended Functions Request Type 3-21 The Preference Flags Request Type 3-22 The Settings State Request Type 3-24 The Sequence ID Request Type 3-24 The Window Position Request Type 3-25 The Control Flags Request Type 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 3-29 Compressing Image Sequences 3-31 Working With Image or Sequence Settings 3-34 Specifying a Test Image 3-37 iv Positioning Dialog Boxes and Rectangles 3-42 Utility Function 3-44 Application-Defined Function 3-45 Summary of Standard Image-Compression Dialog Components 3-47 C Summary 3-47 Constants 3-47 Data Types 3-49 Standard Image-Compression Dialog Component Functions 3-50 Application-Defined Function 3-52 Pascal Summary 3-52 Constants 3-52 Data Types 3-54 Standard Image-Compression Dialog Component Routines 3-55 Application-Defined Routine 3-57 Result Codes 3-57 Chapter 4 Image Compressor Components 4-1 About Image Compressor Components 4-3 Banding and Extending Images 4-4 Spooling of Compressed Data 4-6 Data Loading 4-6 Data Unloading 4-7 Compressing or Decompressing Images Asynchronously 4-8 Progress Functions 4-9 Using Image Compressor Components 4-10 Performing Image Compression 4-10 Choosing a Compressor 4-10 Compressing a Horizontal Band of an Image 4-13 Decompressing an Image 4-16 Choosing a Decompressor 4-17 Decompressing a Horizontal Band of an Image 4-21 Image Compressor Components Reference 4-26 Constants 4-26 Image Compressor Component Capabilities 4-26 Format of Compressed Data and Files 4-32 Data Types 4-35 The Compressor Capability Structure 4-35 The Compression Parameters Structure 4-40 The Decompression Parameters Structure 4-46 Functions 4-53 Direct Functions 4-54 Indirect Functions 4-62 Image Compression Manager Utility Functions 4-65 v Summary of Image Compressor Components 4-69 C Summary 4-69 Constants 4-69 Data Types 4-72 Functions 4-76 Image Compression Manager Utility Functions 4-77 Pascal Summary 4-77 Constants 4-77 Data Types 4-80 Routines 4-83 Image Compression Manager Utility Functions 4-84 Result Codes 4-84 Chapter 5 Sequence Grabber Components 5-1 About Sequence Grabber Components 5-3 Using Sequence Grabber Components 5-5 Previewing and Recording Captured Data 5-9 Previewing 5-9 Recording 5-10 Playing Captured Data and Saving It in a QuickTime Movie 5-11 Initializing a Sequence Grabber Component 5-11 Creating a Sound Channel and a Video Channel 5-12 Previewing Sound and Video Sequences in a Window 5-14 Capturing Sound and Video Data 5-18 Setting Up the Video Bottleneck Functions 5-19 Drawing Information Over Video Frames During Capture 5-20 Sequence Grabber Components Reference 5-22 Data Types 5-22 The Compression Information Structure 5-22 The Frame Information Structure 5-23 Sequence Grabber Component Functions 5-24 Configuring Sequence Grabber Components 5-24 Controlling Sequence Grabber Components 5-36 Working With Sequence Grabber Settings 5-47 Working With Sequence Grabber Characteristics 5-53 Working With Channel Characteristics 5-58 Working With Channel Devices 5-72 Working With Video Channels 5-77 Working With Sound Channels 5-92 Video Channel Callback Functions 5-99 Utility Functions for Video Channel Callback Functions 5-102 Application-Defined Functions 5-111 Summary of Sequence Grabber Components 5-123 C Summary 5-123 Constants 5-123 vi Data Types 5-127 Sequence Grabber Component Functions 5-129 Application-Defined Functions 5-135 Pascal Summary 5-136 Constants 5-136 Data Types 5-140 Sequence Grabber Component Routines 5-141 Application-Defined Routines 5-148 Result Codes 5-149 Chapter 6 Sequence Grabber Channel Components 6-1 About Sequence Grabber Channel Components 6-3 Creating Sequence Grabber Channel Components 6-5 Component Type and Subtype Values 6-6 Required Functions 6-6 Component Manager Request Codes 6-7 A Sample Sequence Grabber Channel Component 6-10 Implementing the Required Component