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 | Private Attributes | List of all members
leansdr::datvvideoplayer< T > Struct Template Reference

#include <datvvideoplayer.h>

+ Inheritance diagram for leansdr::datvvideoplayer< T >:
+ Collaboration diagram for leansdr::datvvideoplayer< T >:

Public Member Functions

 datvvideoplayer (scheduler *sch, pipebuf< T > &_in, DATVideostream *objVideoStream, DATVUDPStream *udpStream)
 
void run ()
 
- Public Member Functions inherited from leansdr::runnable
 runnable (scheduler *_sch, const char *name)
 
- Public Member Functions inherited from leansdr::runnable_common
 runnable_common (const char *_name)
 
virtual ~runnable_common ()
 
virtual void shutdown ()
 

Private Attributes

pipereader< T > in
 
DATVideostreamm_objVideoStream
 
DATVUDPStreamm_udpStream
 

Additional Inherited Members

- Public Attributes inherited from leansdr::runnable_common
const char * name
 
- Protected Attributes inherited from leansdr::runnable
schedulersch
 

Detailed Description

template<typename T>
struct leansdr::datvvideoplayer< T >

Definition at line 29 of file datvvideoplayer.h.

Constructor & Destructor Documentation

◆ datvvideoplayer()

template<typename T>
leansdr::datvvideoplayer< T >::datvvideoplayer ( scheduler sch,
pipebuf< T > &  _in,
DATVideostream objVideoStream,
DATVUDPStream udpStream 
)
inline

Definition at line 31 of file datvvideoplayer.h.

35  :
36  runnable(sch, _in.name),
37  in(_in),
38  m_objVideoStream(objVideoStream),
39  m_udpStream(udpStream)
40  {
41  }
DATVideostream * m_objVideoStream
runnable(scheduler *_sch, const char *name)
Definition: framework.h:193
DATVUDPStream * m_udpStream
scheduler * sch
Definition: framework.h:199

Member Function Documentation

◆ run()

template<typename T>
void leansdr::datvvideoplayer< T >::run ( )
inlinevirtual

Reimplemented from leansdr::runnable_common.

Definition at line 43 of file datvvideoplayer.h.

44  {
45  int size = in.readable() * sizeof(T);
46 
47  if (!size) {
48  return;
49  }
50 
51  m_udpStream->pushData((const char *) in.rd(), in.readable());
52  int nw = m_objVideoStream->pushData((const char *) in.rd(), size);
53 
54  if (!nw)
55  {
56  fatal("leansdr::datvvideoplayer::run: pipe");
57  return;
58  }
59 
60  if (nw < 0)
61  {
62  fatal("leansdr::datvvideoplayer::run: write");
63  return;
64  }
65 
66  if (nw % sizeof(T))
67  {
68  fatal("leansdr::datvvideoplayer::run: partial write");
69  return;
70  }
71 
72  if (nw != size) {
73  fprintf(stderr, "leansdr::datvvideoplayer::run: nw: %d size: %d\n", nw, size);
74  }
75 
76  in.read(nw / sizeof(T));
77  }
DATVideostream * m_objVideoStream
DATVUDPStream * m_udpStream
int pushData(const char *chrData, int intSize)
void fatal(const char *s)
Definition: framework.cpp:6
void pushData(const char *chrData, int nbTSBlocks)

Member Data Documentation

◆ in

template<typename T>
pipereader<T> leansdr::datvvideoplayer< T >::in
private

◆ m_objVideoStream

template<typename T>
DATVideostream* leansdr::datvvideoplayer< T >::m_objVideoStream
private

◆ m_udpStream

template<typename T>
DATVUDPStream* leansdr::datvvideoplayer< T >::m_udpStream
private

The documentation for this struct was generated from the following file: