IsochronousDataHandler.h [plain text]
#ifndef __ISOCHRONOUSDATAHANDLER__
#define __ISOCHRONOUSDATAHANDLER__
#ifndef __CORESERVICES__
#include <CoreServices/CoreServices.h>
#endif
#ifndef __MOVIESFORMAT__
#include <QuickTime/MoviesFormat.h>
#endif
#ifndef __QUICKTIMECOMPONENTS__
#include <QuickTime/QuickTimeComponents.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
enum {
kIDHComponentType = 'ihlr',
kIDHSubtypeDV = 'dv ',
kIDHSubtypeFireWireConference = 'fwc '
};
enum {
kIDHInterfaceVersion1 = 0x0001
};
enum {
kIDHDeviceListAtomType = 'dlst',
kIDHDeviceAtomType = 'devc',
kIDHIsochServiceAtomType = 'isoc',
kIDHIsochModeAtomType = 'mode',
kIDHDeviceIDType = 'dvid',
kIDHDefaultIOType = 'dfio',
kIDHIsochVersionAtomType = 'iver',
kIDHUniqueIDType = 'unid',
kIDHNameAtomType = 'name',
kIDHUseCMPAtomType = 'ucmp',
kIDHIsochMediaType = 'av ',
kIDHDataTypeAtomType = 'dtyp',
kIDHDataSizeAtomType = 'dsiz',
kIDHDataBufferSizeAtomType = 'dbuf',
kIDHDataIntervalAtomType = 'intv',
kIDHDataIODirectionAtomType = 'ddir',
kIDHSoundMediaAtomType = 'soun',
kIDHSoundTypeAtomType = 'type',
kIDHSoundChannelCountAtomType = 'ccnt',
kIDHSoundSampleSizeAtomType = 'ssiz',
kIDHSoundSampleRateAtomType = 'srat',
kIDHVideoMediaAtomType = 'vide',
kIDHVideoDimensionsAtomType = 'dimn',
kIDHVideoResolutionAtomType = 'resl',
kIDHVideoRefreshRateAtomType = 'refr',
kIDHVideoPixelTypeAtomType = 'pixl',
kIDHVideoDecompressorAtomType = 'deco',
kIDHVideoDecompressorTypeAtomType = 'dety',
kIDHVideoDecompressorContinuousAtomType = 'cont',
kIDHVideoDecompressorComponentAtomType = 'cmpt'
};
enum {
kIDHDataTypeIsInput = 1L << 0,
kIDHDataTypeIsOutput = 1L << 1,
kIDHDataTypeIsInputAndOutput = 1L << 2
};
enum {
kIDHOpenForReadTransactions = 1L << 0,
kIDHOpenForWriteTransactions = 1L << 1,
kIDHOpenWithExclusiveAccess = 1L << 2,
kIDHOpenWithHeldBuffers = 1L << 3,
kIDHCloseForReadTransactions = 1L << 4,
kIDHCloseForWriteTransactions = 1L << 5
};
enum {
kIDHErrDeviceDisconnected = -14101,
kIDHErrInvalidDeviceID = -14102,
kIDHErrDeviceInUse = -14104,
kIDHErrDeviceNotOpened = -14105,
kIDHErrDeviceBusy = -14106,
kIDHErrDeviceReadError = -14107,
kIDHErrDeviceWriteError = -14108,
kIDHErrDeviceNotConfigured = -14109,
kIDHErrDeviceList = -14110,
kIDHErrCompletionPending = -14111,
kIDHErrDeviceTimeout = -14112,
kIDHErrInvalidIndex = -14113,
kIDHErrDeviceCantRead = -14114,
kIDHErrDeviceCantWrite = -14115,
kIDHErrCallNotSupported = -14116
};
typedef UInt32 IDHDeviceID;
enum {
kIDHInvalidDeviceID = 0,
kIDHDeviceIDEveryDevice = (long)0xFFFFFFFF
};
enum {
kIDHDV_SD = 0,
kIDHDV_SDL = 1,
kIDHDV_HD = 2,
kIDHDVCPro_25 = 0x1E,
kIDHDVCPro_50 = 0x1D
};
struct IDHIsochInterval {
SInt32 duration;
TimeScale scale;
};
typedef struct IDHIsochInterval IDHIsochInterval;
typedef struct OpaquePsuedoID* PsuedoID;
struct IDHDeviceStatus {
UInt32 version;
Boolean physicallyConnected;
Boolean readEnabled;
Boolean writeEnabled;
Boolean exclusiveAccess;
UInt32 currentBandwidth;
UInt32 currentChannel;
PsuedoID localNodeID;
SInt16 inputStandard;
Boolean deviceActive;
UInt8 inputFormat;
UInt32 outputFormats;
};
typedef struct IDHDeviceStatus IDHDeviceStatus;
typedef UInt32 IDHEvent;
enum {
kIDHEventInvalid = 0,
kIDHEventDeviceAdded = 1L << 0,
kIDHEventDeviceRemoved = 1L << 1,
kIDHEventDeviceChanged = 1L << 2,
kIDHEventReadEnabled = 1L << 3,
kIDHEventFrameDropped = 1L << 4,
kIDHEventReadDisabled = 1L << 5,
kIDHEventWriteEnabled = 1L << 6,
kIDHEventReserved2 = 1L << 7,
kIDHEventWriteDisabled = 1L << 8,
kIDHEventEveryEvent = (unsigned long)0xFFFFFFFF
};
typedef UInt32 IDHNotificationID;
struct IDHEventHeader {
IDHDeviceID deviceID;
IDHNotificationID notificationID;
IDHEvent event;
};
typedef struct IDHEventHeader IDHEventHeader;
struct IDHGenericEvent {
IDHEventHeader eventHeader;
UInt32 pad[4];
};
typedef struct IDHGenericEvent IDHGenericEvent;
struct IDHDeviceConnectionEvent {
IDHEventHeader eventHeader;
};
typedef struct IDHDeviceConnectionEvent IDHDeviceConnectionEvent;
struct IDHDeviceIOEnableEvent {
IDHEventHeader eventHeader;
};
typedef struct IDHDeviceIOEnableEvent IDHDeviceIOEnableEvent;
struct IDHDeviceFrameDroppedEvent {
IDHEventHeader eventHeader;
UInt32 totalDropped;
UInt32 newlyDropped;
};
typedef struct IDHDeviceFrameDroppedEvent IDHDeviceFrameDroppedEvent;
typedef CALLBACK_API_C( OSStatus , IDHNotificationProcPtr )(IDHGenericEvent *event, void *userData);
typedef IDHNotificationProcPtr IDHNotificationProc;
typedef STACK_UPP_TYPE(IDHNotificationProcPtr) IDHNotificationUPP;
struct IDHParameterBlock {
UInt32 reserved1;
UInt16 reserved2;
void * buffer;
ByteCount requestedCount;
ByteCount actualCount;
IDHNotificationUPP completionProc;
void * refCon;
OSErr result;
};
typedef struct IDHParameterBlock IDHParameterBlock;
struct IDHResolution {
UInt32 x;
UInt32 y;
};
typedef struct IDHResolution IDHResolution;
struct IDHDimension {
Fixed x;
Fixed y;
};
typedef struct IDHDimension IDHDimension;
extern ComponentResult
IDHGetDeviceList(
ComponentInstance idh,
QTAtomContainer * deviceList);
extern ComponentResult
IDHGetDeviceConfiguration(
ComponentInstance idh,
QTAtomSpec * configurationID);
extern ComponentResult
IDHSetDeviceConfiguration(
ComponentInstance idh,
const QTAtomSpec * configurationID);
extern ComponentResult
IDHGetDeviceStatus(
ComponentInstance idh,
const QTAtomSpec * configurationID,
IDHDeviceStatus * status);
extern ComponentResult
IDHGetDeviceClock(
ComponentInstance idh,
Component * clock);
extern ComponentResult
IDHOpenDevice(
ComponentInstance idh,
UInt32 permissions);
extern ComponentResult
IDHCloseDevice(ComponentInstance idh);
extern ComponentResult
IDHRead(
ComponentInstance idh,
IDHParameterBlock * pb);
extern ComponentResult
IDHWrite(
ComponentInstance idh,
IDHParameterBlock * pb);
extern ComponentResult
IDHNewNotification(
ComponentInstance idh,
IDHDeviceID deviceID,
IDHNotificationUPP notificationProc,
void * userData,
IDHNotificationID * notificationID);
extern ComponentResult
IDHNotifyMeWhen(
ComponentInstance idh,
IDHNotificationID notificationID,
IDHEvent events);
extern ComponentResult
IDHCancelNotification(
ComponentInstance idh,
IDHNotificationID notificationID);
extern ComponentResult
IDHDisposeNotification(
ComponentInstance idh,
IDHNotificationID notificationID);
extern ComponentResult
IDHReleaseBuffer(
ComponentInstance idh,
IDHParameterBlock * pb);
extern ComponentResult
IDHCancelPendingIO(
ComponentInstance idh,
IDHParameterBlock * pb);
extern ComponentResult
IDHGetDeviceControl(
ComponentInstance idh,
ComponentInstance * deviceControl);
extern ComponentResult
IDHUpdateDeviceList(
ComponentInstance idh,
QTAtomContainer * deviceList);
extern ComponentResult
IDHGetDeviceTime(
ComponentInstance idh,
TimeRecord * deviceTime);
extern ComponentResult
IDHSetFormat(
ComponentInstance idh,
UInt32 format);
extern ComponentResult
IDHGetFormat(
ComponentInstance idh,
UInt32 * format);
extern IDHNotificationUPP
NewIDHNotificationUPP(IDHNotificationProcPtr userRoutine);
extern void
DisposeIDHNotificationUPP(IDHNotificationUPP userUPP);
extern OSStatus
InvokeIDHNotificationUPP(
IDHGenericEvent * event,
void * userData,
IDHNotificationUPP userUPP);
enum {
kIDHGetDeviceListSelect = 0x0001,
kIDHGetDeviceConfigurationSelect = 0x0002,
kIDHSetDeviceConfigurationSelect = 0x0003,
kIDHGetDeviceStatusSelect = 0x0004,
kIDHGetDeviceClockSelect = 0x0005,
kIDHOpenDeviceSelect = 0x0006,
kIDHCloseDeviceSelect = 0x0007,
kIDHReadSelect = 0x0008,
kIDHWriteSelect = 0x0009,
kIDHNewNotificationSelect = 0x000A,
kIDHNotifyMeWhenSelect = 0x000B,
kIDHCancelNotificationSelect = 0x000C,
kIDHDisposeNotificationSelect = 0x000D,
kIDHReleaseBufferSelect = 0x000E,
kIDHCancelPendingIOSelect = 0x000F,
kIDHGetDeviceControlSelect = 0x0010,
kIDHUpdateDeviceListSelect = 0x0011,
kIDHGetDeviceTimeSelect = 0x0012,
kIDHSetFormatSelect = 0x0013,
kIDHGetFormatSelect = 0x0014
};
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef __cplusplus
}
#endif
#endif