<!--
{
  "documentType" : "article",
  "framework" : "professional_video_applications",
  "identifier" : "/documentation/Professional-Video-Applications/scheduling-media-in-plug-ins",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Scheduling media in plug-ins"
}
-->

# Scheduling media in plug-ins

Use the scheduling APIs in FxPlug to retrieve frames from different times.

## Discussion

The FxPlug SDK provides several timing and scheduling methods that give plug-ins a way to get the current time and to schedule media.

### Get the current time

When an onscreen control or an event in a custom parameter view requires the current time, use the [`currentTime()`](/documentation/professional_video_applications/FxCustomParameterActionAPI_v4/currentTime()) method in the `FxCustomParameterAPI` protocol to get the rational time.

> Important:
> All FxPlug 4 APIs represent time using <doc://com.apple.documentation/documentation/CoreMedia/CMTime>. If you’re familiar with previous versions of FxPlug, note the move away from `FxTime`. For more information, see <doc://com.apple.documentation/documentation/CoreMedia/CMTime>.

### Schedule media

The scheduling API lets the host applications schedule the media contained in image wells. Consider this method, new to FxPlug 4:

```swift
optional func scheduleInputs(_ inputImageRequests: AutoreleasingUnsafeMutablePointer<NSArray?>?, withPluginState pluginState: Data?, at renderTime: CMTime) throws
```

This method tells the host application how many frames from the given input sources your plug-in will require in order to render at the given render time. See `PictureInPicturePlugIn.m` in the `FxPictureInPicture` project for an example of how [`scheduleInputs(_:withPluginState:at:)`](/documentation/professional_video_applications/FxTileableEffect/scheduleInputs(_:withPluginState:at:)) can be used with an image well.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)