<!--
{
  "availability" : [
    "DriverKit: 27.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "VideoDriverKit",
  "identifier" : "/documentation/VideoDriverKit/IOUserVideoStream",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "VideoDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserVideoStream"
  },
  "title" : "IOUserVideoStream"
}
-->

# IOUserVideoStream

A video stream.

```
class IOUserVideoStream;
```

## Overview

[`IOUserVideoDevice`](/documentation/VideoDriverKit/IOUserVideoDevice) instances own [`IOUserVideoStream`](/documentation/VideoDriverKit/IOUserVideoStream) instances.
[`IOUserVideoStream`](/documentation/VideoDriverKit/IOUserVideoStream) allocates memory descriptors that the host uses for running IO.
Changes to the owning [`IOUserVideoDevice`](/documentation/VideoDriverKit/IOUserVideoDevice) will potentially update formats
on the underlying [`IOUserVideoStream`](/documentation/VideoDriverKit/IOUserVideoStream).

## Topics

### Creating a video stream

[`static OSSharedPtr<IOUserVideoStream> Create(IOUserVideoDriver *in_driver, OSString *in_stream_uid, IOUserVideoStreamDirection in_direction, OSArray *in_video_buffers);`](/documentation/VideoDriverKit/IOUserVideoStream/Create)

[`virtual bool init(IOUserVideoDriver *in_driver, OSString *in_stream_uid, IOUserVideoStreamDirection in_direction, OSArray *in_video_buffers);`](/documentation/VideoDriverKit/IOUserVideoStream/init)

Initializes an video stream.

[`class IOUserVideoDriver;`](/documentation/VideoDriverKit/IOUserVideoDriver)

A video driver.

### Freeing a video stream

[`virtual void free();`](/documentation/VideoDriverKit/IOUserVideoStream/free)

Frees the video stream.

### Getting information about the class

[`virtual IOUserVideoClassID GetClassID();`](/documentation/VideoDriverKit/IOUserVideoStream/GetClassID)

Gets the class identifier of the object.

[`virtual IOUserVideoClassID GetBaseClassID();`](/documentation/VideoDriverKit/IOUserVideoStream/GetBaseClassID)

Gets the class identifier of the base class object.

[`enum IOUserVideoClassID : uint32_t;`](/documentation/VideoDriverKit/VideoDriverKit/IOUserVideoClassID)

Video class identifiers of an video object.

### Performing I/O

[`virtual kern_return_t StartIO(IOUserVideoStartStopFlags in_flags);`](/documentation/VideoDriverKit/IOUserVideoStream/StartIO)

Tells the stream to start IO.

[`virtual kern_return_t StopIO(IOUserVideoStartStopFlags in_flags);`](/documentation/VideoDriverKit/IOUserVideoStream/StopIO)

Tells the stream to stop IO.

[`enum IOUserVideoStartStopFlags : uint64_t;`](/documentation/VideoDriverKit/VideoDriverKit/IOUserVideoStartStopFlags)

Flags used to indicate how I/O is starting or stopping.

[`virtual void InputNotification();`](/documentation/VideoDriverKit/IOUserVideoStream/InputNotification)

### Working with stream formats

[`kern_return_t SetCurrentStreamFormat(const IOUserVideoStreamBasicDescription *in_format);`](/documentation/VideoDriverKit/IOUserVideoStream/SetCurrentStreamFormat)

Sets the current stream format.

[`IOUserVideoStreamBasicDescription GetCurrentStreamFormat();`](/documentation/VideoDriverKit/IOUserVideoStream/GetCurrentStreamFormat)

Gets the current basic description of the stream.

[`kern_return_t SetAvailableStreamFormats(const IOUserVideoStreamBasicDescription *in_formats, uint32_t in_num_formats);`](/documentation/VideoDriverKit/IOUserVideoStream/SetAvailableStreamFormats)

Sets the available descriptions for the stream.

[`size_t GetAvailableStreamFormats(IOUserVideoStreamBasicDescription *out_formats, size_t in_num_formats);`](/documentation/VideoDriverKit/IOUserVideoStream/GetAvailableStreamFormats)

Gets the available basic descriptions for the stream.

