Electric Image Components Sample

Version 1.3
April 22 2003

Sample Components

Graphics Importer Component
Graphics Exporter Component
Movie Importer	Component
Movie Exporter Component
Image Decompressor Codec

Description

This sample demonstrates how to build five QuickTime Component which all work together to allow QuickTime to use Electric Image format image files.

The sample sources show how to build a Graphics Importer, Graphics Exporter, Movie Importer, Movie Exporter and an Image Decompressor.

Sample Electric Image files can be found in the ElectricImages folder.

The sample builds on three platforms:

Mac OS:

For CodeWarrior users there is a single CodeWarrior 8.3 Project containing a number of Targets which build both stand alone components and a linked test application for PPC, Carbon CFM (test application only) and Carbon Mach-O. Note: The term "Linked" designates the component code is build into the application. 

The PPC StandAlone components will run on Traditional Mac OS where it should be placed in the Extensions:QuickTime Extensions folder. The Carbon Mach-O component will only work on Mac OS X and should be placed in the /Library/QuickTime directory.

There are three versions of the Linked Test Application: ImportExamplePPC for Traditional Mac OS, ImportExampleCarbon a CFM application which will run on Mac OS 9 and Mac OS X, and ImportExample.app an Application Bundle for Mac OS X only.

For Project Builder users there is a single project containing two Targets which build both stand alone components (as a Component Bundle) and a linked test application. The components should be placed in the /Library/QuickTime directory.

Windows:

There is a single VC++ 7 and a single VC++ 6 project containing one Target which builds a stand alone component. On Windows NT / 2000 / XP etc. the ElectricImageWindows.qtx component should be placed in the C:\Windows\System32\QuickTime directory. For Windows 95 & Windows 98, the component should be placed in the C:\Windows\System\QuickTime directory.

These sources and targets show how to build the five types of sample components and can act as frameworks for your own components.

QuickTime 6, the QuickTime 6 Windows SDK and Mac OS X 10.2.x with the December 2002 Developer Tools are required minimums for this sample.

Enjoy!
QuickTime DTS

Contents

Macintosh Targets:

     Metrowerks CodeWarrior - EIComponentSample.mcp

ImportExampleCarbonMach-O - Linked sample Application which includes the three components needed for import and builds a Mach-O application bundle (.app) (Mac OS X - preferred)

ImportExampleCarbon - Linked sample Application which includes the three components needed for import and is linked against CarbonLib (Mac OS, Mac OS X)

ImportExamplePPC - Linked sample Application which includes the three components needed for import and is linked against InterfaceLib, QuickTimeLib etc. (Mac OS)

EI Component Mach-O - Target will build a single Mach-O component bundle called 'ElectricImageCW.component' containing all five components, suitable for installing on Mac OS X.

EI Component PPC - Merge Target will build a single component file called 'ElectricImagePPC' containing all five StandAlone components below suitable for installing on Mac OS.

GraphicsImportPPC - StandAlone PPC Graphics Import Component for Mac OS
GraphicsExportPPC - StandAlone PPC Graphics Export Component for Mac OS
MovieImportPPC - StandAlone PPC Movie Import Component for Mac OS
MovieExportPPC - StandAlone PPC Movie Export Component for Mac OS
ImageDecompressorPPC - StandAlone PPC Image Decompressor Component for Mac OS

BuildAll - Builds all of the above

     Project Builder - EIComponentSamplePB.pbproj

ImportExample - Linked sample Application which includes all three components.

EI Component Bundle - Target will build a single component bundle called 'ElectricImage.component ' containing all five components for Mac OS X.

BuildAll - Builds all of the above

Windows Targets:

ElectricImageWindows - Target will build a single component file called 'ElectricImageWindows.qtx' containing all five components.

Building this sample on Mac OS

This sample can be built using the Metrowerks CodeWarrior 8.3 or later. The EIComponentSample.mcp project file is fully configured with references to the source files, header files, and libraries necessary to build the sample.

Before building, you may need to revise the file access paths contained in the target settings. You will need to make sure the project can find the required Universal Interface files for the non Mach-O targets. Open the target settings dialog box and ensure that the paths to the Universal Interfaces header files and the QuickTime libraries are in the targets access paths.

All components for Mac OS were built using Universal Interfaces 3.4.2. You should have this version or greater to build the Mac OS sample. If you don't, log into your ADC account and check to see what's available. To build the Mach-O versions, Mac OS X 10.2 and QT 6.0.2 or greater is strongly recommended. However, if you're still working on 10.1.x make sure to upgrade to QuickTime 6.0.2 and download the QuickTime 6 SDK which contains the updated interfaces for Puma: http://developer.apple.com/quicktime/

