MythTV  master
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
DarwinFirewireDevice Class Reference

#include <darwinfirewiredevice.h>

Inheritance diagram for DarwinFirewireDevice:
Inheritance graph
[legend]
Collaboration diagram for DarwinFirewireDevice:
Collaboration graph
[legend]

Public Member Functions

 DarwinFirewireDevice (uint64_t guid, uint subunitid, uint speed)
 
 ~DarwinFirewireDevice ()
 
bool OpenPort (void) override
 
bool ClosePort (void) override
 
bool ResetBus (void) override
 
void HandleDeviceChange (uint messageType)
 
void AddListener (TSDataListener *) override
 
void RemoveListener (TSDataListener *) override
 
bool IsPortOpen (void) const override
 
- Public Member Functions inherited from FirewireDevice
virtual ~FirewireDevice ()=default
 
virtual bool SetPowerState (bool on)
 
virtual bool SetChannel (const QString &panel_model, uint alt_method, uint channel)
 
bool IsSTBBufferCleared (void) const
 
virtual PowerState GetPowerState (void)
 

Static Public Member Functions

static vector< AVCInfoGetSTBList (void)
 
- Static Public Member Functions inherited from FirewireDevice
static bool IsSTBSupported (const QString &model)
 
static QString GetModelName (uint vendor_id, uint model_id)
 
static vector< AVCInfoGetSTBList (void)
 

Private Member Functions

 DarwinFirewireDevice (const DarwinFirewireDevice &)=delete
 
DarwinFirewireDeviceoperator= (const DarwinFirewireDevice &)=delete
 
void StartController (void)
 
void StopController (void)
 
bool OpenAVStream (void)
 
bool CloseAVStream (void)
 
bool IsAVStreamOpen (void) const
 
bool StartStreaming (void)
 
bool StopStreaming (void)
 
bool SendAVCCommand (const vector< uint8_t > &cmd, vector< uint8_t > &result, int) override
 
void HandleBusReset (void)
 
bool UpdatePlugRegisterPrivate (uint plug_number, int fw_chan, int new_speed, bool add_plug, bool remove_plug)
 
bool UpdatePlugRegister (uint plug_number, int fw_chan, int speed, bool add_plug, bool remove_plug, uint retry_cnt=4)
 
void RunController (void)
 
void BroadcastToListeners (const unsigned char *data, uint dataSize) override
 
void UpdateDeviceListItem (uint64_t guid, void *item)
 
void ProcessNoDataMessage (void)
 
void ProcessStreamingMessage (uint32_t msg, uint32_t param1, uint32_t param2)
 
DarwinAVCInfoGetInfoPtr (void)
 
const DarwinAVCInfoGetInfoPtr (void) const
 
int GetMaxSpeed (void)
 
bool IsSTBStreaming (uint *fw_channel=nullptr)
 
vector< AVCInfoGetSTBListPrivate (void)
 

Private Attributes

int m_local_node {-1}
 
int m_remote_node {-1}
 
DFDPrivm_priv {nullptr}
 

Friends

void * dfd_controller_thunk (void *param)
 
void dfd_update_device_list_item (DarwinFirewireDevice *dev, uint64_t guid, void *item)
 
int dfd_no_data_notification (void *cb_data)
 
void dfd_stream_msg (UInt32 msg, UInt32 param1, UInt32 param2, void *callback_data)
 
int dfd_tspacket_handler (uint tsPacketCount, uint32_t **ppBuf, void *callback_data)
 

Additional Inherited Members

- Public Types inherited from FirewireDevice
enum  PowerState { kAVCPowerOn, kAVCPowerOff, kAVCPowerUnknown, kAVCPowerQueryFailed }
 
enum  IEEE1394Command {
  kAVCControlCommand = 0x00, kAVCStatusInquiryCommand = 0x01, kAVCSpecificInquiryCommand = 0x02, kAVCNotifyCommand = 0x03,
  kAVCGeneralInquiryCommand = 0x04, kAVCNotImplementedStatus = 0x08, kAVCAcceptedStatus = 0x09, kAVCRejectedStatus = 0x0a,
  kAVCInTransitionStatus = 0x0b, kAVCImplementedStatus = 0x0c, kAVCChangedStatus = 0x0d, kAVCInterimStatus = 0x0f,
  kAVCResponseImplemented = 0x0c
}
 
