Building 64-bit and Universal 32/64-bit FxPlugs
All existing FxPlugs need to be recompiled for 64-bit to continue to work with Motion 5, Final Cut Pro X and the FxPlug 2.0 SDK. This document describes how to build a 64-bit FxPlug as well as how to build a universal 32/64-bit FxPlug.
Introduction
Motion 5 and Final Cut Pro X are 64-bit only. The FxPlug 2.0 SDK builds 64-bit plug-ins only. This means that all existing FxPlugs need to be recompiled for 64-bit. In the following, we describe how to update an existing 32-bit FxPlug to 64-bit. It is also possible (yet more complicated) to build a single universal plug-in that works in both 32 and 64-bit. The document lists the steps to achieve that as well.
Building a 64-bit FxPlug
In most cases, building a 64-bit FxPlug is a simple process as described below, if you aren't using technologies that don't exist in 64-bit such as QuickTime or Carbon UI. If you are however, you'll need to rewrite those parts of your plug-in to be 64-bit compatible.
Here are the steps to update an existing 32-bit FxPlug to 64-bit:
1) Set your architecture to "64-bit Intel"
To do this:
Select the target
Click on the "Build Setting" tab
Click "All" (The Xcode 4 default is "Basic" which excludes the "Architectures" settings.)
Set the "Architectures" pop-up to "64-bit Intel"
2) Link against the 64-bit version of FxPlug.framework
and PluginManager.framework
(if your project requires it)
To do this, first remove the 32-bit FxPlug.framework
and PluginManager.framework
from your project. When prompted, be sure to select the "Remove Reference Only" option.
Add the 64-bit FxPlug.framework
and PluginManager.framework
by following these steps:
Select the target
Click on the "Build Phases" tab
Under "Link Binary With Libraries", click on the + sign
Click "Add Other..."
Navigate to
/Developer/Examples/FxPlug/
Select
FxPlug.framework
andPluginManager.framework
and click "Open"
3) Set your active executable to Motion 5
To do this, choose "Edit Scheme" from the "Scheme" pop-up and choose Motion 5 as the product you want to run.
4) Update method signatures and properties.
Find in your code all method parameters of UInt32
type and change them to NSUInteger
. An example of such a method is -getOutputWidth:height:withInput:withInfo:
. You also need to update your plugin's -properties
method to remove the kFxPropertyKey_EquivalentSMPTEWipeCode
key and its corresponding value, as this key is no longer used by the host applications.
At this point you should be able to build a 64-bit plug-in that is loaded by Motion 5 if you aren't using any APIs or libraries that are not 64-bit compatible. If you are, you'll need to update your code and/or libraries to be 64-bit compatible.
Building a Universal FxPlug
You can also choose to build a single universal plug-in that works in both 32 and 64-bit, but it's generally a much more tedious process. See below for the steps to make a universal 32/64-bit FxPlug from an existing 32-bit FxPlug. For convenience, we refer the name of your plug-in to <PLUG-IN_NAME>.
1) Create a copy of your existing target
To do this, select the 32-bit target, right or control click on it, and choose "Duplicate" from the menu.
2) Rename the original target and its associated product to <PLUG-IN_NAME>32bit.
To change the name of the product, select the target, click on the "Build Settings" tab, look for "Product Name" in the "Packaging" section, and type in the name you want to change it to. You'll notice the entry in the "Products" group in the navigator changes.
3) Similarly, rename the newly-created target to something appropriate such as <PLUG-IN_NAME>64bit. Rename its associated product to be exactly <PLUG-IN_NAME>, as we will make this product a universal one.
4) By default, Xcode 4 automatically creates schemes when creating each target, so rename the schemes for consistency.
To do this, select "Manage Schemes..." from the "Scheme" pop-up.
5) Make this new target 64-bit by following the procedures outlined above in the section: Building a 64-bit FxPlug. Again if you are using any APIs or libraries that are not 64-bit compatible, you'll need to update your code and/or libraries to be 64-bit compatible.
6) Create a new Aggregate style target.
To do this, click on the "Add Target" button at the bottom and select the "Aggregate" template under the "Other" category.
Enter <PLUG-IN_NAME> in the "Product Name" box in the next page and click "Finish".
7) Switch to this Aggregate target. Click on the "Build Phases" tab. Make the 32-bit and 64-bit targets be dependencies of the Aggregate target.
8) Add a "Run Script" build phase to the aggregate target.
To do this, click on the "Add Build Phase" button at the bottom and select "Add Run Script".
Enter the following listing as the text of the script, replacing <PLUG-IN_NAME> with the actual name of your plug-in.
Listing 1 Running script when building the aggregate target
# Remove the 32-bit variant if it exists or the next lipo call will fail lipo ${BUILD_DIR}/${CONFIGURATION}/<PLUG-IN_NAME>.fxplug/Contents/MacOS/<PLUG-IN_NAME> -output ${BUILD_DIR}/${CONFIGURATION}/<PLUG-IN_NAME>.fxplug/Contents/MacOS/<PLUG-IN_NAME> -thin x86_64 # Add in the newly build 32-bit variant to the 64-bit variant lipo ${BUILD_DIR}/${CONFIGURATION}/<PLUG-IN_NAME>.fxplug/Contents/MacOS/<PLUG-IN_NAME> ${BUILD_DIR}/${CONFIGURATION}/<PLUG-IN_NAME>32bit.fxplug/Contents/MacOS/<PLUG-IN_NAME>32bit -output ${BUILD_DIR}/${CONFIGURATION}/<PLUG-IN_NAME>.fxplug/Contents/MacOS/<PLUG-IN_NAME> -create |
9) Select the corresponding scheme of the Aggregate target from the "Scheme" pop-up. Clean and build the Aggregate target. Copy the resulting FxPlug into the Plug-Ins folder or make a sym-link to the built binary as you normally would.
Document Revision History
Date | Notes |
---|---|
2011-07-12 | New document that discusses how to build 64-bit and universal 32/64-bit FxPlugs for Motion 5, Final Cut Pro X and the FxPlug 2.0 SDK. |
Copyright © 2011 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2011-07-12