<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMBufferQueueInstallTriggerWithIntegerThreshold(_:callback:refcon:condition:threshold:triggerTokenOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMBufferQueueInstallTriggerWithIntegerThreshold"
  },
  "title" : "CMBufferQueueInstallTriggerWithIntegerThreshold(_:callback:refcon:condition:threshold:triggerTokenOut:)"
}
-->

# CMBufferQueueInstallTriggerWithIntegerThreshold(_:callback:refcon:condition:threshold:triggerTokenOut:)

Installs a trigger with a callback and threshold on a buffer queue.

```
func CMBufferQueueInstallTriggerWithIntegerThreshold(_ queue: CMBufferQueue, callback: CMBufferQueueTriggerCallback?, refcon: UnsafeMutableRawPointer?, condition: CMBufferQueueTriggerCondition, threshold: CMItemCount, triggerTokenOut: UnsafeMutablePointer<CMBufferQueueTriggerToken?>?) -> OSStatus
```

## Parameters

`queue`

`CMBufferQueue` on which the trigger is being set.

`callback`

Callback to be called when the trigger condition becomes true. Can be `NULL`, if client intends only to explicitly test the condition.  Cannot be `NULL` if triggerTokenOut is NULL, otherwise the trigger would be meaningless.

`refcon`

Refcon to be passed to the triggerCallback. Can be `NULL` if the callback doesn’t need it, or is                                    itself `NULL`.``

`condition`

The condition to be tested when evaluating the trigger. Must be a valid condition for an integer threshold.

`threshold`

The integer value to compare against when evaluating the trigger.

`triggerTokenOut`

Address where created trigger token will be written. Can be `NULL`, if client has no need to explicitly test or remove the trigger. Cannot be `NULL` if triggerCallback is NULL, since the trigger would be meaningless then.

## Return Value

A result code. See `Result Codes`

## Discussion

This function behaves the same way as [`CMBufferQueueInstallTrigger(_:callback:refcon:condition:time:triggerTokenOut:)`](/documentation/CoreMedia/CMBufferQueueInstallTrigger(_:callback:refcon:condition:time:triggerTokenOut:)) except the trigger is evaluated against the integer value rather than the time value.

---

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)