enum  IEEE1394UnitAddress {
  kAVCSubunitId0 = 0x00, kAVCSubunitId1 = 0x01, kAVCSubunitId2 = 0x02, kAVCSubunitId3 = 0x03,
  kAVCSubunitId4 = 0x04, kAVCSubunitIdExtended = 0x05, kAVCSubunitIdIgnore = 0x07, kAVCSubunitTypeVideoMonitor = (0x00 << 3),
  kAVCSubunitTypeAudio = (0x01 << 3), kAVCSubunitTypePrinter = (0x02 << 3), kAVCSubunitTypeDiscRecorder = (0x03 << 3), kAVCSubunitTypeTapeRecorder = (0x04 << 3),
  kAVCSubunitTypeTuner = (0x05 << 3), kAVCSubunitTypeCA = (0x06 << 3), kAVCSubunitTypeVideoCamera = (0x07 << 3), kAVCSubunitTypePanel = (0x09 << 3),
  kAVCSubunitTypeBulletinBoard = (0x0a << 3), kAVCSubunitTypeCameraStorage = (0x0b << 3), kAVCSubunitTypeMusic = (0x0c << 3), kAVCSubunitTypeVendorUnique = (0x1c << 3),
  kAVCSubunitTypeExtended = (0x1e << 3), kAVCSubunitTypeUnit = (0x1f << 3)
}
 
enum  IEEE1394Opcode {
  kAVCUnitPlugInfoOpcode = 0x02, kAVCUnitDigitalOutputOpcode = 0x10, kAVCUnitDigitalInputOpcode = 0x11, kAVCUnitChannelUsageOpcode = 0x12,
  kAVCUnitOutputPlugSignalFormatOpcode = 0x18, kAVCUnitInputPlugSignalFormatOpcode = 0x19, kAVCUnitConnectAVOpcode = 0x20, kAVCUnitDisconnectAVOpcode = 0x21,
  kAVCUnitConnectionsOpcode = 0x22, kAVCUnitConnectOpcode = 0x24, kAVCUnitDisconnectOpcode = 0x25, kAVCUnitUnitInfoOpcode = 0x30,
  kAVCUnitSubunitInfoOpcode = 0x31, kAVCUnitSignalSourceOpcode = 0x1a, kAVCUnitPowerOpcode = 0xb2, kAVCCommonOpenDescriptorOpcode = 0x08,
  kAVCCommonReadDescriptorOpcode = 0x09, kAVCCommonWriteDescriptorOpcode = 0x0A, kAVCCommonSearchDescriptorOpcode = 0x0B, kAVCCommonObjectNumberSelectOpcode = 0x0D,
  kAVCCommonPowerOpcode = 0xB2, kAVCCommonReserveOpcode = 0x01, kAVCCommonPlugInfoOpcode = 0x02, kAVCCommonVendorDependentOpcode = 0x00,
  kAVCPanelPassThrough = 0x7c
}
 
enum  IEEE1394UnitPowerParam0 { kAVCPowerStateOn = 0x70, kAVCPowerStateOff = 0x60, kAVCPowerStateQuery = 0x7f }
 
