-
Notifications
You must be signed in to change notification settings - Fork 651
/
IOVideoDeviceUserClient.h
109 lines (92 loc) · 4.49 KB
/
IOVideoDeviceUserClient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
File: IOVideoDeviceUserClient.h
Contains:
Copyright: © 2006-2012 by Apple Inc., all rights reserved.
*/
#if !defined(__IOKIT_IOVIDEODEVICEUSERCLIENT_H)
#define __IOKIT_IOVIDEODEVICEUSERCLIENT_H
/*!
@enum User client methods
@constant kIOVideoDeviceMethodOpen
@constant kIOVideoDeviceMethodClose
@constant kIOVideoDeviceMethodGetMode
@constant kIOVideoDeviceMethodSetControlValue
@constant kIOVideoDeviceMethodOpenStream
@constant kIOVideoDeviceMethodCloseStream
@constant kIOVideoDeviceMethodSetStreamFormat
@constant kIOVideoDeviceMethodStartStream
@constant kIOVideoDeviceMethodStopStream
@constant kIOVideoDeviceMethodSuspendStream
@abstract Client method numbers used with IOConnectMethod...() functions.
*/
enum
{
kIOVideoDeviceMethodOpen = 0,
kIOVideoDeviceMethodClose,
kIOVideoDeviceMethodGetMode,
kIOVideoDeviceMethodSetMode,
kIOVideoDeviceMethodSetControlValue,
kIOVideoDeviceMethodOpenStream,
kIOVideoDeviceMethodCloseStream,
kIOVideoDeviceMethodSetStreamFormat,
kIOVideoDeviceMethodStartStream,
kIOVideoDeviceMethodStopStream,
kIOVideoDeviceMethodSuspendStream,
kIOVideoDeviceMethodCount
};
#ifdef KERNEL
#ifdef __cplusplus
#include <IOKit/IOUserClient.h>
#include <IOKit/stream/IOStreamShared.h>
#include <IOKit/video/IOVideoTypes.h>
class IOVideoDevice;
class IOVideoDeviceUserClient : public IOUserClient
{
// Construction/Destruction
OSDeclareDefaultStructors(IOVideoDeviceUserClient)
// Static versions of external methods
private:
static IOReturn sOpen(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sClose(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sGetMode(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSetMode(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSetControlValue(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sOpenStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sCloseStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSetStreamFormat(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sStartStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sStopStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
static IOReturn sSuspendStream(IOVideoDeviceUserClient* target, void* reference, IOExternalMethodArguments* arguments);
protected:
const IOExternalMethodDispatch* mExternalMethods;
IOVideoDevice* mDevice;
task_t mTask;
// IOUserClient overriden methods
public:
virtual bool initWithTask(task_t owningTask, void* securityToken, UInt32 type);
virtual bool initWithTask(task_t owningTask, void* securityToken, UInt32 type, OSDictionary* properties);
virtual IOReturn clientClose(void);
virtual IOReturn clientDied(void);
virtual IOService* getService(void);
virtual IOReturn registerNotificationPort(mach_port_t port, UInt32 portType, UInt32 refCon);
virtual IOReturn connectClient(IOUserClient* client);
virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments* arguments, IOExternalMethodDispatch* dispatch, OSObject* target, void* reference);
// IOService overriden methods
virtual bool start(IOService* provider);
// external methods
public:
virtual IOReturn open(IOOptionBits options);
virtual IOReturn close(void);
virtual IOReturn getMode(UInt32 streamIndex, IOStreamMode* mode);
virtual IOReturn setMode(UInt32 streamIndex, IOStreamMode mode);
virtual IOReturn setControlValue(UInt32 controlID, UInt32 value, UInt32* newValue);
virtual IOReturn setStreamFormat(UInt32 streamID, const IOVideoStreamDescription* newStreamFormat);
virtual IOReturn openStream(UInt32 streamIndex);
virtual IOReturn closeStream(UInt32 streamIndex);
virtual IOReturn startStream(UInt32 streamIndex);
virtual IOReturn stopStream(UInt32 streamIndex);
virtual IOReturn suspendStream(UInt32 streamIndex);
};
#endif /* __cplusplus */
#endif /* KERNEL */
#endif