SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
DATVUDPStream Class Reference

#include <datvudpstream.h>

Public Member Functions

 DATVUDPStream (int tsBlockSize)
 
 ~DATVUDPStream ()
 
void pushData (const char *chrData, int nbTSBlocks)
 
void setActive (bool active)
 
bool setAddress (const QString &address)
 
void setPort (quint16 port)
 

Static Public Attributes

static const int m_tsBlocksPerFrame = 7
 

Private Attributes

bool m_active
 
QUdpSocket m_udpSocket
 
QHostAddress m_address
 
quint16 m_port
 
int m_tsBlockSize
 
int m_tsBlockIndex
 
char * m_tsBuffer
 

Detailed Description

Definition at line 28 of file datvudpstream.h.

Constructor & Destructor Documentation

◆ DATVUDPStream()

DATVUDPStream::DATVUDPStream ( int  tsBlockSize)

Definition at line 24 of file datvudpstream.cpp.

References m_tsBlockSize, m_tsBlocksPerFrame, and m_tsBuffer.

24  :
25  m_active(false),
26  m_address(QHostAddress::LocalHost),
27  m_port(8882),
28  m_tsBlockSize(tsBlockSize),
30 {
32 }
static const int m_tsBlocksPerFrame
Definition: datvudpstream.h:39
QHostAddress m_address
Definition: datvudpstream.h:44
char * m_tsBuffer
Definition: datvudpstream.h:48
quint16 m_port
Definition: datvudpstream.h:45

◆ ~DATVUDPStream()

DATVUDPStream::~DATVUDPStream ( )

Definition at line 34 of file datvudpstream.cpp.

References m_tsBuffer.

35 {
36  delete[] m_tsBuffer;
37 }
char * m_tsBuffer
Definition: datvudpstream.h:48

Member Function Documentation

◆ pushData()

void DATVUDPStream::pushData ( const char *  chrData,
int  nbTSBlocks 
)

Definition at line 39 of file datvudpstream.cpp.

References i, m_active, m_address, m_port, m_tsBlockIndex, m_tsBlockSize, m_tsBlocksPerFrame, m_tsBuffer, and m_udpSocket.

Referenced by leansdr::datvvideoplayer< leansdr::tspacket >::run().

40 {
41  if (!m_active) {
42  return;
43  }
44 
45  for (int i = 0; i < nbTSBlocks; i++)
46  {
48  {
49  std::copy(chrData + i*m_tsBlockSize, chrData + (i+1)*m_tsBlockSize, m_tsBuffer + m_tsBlockIndex*m_tsBlockSize);
51  }
52  else
53  {
55  m_tsBlockIndex = 0;
56  }
57  }
58 }
static const int m_tsBlocksPerFrame
Definition: datvudpstream.h:39
QHostAddress m_address
Definition: datvudpstream.h:44
int32_t i
Definition: decimators.h:244
QUdpSocket m_udpSocket
Definition: datvudpstream.h:43
char * m_tsBuffer
Definition: datvudpstream.h:48
quint16 m_port
Definition: datvudpstream.h:45
+ Here is the caller graph for this function:

◆ setActive()

void DATVUDPStream::setActive ( bool  active)
inline

Definition at line 35 of file datvudpstream.h.

References m_active.

Referenced by DATVDemod::applySettings().

35 { m_active = active; }
+ Here is the caller graph for this function:

◆ setAddress()

bool DATVUDPStream::setAddress ( const QString &  address)
inline

Definition at line 36 of file datvudpstream.h.

References m_address.

Referenced by DATVDemod::applySettings().

36 { return m_address.setAddress(address); }
QHostAddress m_address
Definition: datvudpstream.h:44
+ Here is the caller graph for this function:

◆ setPort()

void DATVUDPStream::setPort ( quint16  port)
inline

Definition at line 37 of file datvudpstream.h.

References m_port.

Referenced by DATVDemod::applySettings().

37 { m_port = port; }
quint16 m_port
Definition: datvudpstream.h:45
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_active

bool DATVUDPStream::m_active
private

Definition at line 42 of file datvudpstream.h.

Referenced by pushData(), and setActive().

◆ m_address

QHostAddress DATVUDPStream::m_address
private

Definition at line 44 of file datvudpstream.h.

Referenced by pushData(), and setAddress().

◆ m_port

quint16 DATVUDPStream::m_port
private

Definition at line 45 of file datvudpstream.h.

Referenced by pushData(), and setPort().

◆ m_tsBlockIndex

int DATVUDPStream::m_tsBlockIndex
private

Definition at line 47 of file datvudpstream.h.

Referenced by pushData().

◆ m_tsBlockSize

int DATVUDPStream::m_tsBlockSize
private

Definition at line 46 of file datvudpstream.h.

Referenced by DATVUDPStream(), and pushData().

◆ m_tsBlocksPerFrame

const int DATVUDPStream::m_tsBlocksPerFrame = 7
static

Definition at line 39 of file datvudpstream.h.

Referenced by DATVUDPStream(), and pushData().

◆ m_tsBuffer

char* DATVUDPStream::m_tsBuffer
private

Definition at line 48 of file datvudpstream.h.

Referenced by DATVUDPStream(), pushData(), and ~DATVUDPStream().

◆ m_udpSocket

QUdpSocket DATVUDPStream::m_udpSocket
private

Definition at line 43 of file datvudpstream.h.

Referenced by pushData().


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