Mac Developer Library

Developer

IOVideoDeviceInterface Reference

Options
Deployment Target:

On This Page

IOVideoDeviceInterface

Interface for accessing kernel-space video drivers from user space. More...

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable
  • Add the CFRunLoopSource for the notification port to a run loop.

    Declaration

    C++

    IOReturn ( *AddToRunLoop)( IOVideoDeviceRef device, CFRunLoopRef runLoop);

    Parameters

    device

    The IOVideoDeviceRef of the device to operate on.

    runLoop

    The run loop to which to add the notification source.

    Return Value

    Returns kIOReturnSuccess if the source was successfully added to the run loop.

    Import Statement

  • Closes an IOVideoDevice.

    Declaration

    C++

    IOReturn ( *Close)( IOVideoDeviceRef device);

    Parameters

    device

    The IOVideoDeviceRef of the device to close.

    Return Value

    Returns kIOReturnSuccess if the device was successfully closed.

    Discussion

    Calling Close frees all streams belonging to the device and frees all user resources used by the device.

    Import Statement

  • Declaration

    C++

    IOReturn ( *CreateStreamInterface)( IOVideoDeviceRef device, CFDictionaryRef streamDictionary, UInt32 streamIndex, bool isInput, IOStreamRef *streamRef);

    Parameters

    device

    The IOVideoDeviceRef of the device to operate on.

    streamDictionary
    streamIndex
    isInput

    Return Value

    Returns kIOReturnSuccess if the stream was successfully created.

    Import Statement

  • Get the notification port for device state changes sent to user space.

    Declaration

    C++

    CFMachPortRef ( *GetNotificationPort)( IOVideoDeviceRef device);

    Parameters

    device

    The IOVideoDeviceRef of the stream to operate on.

    Return Value

    A CFMachPortRef of the output notification port.

    Import Statement

  • Gets a CFRunLoopSource for the CFMachPort used for notifications from the kernel that data is ready.

    Declaration

    C++

    CFRunLoopSourceRef ( *GetRunLoopSource)( IOVideoDeviceRef device);

    Parameters

    device

    The IOVideoDeviceRef of the stream to operate on.

    Return Value

    The CFRunLoopSourceRef for the run loop source, or NULL if there was an error creating the source.

    Import Statement

  • Open an IOVideoDevice from user space.

    Declaration

    C++

    IOReturn ( *Open)( IOVideoDeviceRef device, IOOptionBits options);

    Parameters

    device

    The IOVideoDeviceRef to the device returned by QueryInterface.

    options

    Open options. Currently unused.

    Return Value

    If the device could not be opened an error will be returned.

    Discussion

    The Open function opens the device.

    Import Statement

  • Declaration

    C++

    IOReturn ( *ReleaseStreamInterface)( IOVideoDeviceRef device, bool isInput, IOStreamRef *streamRef);

    Parameters

    device

    The IOVideoDeviceRef of the device to operate on.

    isInput
    streamRef

    Return Value

    Returns kIOReturnSuccess if the stream was successfully released.

    Import Statement

  • Remove the CFRunLoopSource for the notification port from a run loop.

    Declaration

    C++

    IOReturn ( *RemoveFromRunLoop)( IOVideoDeviceRef device, CFRunLoopRef runLoop);

    Parameters

    device

    The IOVideoDeviceRef of the device to operate on.

    runLoop

    The run loop from which to remove the notification source.

    Return Value

    Returns kIOReturnSuccess if the source was successfully removed from the run loop.

    Import Statement

  • Declaration

    C++

    IOReturn ( *SetControlValue)( IOVideoDeviceRef device, UInt32 controlID, UInt32 value, UInt32 *newValue);

    Parameters

    device
    controlID
    newValue

    Return Value

    Returns kIOReturnSuccess if the call was successfully.

    Import Statement

  • Set the callback function to be called when certain device state changes happen.

    Declaration

    C++

    IOReturn ( *SetNotificationCallback)( IOVideoDeviceRef device, IOVideoDeviceNotificationCallback callback, void *context);

    Parameters

    device

    The IOVideoDeviceRef of the device to operate on. Pass NULL to remove the callback.

    Return Value

    Returns kIOReturnSuccess if the callback was successfully set or removed.

    Import Statement

  • Declaration

    C++

    IOReturn ( *SetStreamFormat)( IOVideoDeviceRef device, UInt32 streamID, IOVideoStreamDescription *streamFormat);

    Parameters

    device
    streamID
    streamFormat

    Return Value

    Returns kIOReturnSuccess if the call was successfully.

    Import Statement