enum  IEEE1394PanelPassThroughParam0 {
  kAVCPanelKeySelect = 0x00, kAVCPanelKeyUp = 0x01, kAVCPanelKeyDown = 0x02, kAVCPanelKeyLeft = 0x03,
  kAVCPanelKeyRight = 0x04, kAVCPanelKeyRightUp = 0x05, kAVCPanelKeyRightDown = 0x06, kAVCPanelKeyLeftUp = 0x07,
  kAVCPanelKeyLeftDown = 0x08, kAVCPanelKeyRootMenu = 0x09, kAVCPanelKeySetupMenu = 0x0A, kAVCPanelKeyContentsMenu = 0x0B,
  kAVCPanelKeyFavoriteMenu = 0x0C, kAVCPanelKeyExit = 0x0D, kAVCPanelKey0 = 0x20, kAVCPanelKey1 = 0x21,
  kAVCPanelKey2 = 0x22, kAVCPanelKey3 = 0x23, kAVCPanelKey4 = 0x24, kAVCPanelKey5 = 0x25,
  kAVCPanelKey6 = 0x26, kAVCPanelKey7 = 0x27, kAVCPanelKey8 = 0x28, kAVCPanelKey9 = 0x29,
  kAVCPanelKeyDot = 0x2A, kAVCPanelKeyEnter = 0x2B, kAVCPanelKeyClear = 0x2C, kAVCPanelKeyChannelUp = 0x30,
  kAVCPanelKeyChannelDown = 0x31, kAVCPanelKeyPreviousChannel = 0x32, kAVCPanelKeySoundSelect = 0x33, kAVCPanelKeyInputSelect = 0x34,
  kAVCPanelKeyDisplayInfo = 0x35, kAVCPanelKeyHelp = 0x36, kAVCPanelKeyPageUp = 0x37, kAVCPanelKeyPageDown = 0x38,
  kAVCPanelKeyPower = 0x40, kAVCPanelKeyVolumeUp = 0x41, kAVCPanelKeyVolumeDown = 0x42, kAVCPanelKeyMute = 0x43,
  kAVCPanelKeyPlay = 0x44, kAVCPanelKeyStop = 0x45, kAVCPanelKeyPause = 0x46, kAVCPanelKeyRecord = 0x47,
  kAVCPanelKeyRewind = 0x48, kAVCPanelKeyFastForward = 0x49, kAVCPanelKeyEject = 0x4a, kAVCPanelKeyForward = 0x4b,
  kAVCPanelKeyBackward = 0x4c, kAVCPanelKeyAngle = 0x50, kAVCPanelKeySubPicture = 0x51, kAVCPanelKeyTuneFunction = 0x67,
  kAVCPanelKeyPress = 0x00, kAVCPanelKeyRelease = 0x80
}
 
- Protected Member Functions inherited from FirewireDevice
 FirewireDevice (uint64_t guid, uint subunitid, uint speed)
 
bool GetSubunitInfo (uint8_t table[32])
 
void SetLastChannel (uint channel)
 
void ProcessPATPacket (const TSPacket &tspacket)
 
- Protected Attributes inherited from FirewireDevice
uint64_t m_guid
 
uint m_subunitid
 
uint m_speed
 
uint m_last_channel {0}
 
uint m_last_crc {0}
 
bool m_buffer_cleared {true}
 
uint m_open_port_cnt {0}
 
vector< TSDataListener * > m_listeners
 
QMutex m_lock
 
- Static Protected Attributes inherited from FirewireDevice
static QMap< uint64_t, QString > s_id_to_model
 Vendor ID + Model ID to FirewireDevice STB model string. More...
 
static QMutex s_static_lock
 

Detailed Description

Definition at line 10 of file darwinfirewiredevice.h.

Constructor & Destructor Documentation

◆ DarwinFirewireDevice() [1/2]

DarwinFirewireDevice::DarwinFirewireDevice ( uint64_t  guid,
uint  subunitid,
uint  speed 
)

Definition at line 118 of file darwinfirewiredevice.cpp.

◆ ~DarwinFirewireDevice()

DarwinFirewireDevice::~DarwinFirewireDevice ( )

Definition at line 125 of file darwinfirewiredevice.cpp.

◆ DarwinFirewireDevice() [2/2]

DarwinFirewireDevice::DarwinFirewireDevice ( const DarwinFirewireDevice )
privatedelete

Member Function Documentation

◆ OpenPort()

bool DarwinFirewireDevice::OpenPort ( void  )
overridevirtual

Implements FirewireDevice.

Definition at line 226 of file darwinfirewiredevice.cpp.

◆ ClosePort()

bool DarwinFirewireDevice::ClosePort ( void  )
overridevirtual

Implements FirewireDevice.

Definition at line 296 of file darwinfirewiredevice.cpp.

Referenced by ~DarwinFirewireDevice().

◆ ResetBus()

