MythTV  master
darwinfirewiredevice.h
Go to the documentation of this file.
1 #ifndef _DARWIN_FIREWIRE_DEVICE_H_
2 #define _DARWIN_FIREWIRE_DEVICE_H_
3 
4 #include "firewiredevice.h"
5 #include <IOKit/IOKitLib.h>
6 
7 class DFDPriv;
8 class DarwinAVCInfo;
9 
11 {
12  friend void *dfd_controller_thunk(void *param);
14  uint64_t guid, void *item);
15  friend int dfd_no_data_notification(void *cb_data);
16  friend void dfd_stream_msg(
17  UInt32 msg, UInt32 param1,
18  UInt32 param2, void *callback_data);
19  friend int dfd_tspacket_handler(
20  uint tsPacketCount, uint32_t **ppBuf, void *callback_data);
21 
22 
23  public:
24  DarwinFirewireDevice(uint64_t guid, uint subunitid, uint speed);
26 
27  bool OpenPort(void) override; // FirewireDevice
28  bool ClosePort(void) override; // FirewireDevice
29  bool ResetBus(void) override; // FirewireDevice
30 
31  void HandleDeviceChange(uint messageType);
32 
33  void AddListener(TSDataListener*) override; // FirewireDevice
34  void RemoveListener(TSDataListener*) override; // FirewireDevice
35 
36  // Gets
37  bool IsPortOpen(void) const override; // FirewireDevice
38 
39  // Statics
40  static vector<AVCInfo> GetSTBList(void);
41 
42  private:
43  DarwinFirewireDevice(const DarwinFirewireDevice &) = delete; // not copyable
44  DarwinFirewireDevice &operator=(const DarwinFirewireDevice &) = delete; // not copyable
45 
46  void StartController(void);
47  void StopController(void);
48 
49  bool OpenAVStream(void);
50  bool CloseAVStream(void);
51  bool IsAVStreamOpen(void) const;
52 
53  bool StartStreaming(void);
54  bool StopStreaming(void);
55 
56  bool SendAVCCommand(
57  const vector<uint8_t> &cmd,
58  vector<uint8_t> &result,
59  int /*retry_cnt*/) override; // FirewireDevice
60 
61  void HandleBusReset(void);
63  uint plug_number, int fw_chan, int new_speed,
64  bool add_plug, bool remove_plug);
65  bool UpdatePlugRegister(
66  uint plug_number, int fw_chan, int speed,
67  bool add_plug, bool remove_plug, uint retry_cnt = 4);
68 
69  void RunController(void);
70  void BroadcastToListeners(const unsigned char *data, uint dataSize) override; // FirewireDevice
71  void UpdateDeviceListItem(uint64_t guid, void *item);
72  void ProcessNoDataMessage(void);
74  uint32_t msg, uint32_t param1, uint32_t param2);
75 
77  const DarwinAVCInfo *GetInfoPtr(void) const;
78 
79  int GetMaxSpeed(void);
80  bool IsSTBStreaming(uint *fw_channel = nullptr);
81 
82  vector<AVCInfo> GetSTBListPrivate(void);
83 
84  private:
85  int m_local_node {-1};
86  int m_remote_node {-1};
87  DFDPriv *m_priv {nullptr};
88 };
89 
90 #endif // _DARWIN_FIREWIRE_DEVICE_H_
DarwinFirewireDevice & operator=(const DarwinFirewireDevice &)=delete
bool ClosePort(void) override
bool IsAVStreamOpen(void) const
bool UpdatePlugRegisterPrivate(uint plug_number, int fw_chan, int new_speed, bool add_plug, bool remove_plug)
vector< AVCInfo > GetSTBListPrivate(void)
friend void * dfd_controller_thunk(void *param)
friend void dfd_stream_msg(UInt32 msg, UInt32 param1, UInt32 param2, void *callback_data)
unsigned int uint
Definition: compat.h:140
void HandleDeviceChange(uint messageType)
void AddListener(TSDataListener *) override
bool IsSTBStreaming(uint *fw_channel=nullptr)
bool ResetBus(void) override
DarwinAVCInfo * GetInfoPtr(void)
friend int dfd_no_data_notification(void *cb_data)
bool UpdatePlugRegister(uint plug_number, int fw_chan, int speed, bool add_plug, bool remove_plug, uint retry_cnt=4)
bool SendAVCCommand(const vector< uint8_t > &cmd, vector< uint8_t > &result, int) override
bool OpenPort(void) override
void ProcessStreamingMessage(uint32_t msg, uint32_t param1, uint32_t param2)
void UpdateDeviceListItem(uint64_t guid, void *item)
static vector< AVCInfo > GetSTBList(void)
void RemoveListener(TSDataListener *) override
bool IsPortOpen(void) const override
void BroadcastToListeners(const unsigned char *data, uint dataSize) override
friend int dfd_tspacket_handler(uint tsPacketCount, uint32_t **ppBuf, void *callback_data)
DarwinFirewireDevice(uint64_t guid, uint subunitid, uint speed)
friend void dfd_update_device_list_item(DarwinFirewireDevice *dev, uint64_t guid, void *item)