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

# IOUserVideoClockDevice

A clock device.

```
class IOUserVideoClockDevice;
```

## Overview

[`IOUserVideoClockDevice`](/documentation/VideoDriverKit/IOUserVideoClockDevice) handles the necessary configurations to be able to run IO.

## Topics

### Creating a clock device

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

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

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

Initializes a video clock device.

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

A video driver.

### Freeing a clock device

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

Frees the video clock device.

### Getting information about the class

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

Gets the class identifier of the object.

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

Tells the clock device to start IO.

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

Tells the clock device to stop IO.

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

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

### Supporting device configuration changes

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

The host calls this method to allow the clock device to perform a configuration
change.

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

The host calls this method to tell the driver not to perform a
configuration change.

### Supporting sample rate changes

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

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

### Identifying the clock device

[`OSSharedPtr<OSString> GetUID();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetUID)

Gets the unique identifier of the clock device.

### Working with the clock domain

[`kern_return_t SetClockDomain(uint32_t in_clock_domain);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetClockDomain)

Sets the clock domain value of the clock device.

[`uint32_t GetClockDomain();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetClockDomain)

Gets the clock domain value of the clock device.

### Working with sample rates

[`kern_return_t SetSampleRate(double in_sample_rate);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetSampleRate)

Sets the current sample rate for the clock device.

[`double GetSampleRate();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetSampleRate)

Gets sample rate of the clock device.

[`kern_return_t SetAvailableSampleRates(const double *in_sample_rates, size_t in_num_rates);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetAvailableSampleRates)

Sets the available sample rates for the clock device.

[`size_t GetAvailableSampleRates(double *out_sample_rates, size_t in_num_rates);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetAvailableSampleRates)

Gets available sample rates of the clock device.

[`size_t GetNumberAvailableSampleRates();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetNumberAvailableSampleRates)

Gets number of available sample rates of the clock device.

### Working with timing and latency

[`kern_return_t SetOutputLatency(uint32_t in_latency);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetOutputLatency)

Sets the output latency of the clock device.

[`uint32_t GetOutputLatency();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetOutputLatency)

Gets the output latency of the clock device.

[`kern_return_t SetInputLatency(uint32_t in_latency);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetInputLatency)

Sets the input latency of the clock device.

[`uint32_t GetInputLatency();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetInputLatency)

Gets the input latency of the clock device.

### Working with clock device state

[`bool GetDeviceIsRunning();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetDeviceIsRunning)

Gets bool value indicating if device is running.

[`kern_return_t SetDeviceIsAlive(bool in_is_alive);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetDeviceIsAlive)

Sets a Boolean value to indicate the device is alive.

[`bool GetDeviceIsAlive();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetDeviceIsAlive)

Gets a Boolean value indicating if the device is alive.

[`kern_return_t SetIsHidden(bool in_is_hidden);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetIsHidden)

Sets a Boolean value indicating if the device is hidden.

[`bool GetIsHidden();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetIsHidden)

Gets a Boolean value indicating if the device is hidden.

### Working with clock device behavior

[`kern_return_t SetClockAlgorithm(IOUserVideoClockAlgorithm in_clock_algorithm);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetClockAlgorithm)

Sets the algorithm for the video clock device.

[`IOUserVideoClockAlgorithm GetClockAlgorithm();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetClockAlgorithm)

Gets the clock algorithm of the clock device.

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

Clock smoothing algorithm selectors.

[`kern_return_t SetClockIsStable(bool in_clock_is_stable);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetClockIsStable)

Sets the clock stability of the clock device.

[`bool GetClockIsStable();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetClockIsStable)

Gets a Boolean value for clock stability of the clock device.

### Working with transport type

[`kern_return_t SetTransportType(IOUserVideoTransportType in_transport_type);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/SetTransportType)

Sets the transport type of the clock device.

[`IOUserVideoTransportType GetTransportType();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetTransportType)

Gets the transport type of the IOUserVideoClockDevice.

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

The transport type of a video stream.

### Communicating with the host

[`kern_return_t RequestDeviceConfigurationChange(uint64_t in_change_action, OSObject *in_change_info);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/RequestDeviceConfigurationChange)

Tells the host to initiate a configuration change operation.

### Managing video controls

[`kern_return_t AddControl(IOUserVideoControl *in_control);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/AddControl)

Adds a video control to the video clock device.

[`kern_return_t RemoveControl(IOUserVideoControl *in_control);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/RemoveControl)

Removes a user video control from the video clock device.

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

A base class for control objects.

### Accessing timestamps

[`void UpdateCurrentZeroTimestamp(uint64_t in_sample_time, uint64_t in_host_time);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/UpdateCurrentZeroTimestamp)

Update the current timestamp value.

[`void GetCurrentZeroTimestamp(uint64_t *out_sample_time, uint64_t *out_host_time);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetCurrentZeroTimestamp)

Gets the current zero timestamp value.

### Accessing client status information

[`void GetCurrentClientSampleTime(uint64_t *out_input_sample_time, uint64_t *out_output_sample_time);`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetCurrentClientSampleTime)

Gets the current sample time in the ring buffer that the client reads from and writes to.

### Working with transport states

[`IOUserVideoDeviceTransportState GetDeviceTransportState();`](/documentation/VideoDriverKit/IOUserVideoClockDevice/GetDeviceTransportState)

Gets the transport state of the device.

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

The current transport state of the device.

### Handling stream format changes

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

## Relationships

### Inherits From

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

### Inherited By

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

---

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)