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

#include <linuxfirewiredevice.h>

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

Public Member Functions

 LinuxFirewireDevice (uint64_t guid, uint subunitid, uint speed, bool use_p2p, uint av_buffer_size_in_bytes=0)
 
 ~LinuxFirewireDevice () override
 
bool OpenPort (void) override
 
bool ClosePort (void) override
 
bool ResetBus (void) override
 
void AddListener (TSDataListener *listener) override
 
void RemoveListener (TSDataListener *listener) override
 
bool IsPortOpen (void) const override
 
void SignalReset (uint generation)
 
- 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 std::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 std::vector< AVCInfoGetSTBList (void)
 

Static Public Attributes

static const uint kBroadcastChannel = 63
 
static const uint kConnectionP2P = 0
 
static const uint kConnectionBroadcast = 1
 
static const uint kMaxBufferedPackets = 4 * 1024 * 1024 / 188
 

Private Member Functions

bool OpenNode (void)
 
bool CloseNode (void)
 
bool OpenAVStream (void)
 
bool CloseAVStream (void)
 
bool OpenP2PNode (void)
 
bool CloseP2PNode (void)
 
bool OpenBroadcastNode (void)
 
bool CloseBroadcastNode (void)
 
bool StartStreaming (void)
 
bool StopStreaming (void)
 
void run (void) override
 
void PrintDropped (uint dropped_packets)
 
bool SetAVStreamBufferSize (uint size_in_bytes)
 
bool SetAVStreamSpeed (uint speed)
 
bool IsNodeOpen (void) const
 
bool IsAVStreamOpen (void) const
 
bool UpdateDeviceList (void)
 
void UpdateDeviceListItem (uint64_t guid, void *pitem)
 
std::vector< AVCInfoGetSTBListPrivate (void)
 
bool SendAVCCommand (const std::vector< uint8_t > &cmd, std::vector< uint8_t > &result, int retry_cnt) override
 
LinuxAVCInfoGetInfoPtr (void)
 
const LinuxAVCInfoGetInfoPtr (void) const
 
void HandleBusReset (void)
 

Private Attributes

uint m_bufsz
 
bool m_dbResetDisabled {false}
 
bool m_useP2P
 
LFDPrivm_priv {nullptr}
 

Friends

int linux_firewire_device_tspacket_handler (unsigned char *tspacket, int len, uint dropped, 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)
 
void SetLastChannel (uint channel)
 
void ProcessPATPacket (const TSPacket &tspacket)
 
virtual void BroadcastToListeners (const unsigned char *data, uint dataSize)
 
- Protected Attributes inherited from FirewireDevice
uint64_t m_guid
 
uint m_subunitid
 
uint m_speed
 
uint m_lastChannel {0}
 
uint m_lastCrc {0}
 
bool m_bufferCleared {true}
 
uint m_openPortCnt {0}
 
std::vector< TSDataListener * > m_listeners
 
QMutex m_lock
 
- Static Protected Attributes inherited from FirewireDevice
static QMap< uint64_t, QString > s_idToModel
 Vendor ID + Model ID to FirewireDevice STB model string. More...
 
static QMutex s_staticLock
 

Detailed Description

Definition at line 19 of file linuxfirewiredevice.h.

Constructor & Destructor Documentation

◆ LinuxFirewireDevice()

LinuxFirewireDevice::LinuxFirewireDevice ( uint64_t  guid,
uint  subunitid,
uint  speed,
bool  use_p2p,
uint  av_buffer_size_in_bytes = 0 
)

Definition at line 121 of file linuxfirewiredevice.cpp.

◆ ~LinuxFirewireDevice()

LinuxFirewireDevice::~LinuxFirewireDevice ( )
override

Definition at line 136 of file linuxfirewiredevice.cpp.

Member Function Documentation

◆ OpenPort()

bool LinuxFirewireDevice::OpenPort ( void  )
overridevirtual

Implements FirewireDevice.

Definition at line 228 of file linuxfirewiredevice.cpp.

◆ ClosePort()

bool LinuxFirewireDevice::ClosePort ( void  )
overridevirtual

Implements FirewireDevice.

Definition at line 288 of file linuxfirewiredevice.cpp.

Referenced by OpenPort(), and ~LinuxFirewireDevice().

◆ ResetBus()

bool LinuxFirewireDevice::ResetBus ( void  )
overridevirtual

Reimplemented from FirewireDevice.

Definition at line 765 of file linuxfirewiredevice.cpp.

Referenced by run().

◆ AddListener()

void LinuxFirewireDevice::AddListener ( TSDataListener listener)
overridevirtual

Reimplemented from FirewireDevice.

Definition at line 337 of file linuxfirewiredevice.cpp.

◆ RemoveListener()

void LinuxFirewireDevice::RemoveListener ( TSDataListener listener)
overridevirtual

Reimplemented from FirewireDevice.

Definition at line 351 of file linuxfirewiredevice.cpp.

◆ IsPortOpen()

bool LinuxFirewireDevice::IsPortOpen ( void  ) const
overridevirtual

Implements FirewireDevice.

Definition at line 373 of file linuxfirewiredevice.cpp.

Referenced by ClosePort(), OpenAVStream(), OpenPort(), and ~LinuxFirewireDevice().

◆ SignalReset()

void LinuxFirewireDevice::SignalReset ( uint  generation)

Definition at line 152 of file linuxfirewiredevice.cpp.

◆ GetSTBList()

std::vector< AVCInfo > LinuxFirewireDevice::GetSTBList ( void  )
static

Definition at line 799 of file linuxfirewiredevice.cpp.

Referenced by FirewireDevice::GetSTBList().

◆ OpenNode()

bool LinuxFirewireDevice::OpenNode ( void  )
private

Definition at line 386 of file linuxfirewiredevice.cpp.

Referenced by AddListener(), and OpenAVStream().

◆ CloseNode()

bool LinuxFirewireDevice::CloseNode ( void  )
private

Definition at line 393 of file linuxfirewiredevice.cpp.

Referenced by ClosePort(), and RemoveListener().

◆ OpenAVStream()

bool LinuxFirewireDevice::OpenAVStream ( void  )
private

Definition at line 521 of file linuxfirewiredevice.cpp.

Referenced by AddListener(), and StartStreaming().

◆ CloseAVStream()

bool LinuxFirewireDevice::CloseAVStream ( void  )
private

Definition at line 559 of file linuxfirewiredevice.cpp.

Referenced by CloseP2PNode(), OpenBroadcastNode(), and RemoveListener().

◆ OpenP2PNode()

bool LinuxFirewireDevice::OpenP2PNode ( void  )
private

Definition at line 406 of file linuxfirewiredevice.cpp.

Referenced by OpenNode().

◆ CloseP2PNode()

bool LinuxFirewireDevice::CloseP2PNode ( void  )
private

Definition at line 440 of file linuxfirewiredevice.cpp.

Referenced by CloseNode().

◆ OpenBroadcastNode()

bool LinuxFirewireDevice::OpenBroadcastNode ( void  )
private

Definition at line 466 of file linuxfirewiredevice.cpp.

Referenced by OpenNode().

◆ CloseBroadcastNode()

bool LinuxFirewireDevice::CloseBroadcastNode ( void  )
private

Definition at line 507 of file linuxfirewiredevice.cpp.

Referenced by CloseNode().

◆ StartStreaming()

bool LinuxFirewireDevice::StartStreaming ( void  )
private

Definition at line 660 of file linuxfirewiredevice.cpp.

Referenced by AddListener().

◆ StopStreaming()

bool LinuxFirewireDevice::StopStreaming ( void  )
private

Definition at line 690 of file linuxfirewiredevice.cpp.

Referenced by CloseAVStream(), and RemoveListener().

◆ run()

void LinuxFirewireDevice::run ( void  )
overrideprivate

Definition at line 578 of file linuxfirewiredevice.cpp.

◆ PrintDropped()

void LinuxFirewireDevice::PrintDropped ( uint  dropped_packets)
private

Definition at line 786 of file linuxfirewiredevice.cpp.

Referenced by linux_firewire_device_tspacket_handler().

◆ SetAVStreamBufferSize()

bool LinuxFirewireDevice::SetAVStreamBufferSize ( uint  size_in_bytes)
private