Don't have an ADC account?
No better time than now to join up - http://developer.apple.com/membership/

Warnings you can safely ignore

When you see the following warnings during the building this sample they can be safely ignored. They are only mentioned here so no one thinks they're doing anything wrong. No really, we mean it, just ignore them...all is well...the blue zone is for loading and unloading only...move on, move on...Elvis has left the building.

Link Warning : entry-point 'EI_GraphicsImportComponentDispatchRD' is not a descriptor
Link Warning : entry-point 'EI_GraphicsExportComponentDispatchRD' is not a descriptor
Link Warning : entry-point 'EI_MovieImportComponentDispatchRD' is not a descriptor
Link Warning : entry-point 'EI_MovieExportComponentDispatchRD' is not a descriptor
Link Warning : entry-point 'EI_ImageCodecComponentDispatchRD' is not a descriptor

Building this sample with Project Builder on Mac OS X

This sample can be built using Project Builder version 1.0 or later. The project file is called EIComponentSamplePB.pbproj and is located in the EIComponentSamplePB folder. It has been fully configured with references to the source files, header files, and frameworks necessary to build the sample.

Warnings you can safely ignore

gcc warnings that can be ignored and do not affect the build.

warning: `cdhDispatchInfo2' defined but not used

Building this sample on Windows

Visual Studio.NET - VC++ 7

This sample can be built using Microsoft Visual C++ 7 or later. The Project is called EIComponentSample.vproj

You will need to install the QuickTime 6 or later Windows SDK (called QTDevWin) and set up access paths to directories where VC++ can find the QuickTime includes, resource includes, libraries and build tools. This can be done from the VC++ 'Tools->Options...' menu. Select 'Projects->VC++ Directories' then add the correct path(s) for each. The 'QTDevWin' folder should be placed in the ..\Microsoft Visual Studio .NET\Vc7\ directory.

This project has been set up assuming the following paths have been added to VC++:

Executable File path added:
      $(VCInstallDir)QTDevWin\Tools

Include File paths added:
      $(VCInstallDir)QTDevWin\CIncludes\
      $(VCInstallDir)QTDevWin\ComponentIncludes\
      $(VCInstallDir)QTDevWin\RIncludes

Library File path added:
      $(VCInstallDir)QTDevWin\Libraries\

There are two Build Events associated with the target to take care of creating the Mac-Syle Resources and then copying them into the built .dll. You shouldn't need to change anything for this step to work, it is mentioned here for completeness.

Visual C++ 6

This sample can be also be built using Microsoft Visual C++ 6.0. The Workspace is called EIComponentSample.dsw.

You will need to install the QuickTime 6 or later Windows SDK (called QTDevWin) and set up access paths to directories where VC++ can find the QuickTime includes, resource includes, libraries and build tools. This can be done from the VC++ 'Tools->Options...' menu. Select the 'Directories' tab then add the correct paths for each. The 'QTDevWin' folder should be located in the ..\Microsoft Visual Studio\VC98\ directory.

This project has been set up assuming the following paths have been added to VC++:

Executable File path added:
     ..\Microsoft Visual Studio\VC98\QTDevWin\Tools\

Include File paths added:
     ..\Microsoft Visual Studio\VC98\QTDevWin\CIncludes\
     ..\Microsoft Visual Studio\VC98\QTDevWin\ComponentIncludes\
     ..\Microsoft Visual Studio\VC98\QTDevWin\RIncludes

Library File path added:
     ..\Microsoft Visual Studio\VC98\QTDevWin\Libraries\

The EIComponentWindows.r file has a custom build action associated with it which compiles each components resource files together using Rez. You may need to change the access path to the RIncludes directory for this stage of the build process so the Rez tool can find what it needs.

Currently the path is hard coded (because Rez if very touchy about such things).

Rez.exe -rd -i "C:\Program Files\Microsoft Visual Studio\VC98\QTDevWin\RIncludes" -i .\EI_GraphicsImport -i .\EI_GraphicsExport -i .\EI_MovieImport -i .\EI_MovieExport -i .\EI_ImageDecompressor -o "$(TargetDir)\$(TargetName).qtr" <  "$(InputPath)"

There is also a custom Post-build step associated with the target which takes the compiled resources (the .qtr file) and embeds them using the RezWack tool into the dll. You shouldn't need to change anything for this step to work, it is mentioned here for completeness.

RezWack -f -d "$(OutDir)\$(TargetName).qtx" -r "$(OutDir)\$(TargetName).qtr" -o "$(ProjDir)\$(TargetName).qtx"

For a summary of the commands these tools can accept, please see RezDocs.txt.