MythTV master
darwinavcinfo.h
Go to the documentation of this file.
1#ifndef _DARWIN_AVC_INFO_H_
2#define _DARWIN_AVC_INFO_H_
3
4#include "libmythbase/mythconfig.h"
5
6#if CONFIG_FIREWIRE_OSX
7
8// C++ headers
9#include <vector>
10
11// OS X headers
12#undef always_inline
13#include <IOKit/IOKitLib.h>
14#include <IOKit/firewire/IOFireWireLib.h>
15#include <IOKit/firewire/IOFireWireLibIsoch.h>
16#include <IOKit/firewire/IOFireWireFamilyCommon.h>
17#include <IOKit/avc/IOFireWireAVCLib.h>
18
19// Qt headers
20#include <QMap>
21
22// MythTV headers
23#include "avcinfo.h"
24
26
27class DarwinAVCInfo : public AVCInfo
28{
29 public:
30 DarwinAVCInfo() = default;
31
32 void Update(uint64_t _guid, DarwinFirewireDevice *dev,
33 IONotificationPortRef notify_port,
34 CFRunLoopRef &thread_cf_ref, io_object_t obj);
35
36 bool OpenPort(CFRunLoopRef &thread_cf_ref);
37 bool ClosePort(void);
38
39 bool OpenAVCInterface(CFRunLoopRef &thread_cf_ref);
40 void CloseAVCInterface(void);
41
42 bool OpenDeviceInterface(CFRunLoopRef &thread_cf_ref);
43 void CloseDeviceInterface(void);
44
45 bool SendAVCCommand(
46 const std::vector<uint8_t> &cmd,
47 std::vector<uint8_t> &result,
48 int retry_cnt) override; // AVCInfo
49
50 bool GetDeviceNodes(int &local_node, int &remote_node);
51
52 bool IsAVCInterfaceOpen(void) const { return avc_handle; }
53 bool IsPortOpen(void) const { return fw_handle; }
54
55 public:
56 io_service_t fw_node_ref {0}; // parent of fw_device_ref
57 io_service_t fw_device_ref {0}; // parent of fw_service_ref
58 io_service_t fw_service_ref {0}; // parent of avc_service_ref
59 io_service_t avc_service_ref {0};
60
61 io_object_t fw_device_notifier_ref {0};
62
63 IOFireWireAVCLibUnitInterface **avc_handle {nullptr};
64 IOFireWireLibDeviceRef fw_handle {nullptr};
65};
66using avcinfo_list_t = QMap<uint64_t,DarwinAVCInfo*>;
67
68#endif // CONFIG_FIREWIRE_OSX
69
70#endif // _DARWIN_AVC_INFO_H_
virtual bool SendAVCCommand(const std::vector< uint8_t > &, std::vector< uint8_t > &, int)
Definition: avcinfo.h:30