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 *callback_data);
14  uint64_t guid, void *item);
15  friend int dfd_no_data_notification(void *callback_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* /*listener*/) override; // FirewireDevice
34  void RemoveListener(TSDataListener* /*listener*/) 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_
DFDPriv
Definition: darwinfirewiredevice.cpp:74
DarwinFirewireDevice::OpenAVStream
bool OpenAVStream(void)
Definition: darwinfirewiredevice.cpp:324
DarwinFirewireDevice::StopController
void StopController(void)
Definition: darwinfirewiredevice.cpp:193
DarwinFirewireDevice::ResetBus
bool ResetBus(void) override
Definition: darwinfirewiredevice.cpp:439
DarwinFirewireDevice::UpdatePlugRegisterPrivate
bool UpdatePlugRegisterPrivate(uint plug_number, int fw_chan, int new_speed, bool add_plug, bool remove_plug)
Definition: darwinfirewiredevice.cpp:697
DarwinFirewireDevice::BroadcastToListeners
void BroadcastToListeners(const unsigned char *data, uint dataSize) override
Definition: darwinfirewiredevice.cpp:542
DarwinFirewireDevice::ProcessNoDataMessage
void ProcessNoDataMessage(void)
Definition: darwinfirewiredevice.cpp:549
DarwinFirewireDevice::GetSTBList
static vector< AVCInfo > GetSTBList(void)
Definition: darwinfirewiredevice.cpp:609
DarwinFirewireDevice::IsPortOpen
bool IsPortOpen(void) const override
Definition: darwinfirewiredevice.cpp:509
DarwinFirewireDevice::GetInfoPtr
DarwinAVCInfo * GetInfoPtr(void)
Definition: darwinfirewiredevice.cpp:684
DarwinFirewireDevice::GetMaxSpeed
int GetMaxSpeed(void)
Definition: darwinfirewiredevice.cpp:365
DarwinFirewireDevice::StartStreaming
bool StartStreaming(void)
Definition: darwinfirewiredevice.cpp:457
DarwinFirewireDevice::m_priv
DFDPriv * m_priv
Definition: darwinfirewiredevice.h:87
DarwinFirewireDevice::dfd_no_data_notification
friend int dfd_no_data_notification(void *callback_data)
Definition: darwinfirewiredevice.cpp:906
DarwinFirewireDevice
Definition: darwinfirewiredevice.h:10
firewiredevice.h
TSDataListener
Definition: streamlisteners.h:52
DarwinFirewireDevice::HandleBusReset
void HandleBusReset(void)
Definition: darwinfirewiredevice.cpp:771
DarwinFirewireDevice::StopStreaming
bool StopStreaming(void)
Definition: darwinfirewiredevice.cpp:482
DarwinFirewireDevice::UpdateDeviceListItem
void UpdateDeviceListItem(uint64_t guid, void *item)
Definition: darwinfirewiredevice.cpp:657
DarwinFirewireDevice::dfd_stream_msg
friend void dfd_stream_msg(UInt32 msg, UInt32 param1, UInt32 param2, void *callback_data)
Definition: darwinfirewiredevice.cpp:914
DarwinFirewireDevice::m_remote_node
int m_remote_node
Definition: darwinfirewiredevice.h:86
DarwinFirewireDevice::IsSTBStreaming
bool IsSTBStreaming(uint *fw_channel=nullptr)
Definition: darwinfirewiredevice.cpp:395
DarwinFirewireDevice::DarwinFirewireDevice
DarwinFirewireDevice(uint64_t guid, uint subunitid, uint speed)
Definition: darwinfirewiredevice.cpp:118
DarwinFirewireDevice::RemoveListener
void RemoveListener(TSDataListener *) override
Definition: darwinfirewiredevice.cpp:529
DarwinFirewireDevice::AddListener
void AddListener(TSDataListener *) override
Definition: darwinfirewiredevice.cpp:519
DarwinFirewireDevice::HandleDeviceChange
void HandleDeviceChange(uint messageType)
Definition: darwinfirewiredevice.cpp:812
DarwinFirewireDevice::StartController
void StartController(void)
Definition: darwinfirewiredevice.cpp:177
DarwinFirewireDevice::dfd_update_device_list_item
friend void dfd_update_device_list_item(DarwinFirewireDevice *dev, uint64_t guid, void *item)
Definition: darwinfirewiredevice.cpp:900
uint
unsigned int uint
Definition: compat.h:140
DarwinFirewireDevice::ClosePort
bool ClosePort(void) override
Definition: darwinfirewiredevice.cpp:296
DarwinFirewireDevice::~DarwinFirewireDevice
~DarwinFirewireDevice()
Definition: darwinfirewiredevice.cpp:125
DarwinFirewireDevice::GetSTBListPrivate
vector< AVCInfo > GetSTBListPrivate(void)
Definition: darwinfirewiredevice.cpp:630
DarwinFirewireDevice::SendAVCCommand
bool SendAVCCommand(const vector< uint8_t > &cmd, vector< uint8_t > &result, int) override
Definition: darwinfirewiredevice.cpp:502
DarwinFirewireDevice::dfd_tspacket_handler
friend int dfd_tspacket_handler(uint tsPacketCount, uint32_t **ppBuf, void *callback_data)
Definition: darwinfirewiredevice.cpp:921
DarwinFirewireDevice::OpenPort
bool OpenPort(void) override
Definition: darwinfirewiredevice.cpp:226
DarwinFirewireDevice::operator=
DarwinFirewireDevice & operator=(const DarwinFirewireDevice &)=delete
DarwinFirewireDevice::dfd_controller_thunk
friend void * dfd_controller_thunk(void *callback_data)
Definition: darwinfirewiredevice.cpp:892
DarwinFirewireDevice::CloseAVStream
bool CloseAVStream(void)
Definition: darwinfirewiredevice.cpp:420
DarwinFirewireDevice::m_local_node
int m_local_node
Definition: darwinfirewiredevice.h:85
DarwinFirewireDevice::UpdatePlugRegister
bool UpdatePlugRegister(uint plug_number, int fw_chan, int speed, bool add_plug, bool remove_plug, uint retry_cnt=4)
Definition: darwinfirewiredevice.cpp:792
DarwinAVCInfo
Definition: darwinavcinfo.h:26
DarwinFirewireDevice::IsAVStreamOpen
bool IsAVStreamOpen(void) const
Definition: darwinfirewiredevice.cpp:434
FirewireDevice
Definition: firewiredevice.h:24
DarwinFirewireDevice::ProcessStreamingMessage
void ProcessStreamingMessage(uint32_t msg, uint32_t param1, uint32_t param2)
Definition: darwinfirewiredevice.cpp:571
DarwinFirewireDevice::RunController
void RunController(void)
Definition: darwinfirewiredevice.cpp:141