[`size_t GetNumberAvailableStreamFormats();`](/documentation/VideoDriverKit/IOUserVideoStream/GetNumberAvailableStreamFormats)

Gets the number of available description for the stream.

[`struct IOUserVideoStreamBasicDescription;`](/documentation/VideoDriverKit/VideoDriverKit/IOUserVideoStreamBasicDescription)

A structure that encapsulates all the information for describing the basic
format properties of a stream of audio data.

[`IOUserVideoStreamDirection GetStreamDirection();`](/documentation/VideoDriverKit/IOUserVideoStream/GetStreamDirection)

Gets the direction of the stream.

[`enum IOUserVideoStreamDirection : uint32_t;`](/documentation/VideoDriverKit/VideoDriverKit/IOUserVideoStreamDirection)

The direction of a video stream.

[`kern_return_t SetStreamIsActive(bool in_is_active);`](/documentation/VideoDriverKit/IOUserVideoStream/SetStreamIsActive)

Sets whether that the stream is active and doing IO.

[`bool GetStreamIsActive();`](/documentation/VideoDriverKit/IOUserVideoStream/GetStreamIsActive)

Gets the stream activity state.

### Working with stream terminals

[`kern_return_t SetTerminalType(IOUserVideoStreamTerminalType in_terminal_type);`](/documentation/VideoDriverKit/IOUserVideoStream/SetTerminalType)

Sets the terminal type of the stream.

[`IOUserVideoStreamTerminalType GetTerminalType();`](/documentation/VideoDriverKit/IOUserVideoStream/GetTerminalType)

Gets the terminal type of the stream.

[`enum IOUserVideoStreamTerminalType : uint32_t;`](/documentation/VideoDriverKit/VideoDriverKit/IOUserVideoStreamTerminalType)

The terminal type of video stream.

### Working with memory descriptors

[`OSSharedPtr<IOMemoryDescriptor> GetOutputControlMemoryDescriptor(IOUserVideoObjectID in_object_id);`](/documentation/VideoDriverKit/IOUserVideoStream/GetOutputControlMemoryDescriptor)

Gets the memory descriptor used for the control data part of a buffer.

[`OSSharedPtr<IOMemoryDescriptor> GetOutputDataMemoryDescriptor(IOUserVideoObjectID in_object_id);`](/documentation/VideoDriverKit/IOUserVideoStream/GetOutputDataMemoryDescriptor)

Gets the memory descriptor used for the video data part of a buffer.

[`OSSharedPtr<IOMemoryDescriptor> GetOutputQueueMemoryDescriptor();`](/documentation/VideoDriverKit/IOUserVideoStream/GetOutputQueueMemoryDescriptor)

Returns an memory descriptorrepesenting the shared memory
output queue buffer.

[`OSSharedPtr<IOMemoryDescriptor> GetInputQueueMemoryDescriptor();`](/documentation/VideoDriverKit/IOUserVideoStream/GetInputQueueMemoryDescriptor)

Returns an memory descriptor for the shared memory input queue buffer.

[`IOUserVideoObjectID GetMemoryObjectID(uint32_t memtype);`](/documentation/VideoDriverKit/IOUserVideoStream/GetMemoryObjectID)

Gets the video object identifier for a memory object.

### Managing stream changes

[`virtual kern_return_t HandleChangeCurrentStreamFormat(const IOUserVideoStreamBasicDescription *in_format);`](/documentation/VideoDriverKit/IOUserVideoStream/HandleChangeCurrentStreamFormat)

The system calls this virtual method when the stream’s format changes.

[`virtual kern_return_t HandleChangeStreamIsActive(bool in_is_active);`](/documentation/VideoDriverKit/IOUserVideoStream/HandleChangeStreamIsActive)

The system calls this virtual method when the stream active state changes.

[`kern_return_t DeviceSampleRateChanged(double in_sample_rate);`](/documentation/VideoDriverKit/IOUserVideoStream/DeviceSampleRateChanged)

Call to update stream formats when the owning video device changes sample rate.

### Working with video buffers

[`uint32_t GetBufferCount();`](/documentation/VideoDriverKit/IOUserVideoStream/GetBufferCount)

Returns the number of buffers in the buffer queue.

[`OSSharedPtr<OSArray> GetBufferList();`](/documentation/VideoDriverKit/IOUserVideoStream/GetBufferList)

Gets an array containing all the buffers in the video stream.

[`OSSharedPtr<IOUserVideoBuffer> GetBufferWithID(uint32_t bufferID);`](/documentation/VideoDriverKit/IOUserVideoStream/GetBufferWithID)

[`kern_return_t addBuffer(IOUserVideoBuffer *buffer);`](/documentation/VideoDriverKit/IOUserVideoStream/addBuffer)

Add a buffer to a video stream.

[`kern_return_t addBuffers(OSArray *buffers);`](/documentation/VideoDriverKit/IOUserVideoStream/addBuffers)

[`kern_return_t enqueueOutputBuffer(IOUserVideoBuffer *buffer, uint32_t dataOffset, uint32_t dataLength, uint32_t controlOffset, uint32_t controlLength);`](/documentation/VideoDriverKit/IOUserVideoStream/enqueueOutputBuffer)

[`class IOUserVideoBuffer;`](/documentation/VideoDriverKit/IOUserVideoBuffer)

[`kern_return_t removeAllBuffers();`](/documentation/VideoDriverKit/IOUserVideoStream/removeAllBuffers)

Removes all buffers from the video stream.

[`kern_return_t SendOutputBufferNotification();`](/documentation/VideoDriverKit/IOUserVideoStream/SendOutputBufferNotification)

Sends a notification to the host that data is available
for reading on the output queue.

### Working with channels

[`kern_return_t SetStartingChannel(uint32_t in_starting_channel);`](/documentation/VideoDriverKit/IOUserVideoStream/SetStartingChannel)

Sets the starting channel of the stream.

[`uint32_t GetStartingChannel();`](/documentation/VideoDriverKit/IOUserVideoStream/GetStartingChannel)

Gets the starting channel of the stream.

### Working with queues

[`IOStreamBufferQueue * GetInputQueue();`](/documentation/VideoDriverKit/IOUserVideoStream/GetInputQueue)

Gets the buffer queue for the stream.

[`IOStreamBufferQueue * GetOutputQueue();`](/documentation/VideoDriverKit/IOUserVideoStream/GetOutputQueue)

Gets the memory descriptor used for video IO that was initialized with or set on the video stream.

[`kern_return_t createQueues(uint32_t queueCount, uint32_t options);`](/documentation/VideoDriverKit/IOUserVideoStream/createQueues)

Creates the shared input and output queues, without regard
to whether the stream is open or not.

[`kern_return_t destroyQueues();`](/documentation/VideoDriverKit/IOUserVideoStream/destroyQueues)

Releases the shared input and output queues.

[`kern_return_t dequeueInputEntry(IOStreamBufferQueueEntry *entry);`](/documentation/VideoDriverKit/IOUserVideoStream/dequeueInputEntry)

[`kern_return_t enqueueOutputEntry(IOStreamBufferQueueEntry *entry);`](/documentation/VideoDriverKit/IOUserVideoStream/enqueueOutputEntry)

[`kern_return_t SendBufferQueueChange();`](/documentation/VideoDriverKit/IOUserVideoStream/SendBufferQueueChange)

Sends a notification to the host that the buffer queue has changed.

[`struct IOStreamBufferQueue;`](/documentation/VideoDriverKit/IOStreamBufferQueue)

### Stream memory types

[`kIOStreamMemoryTypeBufferControl`](/documentation/VideoDriverKit/kIOStreamMemoryTypeBufferControl)

[`kIOStreamMemoryTypeBufferData`](/documentation/VideoDriverKit/kIOStreamMemoryTypeBufferData)

[`kIOStreamMemoryTypeInputQueue`](/documentation/VideoDriverKit/kIOStreamMemoryTypeInputQueue)

[`kIOStreamMemoryTypeMask`](/documentation/VideoDriverKit/kIOStreamMemoryTypeMask)

[`kIOStreamMemoryTypeOutputQueue`](/documentation/VideoDriverKit/kIOStreamMemoryTypeOutputQueue)

## Relationships

### Inherits From

[`IOUserVideoObject`](/documentation/VideoDriverKit/IOUserVideoObject)

---

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)