bool DarwinFirewireDevice::ResetBus ( void  )
overridevirtual

Reimplemented from FirewireDevice.

Definition at line 439 of file darwinfirewiredevice.cpp.

Referenced by ProcessNoDataMessage().

◆ HandleDeviceChange()

void DarwinFirewireDevice::HandleDeviceChange ( uint  messageType)

Definition at line 811 of file darwinfirewiredevice.cpp.

Referenced by dfd_device_change_msg().

◆ AddListener()

void DarwinFirewireDevice::AddListener ( TSDataListener listener)
overridevirtual

Reimplemented from FirewireDevice.

Definition at line 519 of file darwinfirewiredevice.cpp.

◆ RemoveListener()

void DarwinFirewireDevice::RemoveListener ( TSDataListener listener)
overridevirtual

Reimplemented from FirewireDevice.

Definition at line 529 of file darwinfirewiredevice.cpp.

◆ IsPortOpen()

bool DarwinFirewireDevice::IsPortOpen ( void  ) const
overridevirtual

Implements FirewireDevice.

Definition at line 509 of file darwinfirewiredevice.cpp.

Referenced by ClosePort(), OpenPort(), and ~DarwinFirewireDevice().

◆ GetSTBList()

vector< AVCInfo > DarwinFirewireDevice::GetSTBList ( void  )
static

Definition at line 608 of file darwinfirewiredevice.cpp.

Referenced by FirewireDevice::GetSTBList().

◆ operator=()

DarwinFirewireDevice& DarwinFirewireDevice::operator= ( const DarwinFirewireDevice )
privatedelete

◆ StartController()

void DarwinFirewireDevice::StartController ( void  )
private

Definition at line 177 of file darwinfirewiredevice.cpp.

Referenced by GetSTBList(), and OpenPort().

◆ StopController()

void DarwinFirewireDevice::StopController ( void  )
private

Definition at line 193 of file darwinfirewiredevice.cpp.

Referenced by ClosePort(), GetSTBList(), and OpenPort().

◆ OpenAVStream()

bool DarwinFirewireDevice::OpenAVStream ( void  )
private

Definition at line 324 of file darwinfirewiredevice.cpp.

Referenced by StartStreaming().

◆ CloseAVStream()

bool DarwinFirewireDevice::CloseAVStream ( void  )
private

Definition at line 420 of file darwinfirewiredevice.cpp.

Referenced by RemoveListener().

◆ IsAVStreamOpen()

bool DarwinFirewireDevice::IsAVStreamOpen ( void  ) const
private

Definition at line 434 of file darwinfirewiredevice.cpp.

Referenced by OpenAVStream(), and StartStreaming().

◆ StartStreaming()

bool DarwinFirewireDevice::StartStreaming ( void  )
private

Definition at line 457 of file darwinfirewiredevice.cpp.

Referenced by AddListener().

◆ StopStreaming()

bool DarwinFirewireDevice::StopStreaming ( void  )
private

Definition at line 482 of file darwinfirewiredevice.cpp.

Referenced by CloseAVStream(), and RemoveListener().

◆ SendAVCCommand()

bool DarwinFirewireDevice::SendAVCCommand ( const vector< uint8_t > &  cmd,
vector< uint8_t > &  result,
int  retry_cnt 
)
overrideprivatevirtual

Implements FirewireDevice.

Definition at line 502 of file darwinfirewiredevice.cpp.

◆ HandleBusReset()

void DarwinFirewireDevice::HandleBusReset ( void  )
private

Definition at line 770 of file darwinfirewiredevice.cpp.

Referenced by HandleDeviceChange().

◆ UpdatePlugRegisterPrivate()

bool DarwinFirewireDevice::UpdatePlugRegisterPrivate ( uint  plug_number,
int  fw_chan,
int  new_speed,
bool  add_plug,
bool  remove_plug 
)
private

Definition at line 696 of file darwinfirewiredevice.cpp.

Referenced by UpdatePlugRegister().

◆ UpdatePlugRegister()