Definition at line 708 of file linuxfirewiredevice.cpp.

Referenced by OpenAVStream().

◆ SetAVStreamSpeed()

bool LinuxFirewireDevice::SetAVStreamSpeed ( uint  speed)
private

Definition at line 725 of file linuxfirewiredevice.cpp.

◆ IsNodeOpen()

bool LinuxFirewireDevice::IsNodeOpen ( void  ) const
private

Definition at line 755 of file linuxfirewiredevice.cpp.

Referenced by ClosePort(), and OpenAVStream().

◆ IsAVStreamOpen()

bool LinuxFirewireDevice::IsAVStreamOpen ( void  ) const
private

Definition at line 760 of file linuxfirewiredevice.cpp.

Referenced by StartStreaming().

◆ UpdateDeviceList()

bool LinuxFirewireDevice::UpdateDeviceList ( void  )
private

Definition at line 845 of file linuxfirewiredevice.cpp.

Referenced by LinuxFirewireDevice(), and SignalReset().

◆ UpdateDeviceListItem()

void LinuxFirewireDevice::UpdateDeviceListItem ( uint64_t  guid,
void *  pitem 
)
private

Definition at line 920 of file linuxfirewiredevice.cpp.

Referenced by UpdateDeviceList().

◆ GetSTBListPrivate()

std::vector< AVCInfo > LinuxFirewireDevice::GetSTBListPrivate ( void  )
private

Definition at line 811 of file linuxfirewiredevice.cpp.

Referenced by GetSTBList().

◆ SendAVCCommand()

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

Implements FirewireDevice.

Definition at line 365 of file linuxfirewiredevice.cpp.

◆ GetInfoPtr() [1/2]

LinuxAVCInfo * LinuxFirewireDevice::GetInfoPtr ( void  )
private

◆ GetInfoPtr() [2/2]

const LinuxAVCInfo * LinuxFirewireDevice::GetInfoPtr ( void  ) const
private

Definition at line 954 of file linuxfirewiredevice.cpp.

◆ HandleBusReset()

void LinuxFirewireDevice::HandleBusReset ( void  )
private

Definition at line 172 of file linuxfirewiredevice.cpp.

Referenced by run().

Friends And Related Function Documentation

◆ linux_firewire_device_tspacket_handler

int linux_firewire_device_tspacket_handler ( unsigned char *  tspacket,
int  len,
uint  dropped,
void *  callback_data 
)
friend

Definition at line 963 of file linuxfirewiredevice.cpp.

Referenced by OpenAVStream().

Member Data Documentation

◆ kBroadcastChannel

const uint LinuxFirewireDevice::kBroadcastChannel = 63
static

Definition at line 48 of file linuxfirewiredevice.h.

Referenced by OpenBroadcastNode().

◆ kConnectionP2P

const uint LinuxFirewireDevice::kConnectionP2P = 0
static

Definition at line 49 of file linuxfirewiredevice.h.

Referenced by FirewireChannel::FirewireChannel().

◆ kConnectionBroadcast

const uint LinuxFirewireDevice::kConnectionBroadcast = 1
static

Definition at line 50 of file linuxfirewiredevice.h.

◆ kMaxBufferedPackets

const uint LinuxFirewireDevice::kMaxBufferedPackets = 4 * 1024 * 1024 / 188
static

Definition at line 51 of file linuxfirewiredevice.h.

Referenced by SetAVStreamBufferSize().

◆ m_bufsz

uint LinuxFirewireDevice::m_bufsz
private

Definition at line 92 of file linuxfirewiredevice.h.

Referenced by LinuxFirewireDevice(), and OpenAVStream().

◆ m_dbResetDisabled

bool LinuxFirewireDevice::m_dbResetDisabled {false}
private

Definition at line 93 of file linuxfirewiredevice.h.

Referenced by LinuxFirewireDevice(), and ResetBus().

◆ m_useP2P

bool LinuxFirewireDevice::m_useP2P
private

Definition at line 94 of file linuxfirewiredevice.h.

Referenced by OpenNode().

◆ m_priv

LFDPriv* LinuxFirewireDevice::m_priv {nullptr}
private

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