AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
devicenotifier.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
9 #include <syslog.h>
10 #include <sstream>
11 #include <iostream>
12 #include <iomanip>
13 #include <IOKit/IOCFPlugIn.h>
15 #include "devicenotifier.h"
16 #include "ajabase/common/common.h"
17 #include "ajabase/system/debug.h"
18 
19 
20 using namespace std;
21 
22 static const char * GetKernErrStr (const kern_return_t inError);
23 
24 
25 // DeviceNotifier-specific Logging Macros
26 
27 #define HEX2(__x__) "0x" << hex << setw(2) << setfill('0') << (0x00FF & uint16_t(__x__)) << dec
28 #define HEX4(__x__) "0x" << hex << setw(4) << setfill('0') << (0xFFFF & uint16_t(__x__)) << dec
29 #define HEX8(__x__) "0x" << hex << setw(8) << setfill('0') << (0xFFFFFFFF & uint32_t(__x__)) << dec
30 #define HEX16(__x__) "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec
31 #define KR(_kr_) "kernErr=" << HEX8(_kr_) << "(" << ::GetKernErrStr(_kr_) << ")"
32 #define INST(__p__) "Ins-" << hex << setw(16) << setfill('0') << uint64_t(__p__) << dec
33 #define THRD(__t__) "Thr-" << hex << setw(16) << setfill('0') << uint64_t(__t__) << dec
34 
35 #define DNDB(__lvl__, __x__) AJA_sREPORT(AJA_DebugUnit_PnP, (__lvl__), INST(this) << ": " << AJAFUNC << ": " << __x__)
36 #define DNFAIL(__x__) DNDB(AJA_DebugSeverity_Error, __x__)
37 #define DNWARN(__x__) DNDB(AJA_DebugSeverity_Warning, __x__)
38 #define DNNOTE(__x__) DNDB(AJA_DebugSeverity_Notice, __x__)
39 #define DNINFO(__x__) DNDB(AJA_DebugSeverity_Info, __x__)
40 #define DNDBG(__x__) DNDB(AJA_DebugSeverity_Debug, __x__)
41 
42 
43 // MARK: DeviceNotifier
44 
45 //-------------------------------------------------------------------------------------------------------------
46 // DeviceNotifier
47 //-------------------------------------------------------------------------------------------------------------
49  : m_refcon (refcon),
50  m_clientCallback (callback),
51  m_masterPort (0),
52  m_notificationPort (NULL),
53  m_matchingDictionary (NULL)
54 {
55 }
56 
57 
58 //-------------------------------------------------------------------------------------------------------------
59 // ~DeviceNotifier
60 //-------------------------------------------------------------------------------------------------------------
62 {
63  // disable callbacks
64  Uninstall ();
65 
66  m_masterPort = 0;
68  m_refcon = NULL;
69 }
70 
71 
72 //-------------------------------------------------------------------------------------------------------------
73 // SetCallback
74 //-------------------------------------------------------------------------------------------------------------
76 {
77  m_clientCallback = callback;
78  m_refcon = refcon;
79 }
80 
81 
82 //-------------------------------------------------------------------------------------------------------------
83 // Install
84 //-------------------------------------------------------------------------------------------------------------
85 
86 bool DeviceNotifier::Install (CFMutableDictionaryRef matchingDictionary)
87 {
88  DNDBG("On entry: deviceInterestList.size=" << m_deviceInterestList.size() << ", deviceMatchList.size=" << m_deviceMatchList.size());
89 
90  m_matchingDictionary = matchingDictionary;
91 
92  // if no dictionary given use default
95  else
96  ::CFRetain (m_matchingDictionary); // if dictionary was passed in retain it
97 
98  // check for NULL dictionary
100  {
101  DNFAIL("NULL matchingDictionary");
102  return false;
103  }
104 
105  // Retrieve the IOKit's master port so a notification port can be created
106  mach_port_t masterPort;
107  IOReturn ioReturn = ::IOMasterPort (MACH_PORT_NULL, &masterPort);
108  if (kIOReturnSuccess != ioReturn)
109  {
110  DNFAIL(KR(ioReturn) << " -- IOMasterPort failed");
111  return false;
112  }
113 
114  m_masterPort = masterPort;
115  m_notificationPort = ::IONotificationPortCreate (masterPort);
116  if (0 == m_notificationPort)
117  {
118  DNFAIL("IONotificationPortCreate failed");
119  return false;
120  }
121 
122  // Get the CFRunLoopSource for the notification port and add it to the default run loop.
123  // It is not necessary to call CFRunLoopRemoveSource() duringing tear down because that is implicitly done when
124  // the the notification port is destroyed.
125  CFRunLoopSourceRef runLoopSource = ::IONotificationPortGetRunLoopSource (m_notificationPort);
126  CFRunLoopAddSource (CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode);
127 
128  // IOServiceAddMatchingNotification 'eats' a matching dictionary, so up the retention count
129  CFRetain(m_matchingDictionary);
130 
131  // lets create a callback
132  io_iterator_t iterator;
133  ioReturn = IOServiceAddMatchingNotification(m_notificationPort,
134  kIOMatchedNotification,
136  reinterpret_cast<IOServiceMatchingCallback>(DeviceAddedCallback),
137  this,
138  &iterator);
139  if (kIOReturnSuccess != ioReturn)
140  {
141  DNFAIL(KR(ioReturn) << " -- IOServiceAddMatchingNotification failed");
142  return false;
143  }
144 
145  DeviceAddedCallback (this, iterator);
146  m_deviceMatchList.push_back(iterator);
147 
148  DNINFO("On exit: callback installed, deviceInterestList.size=" << m_deviceInterestList.size() << ", deviceMatchList.size=" << m_deviceMatchList.size());
149  return (m_deviceInterestList.size() > 0);
150 }
151 
152 
153 //--------------------------------------------------------------------------------------------------------------------
154 // Uninstall
155 //--------------------------------------------------------------------------------------------------------------------
157 {
158  DNDBG("On entry: m_deviceInterestList.size()=" << m_deviceInterestList.size()
159  << ", m_deviceMatchList.size()=" << m_deviceMatchList.size());
160  // Release device-matching list...
161  list<io_object_t>::iterator p;
162  for (p = m_deviceMatchList.begin(); p != m_deviceMatchList.end(); ++p)
163  IOObjectRelease (*p);
164  m_deviceMatchList.clear();
165 
166  // Release device-interest list...
167  for (p = m_deviceInterestList.begin(); p != m_deviceInterestList.end(); ++p)
168  IOObjectRelease (*p);
169  m_deviceInterestList.clear();
170 
171  if (m_notificationPort)
172  {
173  CFRunLoopSourceRef runLoopSource = IONotificationPortGetRunLoopSource (m_notificationPort);
174  CFRunLoopRemoveSource (CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode);
175  IONotificationPortDestroy (m_notificationPort);
176  m_notificationPort = 0;
177  }
178 
180  {
181  CFRelease (m_matchingDictionary);
183  }
184  DNINFO("On exit: callback removed, m_deviceInterestList.size()=" << m_deviceInterestList.size() << ", m_deviceMatchList.size()=" << m_deviceMatchList.size());
185 }
186 
187 
188 //--------------------------------------------------------------------------------------------------------------------
189 // CreateMatchingDictionary
190 // This high level callbacks only when a specific driver is loaded, goes offline
191 //--------------------------------------------------------------------------------------------------------------------
192 CFMutableDictionaryRef DeviceNotifier::CreateMatchingDictionary (CFStringRef deviceDriverName)
193 {
194  // This high level callbacks only when driver is loaded, goes offline
195  CFMutableDictionaryRef matchingDictionary = CFDictionaryCreateMutable ( kCFAllocatorDefault,
196  0,
197  &kCFTypeDictionaryKeyCallBacks,
198  &kCFTypeDictionaryValueCallBacks);
199  // Specify class type
200  CFDictionaryAddValue (matchingDictionary, CFSTR("IOProviderClass"), deviceDriverName);
201  return matchingDictionary;
202 }
203 
204 
205 // MARK: Callbacks
206 
207 
208 //--------------------------------------------------------------------------------------------------------------------
209 // DeviceAddedCallback
210 // matching AJA IOService found
211 //--------------------------------------------------------------------------------------------------------------------
212 void DeviceNotifier::DeviceAddedCallback (DeviceNotifier* thisObject, io_iterator_t iterator)
213 {
214  thisObject->DeviceAdded (iterator);
215 }
216 
217 
218 //--------------------------------------------------------------------------------------------------------------------
219 // DeviceAdded
220 //--------------------------------------------------------------------------------------------------------------------
221 void DeviceNotifier::DeviceAdded (io_iterator_t iterator)
222 {
223  io_object_t service;
224  bool deviceFound = false;
225 
226  // This iteration is essential to keep this callback working...
227  IOIteratorReset(iterator);
228  for ( ;(service = IOIteratorNext(iterator)); IOObjectRelease(service))
229  {
230  AddGeneralInterest(service); // optional
231  deviceFound = true;
232  }
233 
234  // now notify our callback
235  DNINFO("Device added, calling DeviceClientCallback " << INST(m_clientCallback));
236  if (deviceFound && m_clientCallback)
238 }
239 
240 
241 //--------------------------------------------------------------------------------------------------------------------
242 // DeviceRemovedCallback
243 // matching AJA IOService has been removed
244 //--------------------------------------------------------------------------------------------------------------------
245 void DeviceNotifier::DeviceRemovedCallback (DeviceNotifier* thisObject, io_iterator_t iterator)
246 {
247  thisObject->DeviceRemoved (iterator);
248 }
249 
250 
251 //--------------------------------------------------------------------------------------------------------------------
252 // DeviceRemoved
253 //--------------------------------------------------------------------------------------------------------------------
254 void DeviceNotifier::DeviceRemoved (io_iterator_t iterator)
255 {
256  io_object_t service;
257  bool deviceFound = false;
258 
259  // This iteration is essential to keep this callback working...
260  IOIteratorReset(iterator);
261  for ( ;(service = IOIteratorNext(iterator)); IOObjectRelease(service))
262  deviceFound = true;
263 
264  // now notify our callback
265  DNINFO("Device removed, calling DeviceClientCallback " << INST(m_clientCallback));
266  if (deviceFound && m_clientCallback)
268 }
269 
270 
271 //--------------------------------------------------------------------------------------------------------------------
272 // AddGeneralInterest
273 // add general interest callback, return true if iterator has one or more items
274 //--------------------------------------------------------------------------------------------------------------------
275 void DeviceNotifier::AddGeneralInterest (io_object_t service)
276 {
277  io_object_t notifier;
278 
279  // Create a notifier object so 'general interest' notifications can be received for the service.
280  // In Kona this is used for debugging only
281  IOReturn ioReturn = ::IOServiceAddInterestNotification (m_notificationPort,
282  service,
283  kIOGeneralInterest,
284  reinterpret_cast <IOServiceInterestCallback> (DeviceChangedCallback),
285  this,
286  &notifier);
287  if (kIOReturnSuccess != ioReturn)
288  {
289  DNFAIL(KR(ioReturn) << " -- IOServiceAddInterestNotification failed");
290  return;
291  }
292  m_deviceInterestList.push_back (notifier);
293 }
294 
295 
296 //--------------------------------------------------------------------------------------------------------------------
297 // DeviceChangedCallback()
298 // notifier messages sent by the driver
299 //--------------------------------------------------------------------------------------------------------------------
300 void DeviceNotifier::DeviceChangedCallback (DeviceNotifier* thisObject, io_service_t unitService, natural_t messageType, void* message)
301 {
302  thisObject->DeviceChanged (unitService, messageType, message);
303 }
304 
305 
306 //--------------------------------------------------------------------------------------------------------------------
307 // DeviceChanged()
308 //--------------------------------------------------------------------------------------------------------------------
309 void DeviceNotifier::DeviceChanged (io_service_t unitService, natural_t messageType, void* message)
310 {
311  (void) unitService;
312  (void) message;
313  DNINFO(MessageTypeToStr(messageType) << ", calling DeviceClientCallback " << INST(m_clientCallback));
314  if (m_clientCallback)
315  (*(m_clientCallback))(messageType, m_refcon); // notify client
316 }
317 
318 
319 
320 //--------------------------------------------------------------------------------------------------------------------
321 // MessageTypeToStr()
322 // decode message type
323 //--------------------------------------------------------------------------------------------------------------------
324 string DeviceNotifier::MessageTypeToStr (const natural_t messageType)
325 {
326  ostringstream oss;
327  switch (messageType)
328  {
329  case kIOMessageServiceIsTerminated: oss << "kIOMessageServiceIsTerminated"; break;
330  case kIOMessageServiceIsSuspended: oss << "kIOMessageServiceIsSuspended"; break;
331  case kIOMessageServiceIsResumed: oss << "kIOMessageServiceIsResumed"; break;
332  case kIOMessageServiceIsRequestingClose: oss << "kIOMessageServiceIsRequestingClose"; break;
333  // the more esoteric messages:
334  case kIOMessageServiceIsAttemptingOpen: oss << "kIOMessageServiceIsAttemptingOpen"; break; // When another process connects to our device
335  case kIOMessageServiceWasClosed: oss << "kIOMessageServiceWasClosed"; break; // When another process disconnects from our device
336  case kIOMessageServiceBusyStateChange: oss << "kIOMessageServiceBusyStateChange"; break;
337  case kIOMessageCanDevicePowerOff: oss << "kIOMessageCanDevicePowerOff"; break;
338  case kIOMessageDeviceWillPowerOff: oss << "kIOMessageDeviceWillPowerOff"; break;
339  case kIOMessageDeviceWillNotPowerOff: oss << "kIOMessageDeviceWillPowerOff"; break;
340  case kIOMessageDeviceHasPoweredOn: oss << "kIOMessageDeviceHasPoweredOn"; break;
341  case kIOMessageCanSystemPowerOff: oss << "kIOMessageCanSystemPowerOff"; break;
342  case kIOMessageSystemWillPowerOff: oss << "kIOMessageSystemWillPowerOff"; break;
343  case kIOMessageSystemWillNotPowerOff: oss << "kIOMessageSystemWillNotPowerOff"; break;
344  case kIOMessageCanSystemSleep: oss << "kIOMessageCanSystemSleep"; break;
345  case kIOMessageSystemWillSleep: oss << "kIOMessageSystemWillSleep"; break;
346  case kIOMessageSystemWillNotSleep: oss << "kIOMessageSystemWillNotSleep"; break;
347  case kIOMessageSystemHasPoweredOn: oss << "kIOMessageSystemHasPoweredOn"; break;
348  default: oss << "msgType=0x" << hex << setw(4) << setfill('0') << messageType; break;
349  }
350  return oss.str();
351 }
352 
353 // MARK: KonaNotifier
354 
355 
356 bool KonaNotifier::Install (CFMutableDictionaryRef matchingDictionary)
357 {
358  (void) matchingDictionary;
359  DNDBG("On entry: deviceInterestList.size=" << m_deviceInterestList.size() << ", deviceMatchList.size=" << m_deviceMatchList.size());
360 
361  // Retrieve the IOKit's master port so a notification port can be created
362  mach_port_t masterPort;
363  IOReturn ioReturn = ::IOMasterPort (MACH_PORT_NULL, &masterPort);
364  if (kIOReturnSuccess != ioReturn)
365  {
366  DNFAIL(KR(ioReturn) << " -- IOMasterPort failed");
367  return false;
368  }
369 
370  m_masterPort = masterPort;
371  m_notificationPort = ::IONotificationPortCreate (masterPort);
372  if (0 == m_notificationPort)
373  {
374  DNFAIL("IONotificationPortCreate failed");
375  return false;
376  }
377 
378  // Get the CFRunLoopSource for the notification port and add it to the default run loop.
379  // It is not necessary to call CFRunLoopRemoveSource() during tear down because that is
380  // implicitly done when the the notification port is destroyed.
381  CFRunLoopSourceRef runLoopSource = ::IONotificationPortGetRunLoopSource (m_notificationPort);
382  ::CFRunLoopAddSource (::CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode);
383 
384 
385  // walk through each of our devices
386  static const std::string driverName ("com_aja_iokit_ntv2");
387  io_iterator_t notifyIterator_matched, notifyIterator_terminated;
388 
389  // Device Added
390  ioReturn = ::IOServiceAddMatchingNotification ( m_notificationPort,
391  kIOMatchedNotification,
392  IOServiceMatching(driverName.c_str ()),
393  reinterpret_cast<IOServiceMatchingCallback>(DeviceAddedCallback),
394  this,
395  &notifyIterator_matched);
396 
397  if (ioReturn != kIOReturnSuccess)
398  {
399  DNFAIL(KR(ioReturn) << " -- IOServiceAddMatchingNotification for 'kIOMatchedNotification' failed");
400  return false;
401  }
402 
403  // Device Terminated
404  ioReturn = ::IOServiceAddMatchingNotification ( m_notificationPort,
405  kIOTerminatedNotification,
406  IOServiceMatching(driverName.c_str ()),
407  reinterpret_cast<IOServiceMatchingCallback>(DeviceRemovedCallback),
408  this,
409  &notifyIterator_terminated);
410  if (ioReturn != kIOReturnSuccess)
411  {
412  DNFAIL(KR(ioReturn) << " -- IOServiceAddMatchingNotification for 'kIOTerminatedNotification' failed");
413  return false;
414  }
415 
416  DeviceAddedCallback (this, notifyIterator_matched);
417  m_deviceMatchList.push_back (notifyIterator_matched);
418 
419  DeviceRemovedCallback (this, notifyIterator_terminated);
420  m_deviceMatchList.push_back (notifyIterator_terminated);
421 
422  DNINFO("On exit: callback installed, deviceInterestList.size=" << m_deviceInterestList.size() << ", deviceMatchList.size=" << m_deviceMatchList.size());
423  return m_deviceInterestList.size() > 0; // **MrBill** SHOULDN'T THIS RETURN m_deviceMatchList.size() > 0 ????
424 
425 } // KonaNotifier::Install
426 
427 
428 static const char * GetKernErrStr (const kern_return_t inError)
429 {
430  switch (inError)
431  {
432  case kIOReturnError: return "kIOReturnError";
433  case kIOReturnNoMemory: return "kIOReturnNoMemory";
434  case kIOReturnNoResources: return "kIOReturnNoResources";
435  case kIOReturnIPCError: return "kIOReturnIPCError";
436  case kIOReturnNoDevice: return "kIOReturnNoDevice";
437  case kIOReturnNotPrivileged: return "kIOReturnNotPrivileged";
438  case kIOReturnBadArgument: return "kIOReturnBadArgument";
439  case kIOReturnLockedRead: return "kIOReturnLockedRead";
440  case kIOReturnLockedWrite: return "kIOReturnLockedWrite";
441  case kIOReturnExclusiveAccess: return "kIOReturnExclusiveAccess";
442  case kIOReturnBadMessageID: return "kIOReturnBadMessageID";
443  case kIOReturnUnsupported: return "kIOReturnUnsupported";
444  case kIOReturnVMError: return "kIOReturnVMError";
445  case kIOReturnInternalError: return "kIOReturnInternalError";
446  case kIOReturnIOError: return "kIOReturnIOError";
447  case kIOReturnCannotLock: return "kIOReturnCannotLock";
448  case kIOReturnNotOpen: return "kIOReturnNotOpen";
449  case kIOReturnNotReadable: return "kIOReturnNotReadable";
450  case kIOReturnNotWritable: return "kIOReturnNotWritable";
451  case kIOReturnNotAligned: return "kIOReturnNotAligned";
452  case kIOReturnBadMedia: return "kIOReturnBadMedia";
453  case kIOReturnStillOpen: return "kIOReturnStillOpen";
454  case kIOReturnRLDError: return "kIOReturnRLDError";
455  case kIOReturnDMAError: return "kIOReturnDMAError";
456  case kIOReturnBusy: return "kIOReturnBusy";
457  case kIOReturnTimeout: return "kIOReturnTimeout";
458  case kIOReturnOffline: return "kIOReturnOffline";
459  case kIOReturnNotReady: return "kIOReturnNotReady";
460  case kIOReturnNotAttached: return "kIOReturnNotAttached";
461  case kIOReturnNoChannels: return "kIOReturnNoChannels";
462  case kIOReturnNoSpace: return "kIOReturnNoSpace";
463  case kIOReturnPortExists: return "kIOReturnPortExists";
464  case kIOReturnCannotWire: return "kIOReturnCannotWire";
465  case kIOReturnNoInterrupt: return "kIOReturnNoInterrupt";
466  case kIOReturnNoFrames: return "kIOReturnNoFrames";
467  case kIOReturnMessageTooLarge: return "kIOReturnMessageTooLarge";
468  case kIOReturnNotPermitted: return "kIOReturnNotPermitted";
469  case kIOReturnNoPower: return "kIOReturnNoPower";
470  case kIOReturnNoMedia: return "kIOReturnNoMedia";
471  case kIOReturnUnformattedMedia: return "kIOReturnUnformattedMedia";
472  case kIOReturnUnsupportedMode: return "kIOReturnUnsupportedMode";
473  case kIOReturnUnderrun: return "kIOReturnUnderrun";
474  case kIOReturnOverrun: return "kIOReturnOverrun";
475  case kIOReturnDeviceError: return "kIOReturnDeviceError";
476  case kIOReturnNoCompletion: return "kIOReturnNoCompletion";
477  case kIOReturnAborted: return "kIOReturnAborted";
478  case kIOReturnNoBandwidth: return "kIOReturnNoBandwidth";
479  case kIOReturnNotResponding: return "kIOReturnNotResponding";
480  case kIOReturnIsoTooOld: return "kIOReturnIsoTooOld";
481  case kIOReturnIsoTooNew: return "kIOReturnIsoTooNew";
482  case kIOReturnNotFound: return "kIOReturnNotFound";
483  default: break;
484  }
485  return "";
486 } // GetKernErrStr
DeviceNotifier::m_refcon
void * m_refcon
Definition: devicenotifier.h:73
DeviceNotifier::m_deviceMatchList
std::list< io_object_t > m_deviceMatchList
Definition: devicenotifier.h:78
NULL
#define NULL
Definition: ntv2caption608types.h:19
GetKernErrStr
static const char * GetKernErrStr(const kern_return_t inError)
Definition: devicenotifier.cpp:428
DeviceNotifier::DeviceRemoved
virtual void DeviceRemoved(io_iterator_t iterator)
Definition: devicenotifier.cpp:254
DeviceNotifier::m_masterPort
mach_port_t m_masterPort
Definition: devicenotifier.h:75
kAJADeviceInitialOpen
#define kAJADeviceInitialOpen
Definition: devicenotifier.h:20
ajatypes.h
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
devicenotifier.h
Declares the MacOS-specific KonaNotifier and DeviceNotifier classes, which invoke a client-registered...
DeviceNotifier::Install
virtual bool Install(CFMutableDictionaryRef dict=NULL)
Definition: devicenotifier.cpp:86
KonaNotifier::Install
virtual bool Install(CFMutableDictionaryRef dict=NULL)
Definition: devicenotifier.cpp:356
DeviceNotifier::SetCallback
virtual void SetCallback(DeviceClientCallback callback, void *refcon)
Definition: devicenotifier.cpp:75
DNDBG
#define DNDBG(__x__)
Definition: devicenotifier.cpp:40
DeviceNotifier::DeviceAddedCallback
static void DeviceAddedCallback(DeviceNotifier *thisObject, io_iterator_t iterator)
Definition: devicenotifier.cpp:212
DeviceClientCallback
void(* DeviceClientCallback)(unsigned long message, void *refcon)
Mac-specific device add/change/remove event notification callback function.
Definition: devicenotifier.h:27
DeviceNotifier::DeviceAdded
virtual void DeviceAdded(io_iterator_t iterator)
Definition: devicenotifier.cpp:221
KR
#define KR(_kr_)
Definition: devicenotifier.cpp:31
DeviceNotifier::MessageTypeToStr
static std::string MessageTypeToStr(const natural_t messageType)
Definition: devicenotifier.cpp:324
DeviceNotifier::m_deviceInterestList
std::list< io_object_t > m_deviceInterestList
Definition: devicenotifier.h:79
kAJADeviceTerminate
#define kAJADeviceTerminate
Definition: devicenotifier.h:21
DeviceNotifier::Uninstall
virtual void Uninstall()
Definition: devicenotifier.cpp:156
DeviceNotifier::~DeviceNotifier
virtual ~DeviceNotifier()
Definition: devicenotifier.cpp:61
INST
#define INST(__p__)
Definition: devicenotifier.cpp:32
DeviceNotifier::m_matchingDictionary
CFMutableDictionaryRef m_matchingDictionary
Definition: devicenotifier.h:77
DeviceNotifier::DeviceRemovedCallback
static void DeviceRemovedCallback(DeviceNotifier *thisObject, io_iterator_t iterator)
Definition: devicenotifier.cpp:245
DeviceNotifier::AddGeneralInterest
virtual void AddGeneralInterest(io_object_t service)
Definition: devicenotifier.cpp:275
DeviceNotifier::DeviceChanged
virtual void DeviceChanged(io_service_t unitService, natural_t messageType, void *message)
Definition: devicenotifier.cpp:309
DeviceNotifier::m_notificationPort
IONotificationPortRef m_notificationPort
Definition: devicenotifier.h:76
common.h
Private include file for all ajabase sources.
DeviceNotifier::DeviceChangedCallback
static void DeviceChangedCallback(DeviceNotifier *thisObject, io_service_t unitService, natural_t messageType, void *message)
Definition: devicenotifier.cpp:300
DeviceNotifier::m_clientCallback
DeviceClientCallback m_clientCallback
Definition: devicenotifier.h:74
DNINFO
#define DNINFO(__x__)
Definition: devicenotifier.cpp:39
DeviceNotifier::CreateMatchingDictionary
virtual CFMutableDictionaryRef CreateMatchingDictionary()
Definition: devicenotifier.h:48
DeviceNotifier
Mac-specific class that notifies clients when AJA devices are attached/detached, etc.
Definition: devicenotifier.h:33
DeviceNotifier::DeviceNotifier
DeviceNotifier(DeviceClientCallback callback, void *refcon)
Definition: devicenotifier.cpp:48
debug.h
Declares the AJADebug class.
DNFAIL
#define DNFAIL(__x__)
Definition: devicenotifier.cpp:36