bool DarwinFirewireDevice::UpdatePlugRegister ( uint  plug_number,
int  fw_chan,
int  speed,
bool  add_plug,
bool  remove_plug,
uint  retry_cnt = 4 
)
private

Definition at line 791 of file darwinfirewiredevice.cpp.

Referenced by HandleBusReset(), and ProcessStreamingMessage().

◆ RunController()

void DarwinFirewireDevice::RunController ( void  )
private

Definition at line 141 of file darwinfirewiredevice.cpp.

◆ BroadcastToListeners()

void DarwinFirewireDevice::BroadcastToListeners ( const unsigned char *  data,
uint  dataSize 
)
overrideprivatevirtual

Reimplemented from FirewireDevice.

Definition at line 542 of file darwinfirewiredevice.cpp.

Referenced by dfd_tspacket_handler().

◆ UpdateDeviceListItem()

void DarwinFirewireDevice::UpdateDeviceListItem ( uint64_t  guid,
void *  item 
)
private

Definition at line 656 of file darwinfirewiredevice.cpp.

Referenced by dfd_update_device_list_item().

◆ ProcessNoDataMessage()

void DarwinFirewireDevice::ProcessNoDataMessage ( void  )
private

Definition at line 549 of file darwinfirewiredevice.cpp.

◆ ProcessStreamingMessage()

void DarwinFirewireDevice::ProcessStreamingMessage ( uint32_t  msg,
uint32_t  param1,
uint32_t  param2 
)
private

Definition at line 571 of file darwinfirewiredevice.cpp.

◆ GetInfoPtr() [1/2]

DarwinAVCInfo * DarwinFirewireDevice::GetInfoPtr ( void  )
private

◆ GetInfoPtr() [2/2]

const DarwinAVCInfo * DarwinFirewireDevice::GetInfoPtr ( void  ) const
private

Definition at line 689 of file darwinfirewiredevice.cpp.

◆ GetMaxSpeed()

int DarwinFirewireDevice::GetMaxSpeed ( void  )
private

Definition at line 365 of file darwinfirewiredevice.cpp.

Referenced by OpenAVStream().

◆ IsSTBStreaming()

bool DarwinFirewireDevice::IsSTBStreaming ( uint fw_channel = nullptr)
private

Definition at line 395 of file darwinfirewiredevice.cpp.

Referenced by OpenAVStream().

◆ GetSTBListPrivate()

vector< AVCInfo > DarwinFirewireDevice::GetSTBListPrivate ( void  )
private

Definition at line 629 of file darwinfirewiredevice.cpp.

Referenced by GetSTBList().

Friends And Related Function Documentation

◆ dfd_controller_thunk

void* dfd_controller_thunk ( void *  param)
friend

Definition at line 891 of file darwinfirewiredevice.cpp.

Referenced by StartController().

◆ dfd_update_device_list_item

void dfd_update_device_list_item ( DarwinFirewireDevice dev,
uint64_t  guid,
void *  item 
)
friend

Definition at line 899 of file darwinfirewiredevice.cpp.

◆ dfd_no_data_notification

int dfd_no_data_notification ( void *  cb_data)
friend

Definition at line 905 of file darwinfirewiredevice.cpp.

Referenced by OpenAVStream().

◆ dfd_stream_msg

void dfd_stream_msg ( UInt32  msg,
UInt32  param1,
UInt32  param2,
void *  callback_data 
)
friend

Definition at line 913 of file darwinfirewiredevice.cpp.

Referenced by OpenAVStream().

◆ dfd_tspacket_handler

int dfd_tspacket_handler ( uint  tsPacketCount,
uint32_t **  ppBuf,
void *  callback_data 
)
friend

Definition at line 920 of file darwinfirewiredevice.cpp.

Member Data Documentation

◆ m_local_node

int DarwinFirewireDevice::m_local_node {-1}
private

Definition at line 85 of file darwinfirewiredevice.h.

Referenced by ClosePort(), GetMaxSpeed(), and OpenPort().

◆ m_remote_node

int DarwinFirewireDevice::m_remote_node {-1}
private

◆ m_priv

DFDPriv* DarwinFirewireDevice::m_priv {nullptr}
private

The documentation for this class was generated from the following files: