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

# IOUserVideoDevice

A video device.

```
class IOUserVideoDevice;
```

## Overview

The device has [`IOUserVideoStream`](/documentation/VideoDriverKit/IOUserVideoStream) objects.

## Topics

### Creating a video device

[`static OSSharedPtr<IOUserVideoDevice> Create(IOUserVideoDriver *in_driver, OSString *in_device_uid, OSString *in_model_uid, OSString *in_manufacturer_uid);`](/documentation/VideoDriverKit/IOUserVideoDevice/Create)

A static factory method that allocates and initializes a video device.

[`virtual bool init(IOUserVideoDriver *in_driver, OSString *in_device_uid, OSString *in_model_uid, OSString *in_manufacturer_uid);`](/documentation/VideoDriverKit/IOUserVideoDevice/init)

Initializes a video device.

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

A video driver.

### Freeing a video device

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

Frees the IOUserVideoDevice.

### Getting information about the class

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

Gets the class identifier of the object.

[`virtual IOUserVideoClassID GetBaseClassID();`](/documentation/VideoDriverKit/IOUserVideoDevice/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/IOUserVideoDevice/StartIO)

Tells the device to start IO.

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

Tells the device to stop IO.

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

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

[`void GetCurrentClientIOTime(bool in_is_input, uint64_t *out_sample_time, uint64_t *out_host_time);`](/documentation/VideoDriverKit/IOUserVideoDevice/GetCurrentClientIOTime)

Gets the current sample/host time pair in the ring buffer written to or read from by the client

[`kern_return_t SetIOOperationHandler(IOOperationHandler in_io_operation_block);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetIOOperationHandler)

Sets the IOOperationHandler block on the device.

[`typedef int (^)(unsigned int, unsigned int, unsigned int, unsigned long long, unsigned long long) IOOperationHandler;`](/documentation/VideoDriverKit/VideoDriverKit/IOOperationHandler)

A block that tells the device to perform a video IO operation.

### Supporting device configuration changes

[`virtual kern_return_t PerformDeviceConfigurationChange(uint64_t in_change_action, OSObject *in_change_info);`](/documentation/VideoDriverKit/IOUserVideoDevice/PerformDeviceConfigurationChange)

The host calls this method to allow the device to perform a configuration
change it previously requested by calling
RequestDeviceConfigurationChange(), or a change to an IO state that
requires a configuration change.

[`virtual kern_return_t AbortDeviceConfigurationChange(uint64_t in_change_action, OSObject *in_change_info);`](/documentation/VideoDriverKit/IOUserVideoDevice/AbortDeviceConfigurationChange)

The host calls this method to tell the driver not to perform a
configuration change it requested by calling
RequestDeviceConfigurationChange(). Subclass and override this method to handle any
aborted custom configuration change requests. Then call the superclass implementation to update state.

### Supporting sample rate changes

[`virtual kern_return_t HandleChangeSampleRate(double in_sample_rate);`](/documentation/VideoDriverKit/IOUserVideoDevice/HandleChangeSampleRate)

The system calls this virtual method when the device’s sample rate changes.

### Supporting stream format changes

[`virtual void StreamFormatChanged(IOUserVideoObjectID stream_id);`](/documentation/VideoDriverKit/IOUserVideoDevice/StreamFormatChanged)

### Working with video streams

[`kern_return_t AddStream(IOUserVideoStream *in_stream);`](/documentation/VideoDriverKit/IOUserVideoDevice/AddStream)

Adds an video stream to the device.

[`kern_return_t RemoveStream(IOUserVideoStream *in_stream);`](/documentation/VideoDriverKit/IOUserVideoDevice/RemoveStream)

Removes a video stream from the device.

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

A video stream.

### Working with default device behavior

[`kern_return_t SetCanBeDefaultInputDevice(bool in_can_be_default);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetCanBeDefaultInputDevice)

Specify if device can be used as default input device.

[`uint32_t CanBeDefaultInputDevice();`](/documentation/VideoDriverKit/IOUserVideoDevice/CanBeDefaultInputDevice)

Returns a Boolean value indicating if device can be used for default input.

[`kern_return_t SetCanBeDefaultOutputDevice(bool in_can_be_default);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetCanBeDefaultOutputDevice)

Specifies if device can be used as default output device.

[`uint32_t CanBeDefaultOutputDevice();`](/documentation/VideoDriverKit/IOUserVideoDevice/CanBeDefaultOutputDevice)

Returns a Boolean value indicating if device can be used for default output.

[`kern_return_t SetCanBeDefaultSystemOutputDevice(bool in_can_be_default);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetCanBeDefaultSystemOutputDevice)

Specifies if device can be used as default system output device

[`uint32_t CanBeDefaultSystemOutputDevice();`](/documentation/VideoDriverKit/IOUserVideoDevice/CanBeDefaultSystemOutputDevice)

Returns a Boolean value indicating if device can be used for default system output.

### Working with safety offset behavior

[`kern_return_t SetInputSafetyOffset(uint32_t in_safety_offset);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetInputSafetyOffset)

Specifies the input safety offset of the device.

[`uint32_t GetInputSafetyOffset();`](/documentation/VideoDriverKit/IOUserVideoDevice/GetInputSafetyOffset)

Gets the input safety offset of the device.

[`kern_return_t SetOutputSafetyOffset(uint32_t in_safety_offset);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetOutputSafetyOffset)

Specifies the output safety offset of the device.

[`uint32_t GetOutputSafetyOffset();`](/documentation/VideoDriverKit/IOUserVideoDevice/GetOutputSafetyOffset)

Gets the output safety offset of the device.

### Working with channel layouts

[`kern_return_t SetPreferredChannelsForStereo(uint32_t in_left_channel, uint32_t in_right_channel);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetPreferredChannelsForStereo)

Sets the channel indices for the preferred stereo pair

[`void GetPreferredChannelsForStereo(uint32_t *out_left_channel, uint32_t *out_right_channel);`](/documentation/VideoDriverKit/IOUserVideoDevice/GetPreferredChannelsForStereo)

Gets the channel indices for the preferred stereo pair.

[`kern_return_t SetPreferredInputChannelLayout(IOUserVideoChannelLabel *in_channel_labels, size_t in_num_channels);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetPreferredInputChannelLayout)

Sets the input channel layout with IOUserVideoChannelLabel values

[`kern_return_t SetPreferredOutputChannelLayout(IOUserVideoChannelLabel *in_channel_labels, size_t in_num_channels);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetPreferredOutputChannelLayout)

Sets the output channel layout.

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

These constants are to set the preferred channel layout on video device.

### Working with controls

[`virtual void SetControlValue(IOUserVideoObjectID control_id, IOUserVideoClassID control_class_id);`](/documentation/VideoDriverKit/IOUserVideoDevice/SetControlValue)

## Relationships

### Inherits From

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

---

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)