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 std::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 std::vector<uint8_t> &cmd,
58  std::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  std::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:323
DarwinFirewireDevice::StopController
void StopController(void)
Definition: darwinfirewiredevice.cpp:192
DarwinFirewireDevice::ResetBus
bool ResetBus(void) override
Definition: darwinfirewiredevice.cpp:438
DarwinFirewireDevice::UpdatePlugRegisterPrivate
bool UpdatePlugRegisterPrivate(uint plug_number, int fw_chan, int new_speed, bool add_plug, bool remove_plug)
Definition: darwinfirewiredevice.cpp:696
DarwinFirewireDevice::BroadcastToListeners
void BroadcastToListeners(const unsigned char *data, uint dataSize) override
Definition: darwinfirewiredevice.cpp:541
DarwinFirewireDevice::ProcessNoDataMessage
void ProcessNoDataMessage(void)
Definition: darwinfirewiredevice.cpp:548
DarwinFirewireDevice::IsPortOpen
bool IsPortOpen(void) const override
Definition: darwinfirewiredevice.cpp:508
DarwinFirewireDevice::GetInfoPtr
DarwinAVCInfo * GetInfoPtr(void)
Definition: darwinfirewiredevice.cpp:683
DarwinFirewireDevice::GetMaxSpeed
int GetMaxSpeed(void)
Definition: darwinfirewiredevice.cpp:364
DarwinFirewireDevice::SendAVCCommand
bool SendAVCCommand(const std::vector< uint8_t > &cmd, std::vector< uint8_t > &result, int) override
Definition: darwinfirewiredevice.cpp:501
DarwinFirewireDevice::StartStreaming
bool StartStreaming(void)
Definition: darwinfirewiredevice.cpp:456
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:905
DarwinFirewireDevice
Definition: darwinfirewiredevice.h:11
firewiredevice.h
TSDataListener
Definition: streamlisteners.h:53
DarwinFirewireDevice::HandleBusReset
void HandleBusReset(void)
Definition: darwinfirewiredevice.cpp:770
DarwinFirewireDevice::StopStreaming
bool StopStreaming(void)
Definition: darwinfirewiredevice.cpp:481
DarwinFirewireDevice::UpdateDeviceListItem
void UpdateDeviceListItem(uint64_t guid, void *item)
Definition: darwinfirewiredevice.cpp:656
DarwinFirewireDevice::GetSTBList
static std::vector< AVCInfo > GetSTBList(void)
Definition: darwinfirewiredevice.cpp:608
DarwinFirewireDevice::dfd_stream_msg
friend void dfd_stream_msg(UInt32 msg, UInt32 param1, UInt32 param2, void *callback_data)
Definition: darwinfirewiredevice.cpp:913
DarwinFirewireDevice::m_remote_node
int m_remote_node
Definition: darwinfirewiredevice.h:86
DarwinFirewireDevice::IsSTBStreaming
bool IsSTBStreaming(uint *fw_channel=nullptr)
Definition: darwinfirewiredevice.cpp:394
DarwinFirewireDevice::DarwinFirewireDevice
DarwinFirewireDevice(uint64_t guid, uint subunitid, uint speed)
Definition: darwinfirewiredevice.cpp:117
DarwinFirewireDevice::RemoveListener
void RemoveListener(TSDataListener *) override
Definition: darwinfirewiredevice.cpp:528
DarwinFirewireDevice::AddListener
void AddListener(TSDataListener *) override
Definition: darwinfirewiredevice.cpp:518
DarwinFirewireDevice::HandleDeviceChange
void HandleDeviceChange(uint messageType)
Definition: darwinfirewiredevice.cpp:811
DarwinFirewireDevice::StartController
void StartController(void)
Definition: darwinfirewiredevice.cpp:176
DarwinFirewireDevice::dfd_update_device_list_item
friend void dfd_update_device_list_item(DarwinFirewireDevice *dev, uint64_t guid, void *item)
Definition: darwinfirewiredevice.cpp:899
uint
unsigned int uint
Definition: compat.h:140
DarwinFirewireDevice::ClosePort
bool ClosePort(void) override
Definition: darwinfirewiredevice.cpp:295
DarwinFirewireDevice::~DarwinFirewireDevice
~DarwinFirewireDevice()
Definition: darwinfirewiredevice.cpp:124
DarwinFirewireDevice::dfd_tspacket_handler
friend int dfd_tspacket_handler(uint tsPacketCount, uint32_t **ppBuf, void *callback_data)
Definition: darwinfirewiredevice.cpp:920
DarwinFirewireDevice::OpenPort
bool OpenPort(void) override
Definition: darwinfirewiredevice.cpp:225
DarwinFirewireDevice::operator=
DarwinFirewireDevice & operator=(const DarwinFirewireDevice &)=delete
DarwinFirewireDevice::dfd_controller_thunk
friend void * dfd_controller_thunk(void *callback_data)
Definition: darwinfirewiredevice.cpp:891
DarwinFirewireDevice::GetSTBListPrivate
std::vector< AVCInfo > GetSTBListPrivate(void)
Definition: darwinfirewiredevice.cpp:629
DarwinFirewireDevice::DarwinFirewireDevice
DarwinFirewireDevice(const DarwinFirewireDevice &)=delete
DarwinFirewireDevice::CloseAVStream
bool CloseAVStream(void)
Definition: darwinfirewiredevice.cpp:419
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:791
DarwinAVCInfo
Definition: darwinavcinfo.h:26
DarwinFirewireDevice::IsAVStreamOpen
bool IsAVStreamOpen(void) const
Definition: darwinfirewiredevice.cpp:433
FirewireDevice
Definition: firewiredevice.h:24
DarwinFirewireDevice::ProcessStreamingMessage
void ProcessStreamingMessage(uint32_t msg, uint32_t param1, uint32_t param2)
Definition: darwinfirewiredevice.cpp:570
DarwinFirewireDevice::RunController
void RunController(void)
Definition: darwinfirewiredevice.cpp:140