Legacy Callback Suites¶
piSuites¶
These callbacks are available to all plugins, although many of these callbacks are only appropriate for specific plugin types.
typedef struct {
int piInterfaceVer;
PlugMemoryFuncsPtr memFuncs;
PlugWindowFuncsPtr windFuncs;
PlugppixFuncsPtr ppixFuncs;
PlugUtilFuncsPtr utilFuncs;
PlugTimelineFuncsPtr timelineFuncs;
} piSuites, *piSuitesPtr;
Member |
Description |
---|---|
|
API version
|
Pointer to memory functions |
|
Pointer window functions |
|
Pointer PPix functions |
|
Pointer to utility functions. In the utilFuncs, the getSPBasicSuite callback provides access to the SweetPea Suites, which are used for most of the newer functions. |
|
Pointer to timeline functions |
Memory Functions¶
Memory and handle allocation. Where possible, use the PPix Creator Suite for PPix-specific allocation.
Strings passed to and from Premiere in API structures are always null-terminated C strings.
Function |
Description |
---|---|
|
Allocates a block of memory, returns a pointer to the new block. char* newPtr (csSDK_uint32 size);
|
|
Equivalent to newPtr, but initializes the memory to 0. char* newPtrClear (csSDK_uint32 size);
|
|
Resizes an allocated memory block. void setPtrSize (
PrMemoryPtr *ptr,
csSDK_uint32 newsize);
|
|
Returns size in bytes of an allocated memory block. csSDK_int32 getPtrSize (char *ptr);
|
|
Frees an allocated memory block. void disposePtr (char *ptr);
|
|
Allocates a block of memory, returning a handle to it. char** newHandle (csSDK_uint32 size);
|
|
Equivalent to newHandle, but initializes the memory to 0. char** newHandleClear (csSDK_uint32 size);
|
|
Resizes an allocated memory handle. csSDK_int16 setHandleSize (
char **PrMemoryHandle,
csSDK_uint32 newsize);
|
|
Returns the size (in bytes) of an allocated block. csSDK_int32 getHandleSize ( char **PrMemoryHandle);
|
|
Disposes of a previously allocated handle. void disposeHandle (char **PrMemoryHandle);
|
|
These legacy functions are deprecated and should no longer be used. |
Window Functions¶
Window management routines. Superceded by the Window Suite.
Function |
Description |
---|---|
|
Updates all windows. Windows only, doesn’t work on Mac OS. void updateAllWindows (void);
|
|
Returns the main application HWND. void getMainWnd (void);
|
PPix Functions¶
Used to manipulate a PPix. Superceded by the PPix Creator Suite for PPix allocation and the PPix Suite for general PPix functions.
Function |
Description |
---|---|
|
Returns a pointer to the array of pixels contained in a PPix. char* ppixGetPixels (PPixHand pix);
|
|
Returns the bounds of a PPix. void ppixGetBounds (
PPixHand pix;
prRect *bounds);
|
|
Returns the rowbytes of a PPix so you can properly parse the pixels returned by ppixGetPixels. int ppixGetRowbytes (PPixHand pix);
|
|
Allocates and returns a handle to a new PPix, with specified bounds. Since this is an older call, the pixel format is hardcoded to BGRA_4444_8u. PPixHandle ppixNew (prRect *bounds);
|
|
Frees a PPixHand. void ppixDispose (PPixHand pix);
|
|
These legacy functions are deprecated and should no longer be used. |
|
Passes back the pixel aspect ratio of a PPixHand. Premiere populates the longs with the PAR numerator and denominator. int ppixGetPixelAspectRatio (
PPixHand pix,
csSDK_uint32 *num,
csSDK_uint32 *den);
|
|
Passes back the alpha bounds of a PPixHand. void ppixGetAlphaBounds (
PPixHand pix,
prRect *alphaBounds);
|
Utility Functions¶
Function |
Description |
---|---|
|
Passes back Premiere’s serial number. void getSerialNumber (char* buffer);
|
|
Passes back a file’s timebase in a If the file is already in the sequence, it is preferable to get a file’s timebase using the Video Segment Suite
to get the Note: Know your formats. Don’t ask an audio only format for video, you may get unexpected results. csSDK_int32 getFileTimebase (
prFileSpec *filespec,
csSDK_int32 audioOnly,
TDB_TimeRecord *result);
|
|
Gets a frame of video (at a specified time) from a file. If the file is already in the sequence, it is preferable to get a file’s video using the Clip Render Suite. csSDK_int32 getFileVideo (
prFileSpec *filespec,
csSDK_int32 frame,
PPixHand thePort,
prRect *bounds,
csSDK_int32 flags);
|
|
Passes back the bounds of a file. If the file is already in the sequence, it is preferable to get a file’s video bounds using the Clip Render Suite. csSDK_int32 getFileVideoBounds (
prFileSpec *filespec,
prRect *bounds);
|
|
This very important call returns the SweetPea suite that allows plugins to acquire and release all other SweetPea Suites. SPBasicSuite* getSPBasicSuite();
|
|
Passes back the list of valid entensions/filter strings given a class of media (see file types constants below). csSDK_int32 (*plugGetFileExtStringFunc)(
csSDK_uint32 fileTypes,
char *inBuffer,
csSDK_uint32 inBufferSize);
|
Timeline Functions¶
Function |
Description |
---|---|
|
Superceded by the Clip Render Suite, which provides asynchronous import. Retrieves a frame from a clip in a segment tree returned from the Video Segment Suite. It can be used by to retrieve and store a still frame, such as a title, for playback. This call is expensive; use it carefully. csSDK_int32 getClipVideo (
csSDK_int32 frame,
PPixHand thePort,
prRect *bounds,
csSDK_int32 flags,
PrClipID clipData);
|
|
Passes back two longs with the start and end of the current work area (read-only). Set timelineData to the timelineData of the current sequence. csSDK_int32 getWorkArea (
PrTimelineID timelineData,
csSDK_int32 *workAreaStart,
csSDK_int32 *workAreaEnd);
|
|
Passes back the current timebase of the timeline ( void getCurrentTimebase(
PrTimelineID timelineData,
csSDK_uint32 *scale,
csSDK_int32 *sampleSize);
|
|
Returns the position of the current time indicator (the position bar set by the user). If (-1) is returned, the position bar in the timeline is not present. csSDK_int32 getCurrentPos(
PrTimelineID timelineData);
|
|
Gets a fully rendered frame from the timeline (all layers). Used by video filters and transitions for previews in a modal setup dialog. If the return value is -1, an error occurred, but if it is 0, the callback has returned safely. Exporters rendering final movies should NOT use this callback. csSDK_int32 getPreviewFrameEx(
PrTimelineID timelineData,
csSDK_int32 inFrame,
PPixHand* outRenderedFrame,
const prRect* inFrameRect,
PrPixelFormat* inRequestedPixelFormatArray,
csSDK_int32 inRequestedPixelFormatArrayCount,
csSDK_uint32 inPixelAspectRatioNumerator,
csSDK_uint32 inPixelAspectRatioDenominator,
bool inAlwaysRender);
|
|
Passes back the dimensions of a clip in a sequence. For rolling/ crawling titles, use the Roll/Crawl Suite to get the dimensions instead. csSDK_int32 getClipVideoBounds (
PrClipID inClipData,
prRect *outBounds,
csSDK_uint32 *outPixelAspectRatioNumerator,
csSDK_uint32 *outPixelAspectRatioDenominator);
|
|
Superceded by the Clip Render Suite, which provides asynchronous import. Retrieves a frame from a clip in a segment tree returned from the Video Segment Suite. It can be used by to retrieve and store a still frame, such as a title, for playback. This call is expensive; use it carefully. csSDK_int32 getClipVideoEx (
csSDK_int32 inFrame,
PPixHand *outRenderedFrame,
const prRect *inFrameRect,
const PrPixelFormat *inRequestedPixelFormatArray,
csSDK_int32 inRequestedPixelFormatArrayCount,
csSDK_uint32 inPixelAspectRatioNumerator,
csSDK_uint32 inPixelAspectRatioDenominator,
PrClipID inClipData);
|
Bottleneck Functions¶
The pointer to the legacy bottleneck functions is passed only to transitions and video filters.
These functions are not exposed for other plugin types.
These functions are not aware of different pixel formats, and are intended only for 8-bit BGRA processing.
Sample usage:
((*theData)->bottleNecks->StretchBits) (*srcpix,
*dstpix,
&srcbox,
&srcbox,
0,
NULL);
Function |
Description |
---|---|
|
Stretches and copies an image, including the alpha channel. When the destination is larger than the source, it performs bilinear interpolation for smooth scaling. void StretchBits (
PPixHand srcPix,
PPixHand dstPix,
prRect srcRect,
prRect dstRect,
int mode,
prRgn rgn);
StretchBits only works on 8-bit PPixs. srcRect is the area of the source PPix to copy; dstRect is used to scale the copy. Valid modes are For Example: To blend 30% of the source with the destination, use While much slower than cbMaskHdl tells StretchBits that prRgn is a handle to a 1-bit deep buffer the same size as the source and destination PPixs, to be used as a mask. Pass 0 for no clipping. The prRgn parameter is only used on Windows. |
|
Maps the source rectangle to a four-point polygon in the destination. void DistortPolygon (
PPixHand src,
PPixHand dest,
prRect *srcbox,
prPoint *dstpts);
When scaling up, |
|
Maps a four-point src polygon into a four-point polygon (dstpts). If the source polygon is a rectangle, it is equivalent to void MapPolygon (
PPixHand src,
PPixHand dest,
prPoint *srcpts,
prPoint *dstpts );
|
|
Equivalent to DistortPolygon, using fixed-point coordinates. void DistortFixed (
PPixHand src,
PPixHand dest,
prRect *srcbox,
LongPoint *dstpts);
|
|
Equivalent to MapPolygon, using fixed-point coordinates. void FixedToFixed (
PPixHand src,
PPixHand dest,
LongPoint *srcpts,
LongPoint *dstpts);
|
|
Image map function. void DoIndexMap (
char *src,
char *dst,
short row,
short, pixwidth,
short, height,
char *lookup1,
char *lookup2,
char *lookup3);
|
|
Convolution function. void DoConvolve (
unsigned char *src,
unsigned char *dst,
short *inmatrix,
short, rowBytes,
short, width,
short, height);
|