<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: 15.4.0 -",
    "macOS: 12.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMediaIO",
  "identifier" : "/documentation/CoreMediaIO/CMIOExtensionStream",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Media I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)CMIOExtensionStream"
  },
  "title" : "CMIOExtensionStream"
}
-->

# CMIOExtensionStream

An object that represents a stream of media data.

```
class CMIOExtensionStream
```

## Overview

A stream delivers media samples to or from a [`CMIOExtensionDevice`](/documentation/CoreMediaIO/CMIOExtensionDevice).

## Topics

### Creating a Stream

[`+ (instancetype) streamWithLocalizedName:(NSString *) localizedName streamID:(NSUUID *) streamID direction:(CMIOExtensionStreamDirection) direction clockType:(CMIOExtensionStreamClockType) clockType source:(id<CMIOExtensionStreamSource>) source;`](/documentation/CoreMediaIO/CMIOExtensionStream/streamWithLocalizedName:streamID:direction:clockType:source:)

Returns a new stream.

[`+ (instancetype) streamWithLocalizedName:(NSString *) localizedName streamID:(NSUUID *) streamID direction:(CMIOExtensionStreamDirection) direction customClockConfiguration:(CMIOExtensionStreamCustomClockConfiguration *) customClockConfiguration source:(id<CMIOExtensionStreamSource>) source;`](/documentation/CoreMediaIO/CMIOExtensionStream/streamWithLocalizedName:streamID:direction:customClockConfiguration:source:)

Returns a new stream that uses a custom clock configuration.

[`init(localizedName: String, streamID: UUID, direction: CMIOExtensionStream.Direction, clockType: CMIOExtensionStream.ClockType, source: any CMIOExtensionStreamSource)`](/documentation/CoreMediaIO/CMIOExtensionStream/init(localizedName:streamID:direction:clockType:source:))

Creates a stream.

[`init(localizedName: String, streamID: UUID, direction: CMIOExtensionStream.Direction, customClockConfiguration: CMIOExtensionStreamCustomClockConfiguration, source: any CMIOExtensionStreamSource)`](/documentation/CoreMediaIO/CMIOExtensionStream/init(localizedName:streamID:direction:customClockConfiguration:source:))

Creates a stream that uses a custom clock configuration.

### Identifying a Stream

[`var localizedName: String`](/documentation/CoreMediaIO/CMIOExtensionStream/localizedName)

A localized name for the stream.

[`var streamID: UUID`](/documentation/CoreMediaIO/CMIOExtensionStream/streamID)

A universally unique identifier for the stream.

### Accessing Clients

[`var streamingClients: [CMIOExtensionClient]`](/documentation/CoreMediaIO/CMIOExtensionStream/streamingClients)

An array of clients of the stream.

### Inspecting a Stream

[`var source: (any CMIOExtensionStreamSource)?`](/documentation/CoreMediaIO/CMIOExtensionStream/source)

The source object for the stream.

[`var direction: CMIOExtensionStream.Direction`](/documentation/CoreMediaIO/CMIOExtensionStream/direction-swift.property)

The data-flow direction of the stream.

[`enum Direction`](/documentation/CoreMediaIO/CMIOExtensionStream/Direction-swift.enum)

Constants that define the data-flow direction of the stream.

[`var clockType: CMIOExtensionStream.ClockType`](/documentation/CoreMediaIO/CMIOExtensionStream/clockType-swift.property)

A clock type for the stream.

[`enum ClockType`](/documentation/CoreMediaIO/CMIOExtensionStream/ClockType-swift.enum)

Constants that indicate the clock type of a stream.

[`var customClockConfiguration: CMIOExtensionStreamCustomClockConfiguration?`](/documentation/CoreMediaIO/CMIOExtensionStream/customClockConfiguration)

An optional custom clock configuration for a stream.

[`class CMIOExtensionStreamCustomClockConfiguration`](/documentation/CoreMediaIO/CMIOExtensionStreamCustomClockConfiguration)

An object that describes the parameters to create a custom clock on the host side.

### Processing Data

[`func consumeSampleBuffer(from: CMIOExtensionClient, completionHandler: (CMSampleBuffer?, UInt64, CMIOExtensionStream.DiscontinuityFlags, Bool, (any Error)?) -> Void)`](/documentation/CoreMediaIO/CMIOExtensionStream/consumeSampleBuffer(from:completionHandler:))

Consumes a sample buffer from a client.

[`func send(CMSampleBuffer, discontinuity: CMIOExtensionStream.DiscontinuityFlags, hostTimeInNanoseconds: UInt64)`](/documentation/CoreMediaIO/CMIOExtensionStream/send(_:discontinuity:hostTimeInNanoseconds:))

Sends a media sample to stream client.

[`struct DiscontinuityFlags`](/documentation/CoreMediaIO/CMIOExtensionStream/DiscontinuityFlags)

Constants that specify the types of discontinuities that can occur in a media stream.

### Posting Property Changes

[`func notifyPropertiesChanged([CMIOExtensionProperty : CMIOExtensionPropertyState<AnyObject>])`](/documentation/CoreMediaIO/CMIOExtensionStream/notifyPropertiesChanged(_:))

Notifies clients about stream property changes.

### Managing Scheduled Output

[`func notifyScheduledOutputChanged(CMIOExtensionScheduledOutput)`](/documentation/CoreMediaIO/CMIOExtensionStream/notifyScheduledOutputChanged(_:))

Notifies clients when a particular buffer is output.

[`class CMIOExtensionScheduledOutput`](/documentation/CoreMediaIO/CMIOExtensionScheduledOutput)

An object that represents scheduled output.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)