YARP
Yet Another Robot Platform
yarp::os::H264Stream Class Reference

#include <h264_carrier/H264Stream.h>

+ Inheritance diagram for yarp::os::H264Stream:

Detailed Description

Definition at line 27 of file H264Stream.h.

Public Member Functions

 H264Stream (h264Decoder_cfgParamters &config)
 
virtual ~H264Stream ()
 
bool setStream (yarp::os::impl::DgramTwoWayStream *stream)
 
void start (void)
 
virtual InputStreamgetInputStream () override
 Get an InputStream to read from. More...
 
virtual OutputStreamgetOutputStream () override
 Get an OutputStream to write to. More...
 
virtual void write (const Bytes &b) override
 Write a block of bytes to the stream. More...
 
virtual yarp::conf::ssize_t read (Bytes &b) override
 Read a block of data from the stream. More...
 
virtual bool setReadEnvelopeCallback (InputStream::readEnvelopeCallbackType callback, void *data) override
 Install a callback that the InputStream will have to call when the envelope is read from a message in carriers that cannot be escaped. More...
 
- Public Member Functions inherited from yarp::os::impl::DgramTwoWayStream
 DgramTwoWayStream ()
 
virtual bool openMonitor (int readSize=0, int writeSize=0)
 
virtual bool open (const Contact &remote)
 
virtual bool open (const Contact &local, const Contact &remote)
 
virtual bool openMcast (const Contact &group, const Contact &ipLocal)
 
virtual bool join (const Contact &group, bool sender, const Contact &ipLocal)
 
virtual bool join (const Contact &group, bool sender)
 
virtual ~DgramTwoWayStream ()
 
virtual const ContactgetLocalAddress () const override
 Get the address of the local side of the stream. More...
 
virtual const ContactgetRemoteAddress () const override
 Get the address of the remote side of the stream. More...
 
virtual void interrupt () override
 Interrupt the stream. More...
 
virtual void close () override
 Terminate the stream. More...
 
virtual void closeMain ()
 
virtual void flush () override
 Make sure all pending write operations are finished. More...
 
virtual bool isOk () const override
 Check if the stream is ok or in an error state. More...
 
virtual void reset () override
 Reset the stream. More...
 
virtual void beginPacket () override
 Mark the beginning of a logical packet. More...
 
virtual void endPacket () override
 Mark the end of a logical packet (see beginPacket). More...
 
yarp::os::Bytes getMonitor ()
 
virtual bool setTypeOfService (int tos) override
 
virtual int getTypeOfService () override
 
void setMonitor (const yarp::os::Bytes &data)
 
void removeMonitor ()
 
virtual void onMonitorInput ()
 
virtual void onMonitorOutput ()
 
- Public Member Functions inherited from yarp::os::TwoWayStream
virtual ~TwoWayStream ()
 Destructor. More...
 
- Public Member Functions inherited from yarp::os::InputStream
 InputStream ()
 Constructor. More...
 
virtual ~InputStream ()
 Destructor. More...
 
virtual void check ()
 Perform maintenance actions, if needed. More...
 
virtual int read ()
 Read and return a single byte. More...
 
virtual yarp::conf::ssize_t read (Bytes &b, size_t offset, yarp::conf::ssize_t len)
 Read a block of data from the stream. More...
 
virtual yarp::conf::ssize_t partialRead (yarp::os::Bytes &b)
 Like read, but solicit partial responses. More...
 
virtual bool setReadTimeout (double timeout)
 Set activity timeout. More...
 
std::string readLine (int terminal='\n', bool *success=nullptr)
 Read a block of text terminated with a specific marker (or EOF). More...
 
yarp::conf::ssize_t readFull (Bytes &b)
 Keep reading until buffer is full. More...
 
yarp::conf::ssize_t readDiscard (size_t len)
 Read and discard a fixed number of bytes. More...
 
- Public Member Functions inherited from yarp::os::OutputStream
virtual ~OutputStream ()
 Destructor. More...
 
virtual void write (char ch)
 Write a single byte to the stream. More...
 
virtual void write (const Bytes &b, int offset, int len)
 Write a block of bytes to the stream. More...
 
virtual void writeLine (const char *data, int len)
 Write some text followed by a line feed. More...
 
virtual bool setWriteTimeout (double timeout)
 Set activity timeout. More...
 

Private Attributes

DgramTwoWayStreamdelegate
 
yarp::sig::ImageOf< yarp::sig::PixelRgbimg
 
yarp::sig::ImageNetworkHeader imgHeader
 
BlobNetworkHeader blobHeader
 
int phase
 
char * cursor
 
int remaining
 
H264Decoderdecoder
 
h264Decoder_cfgParamters cfg
 

Additional Inherited Members

- Public Types inherited from yarp::os::InputStream
typedef void(* readEnvelopeCallbackType) (void *, const yarp::os::Bytes &envelope)
 Callback type for setting the envelope from a message in carriers that cannot be escaped. More...
 

Constructor & Destructor Documentation

◆ H264Stream()

H264Stream::H264Stream ( h264Decoder_cfgParamters config)

Definition at line 30 of file H264Stream.cpp.

◆ ~H264Stream()

H264Stream::~H264Stream ( )
virtual

Definition at line 40 of file H264Stream.cpp.

Member Function Documentation

◆ getInputStream()

InputStream & H264Stream::getInputStream ( )
overridevirtual

Get an InputStream to read from.

Returns
the InputStream associated with this object.

Reimplemented from yarp::os::impl::DgramTwoWayStream.

Definition at line 74 of file H264Stream.cpp.

◆ getOutputStream()

OutputStream & H264Stream::getOutputStream ( )
overridevirtual

Get an OutputStream to write to.

Returns
the InputStream associated with this object.

Reimplemented from yarp::os::impl::DgramTwoWayStream.

Definition at line 79 of file H264Stream.cpp.

◆ read()

yarp::conf::ssize_t H264Stream::read ( Bytes b)
overridevirtual

Read a block of data from the stream.

Should block and wait for data.

Parameters
b[out]the block of data to read to
Returns
the number of bytes read, or -1 upon error

Reimplemented from yarp::os::impl::DgramTwoWayStream.

Definition at line 94 of file H264Stream.cpp.

◆ setReadEnvelopeCallback()

bool H264Stream::setReadEnvelopeCallback ( InputStream::readEnvelopeCallbackType  callback,
void *  data 
)
overridevirtual

Install a callback that the InputStream will have to call when the envelope is read from a message in carriers that cannot be escaped.

Parameters
callbackthe callback to execute
dataa pointer that should be passed as first parameter to the callback function
Returns
true iff the callback was installed.

Reimplemented from yarp::os::InputStream.

Definition at line 89 of file H264Stream.cpp.

◆ setStream()

bool H264Stream::setStream ( yarp::os::impl::DgramTwoWayStream stream)

Definition at line 57 of file H264Stream.cpp.

◆ start()

void H264Stream::start ( void  )

Definition at line 67 of file H264Stream.cpp.

◆ write()

void H264Stream::write ( const Bytes b)
overridevirtual

Write a block of bytes to the stream.

Parameters
bthe bytes to write

Reimplemented from yarp::os::impl::DgramTwoWayStream.

Definition at line 238 of file H264Stream.cpp.

Member Data Documentation

◆ blobHeader

BlobNetworkHeader yarp::os::H264Stream::blobHeader
private

Definition at line 34 of file H264Stream.h.

◆ cfg

h264Decoder_cfgParamters yarp::os::H264Stream::cfg
private

Definition at line 39 of file H264Stream.h.

◆ cursor

char* yarp::os::H264Stream::cursor
private

Definition at line 36 of file H264Stream.h.

◆ decoder

H264Decoder* yarp::os::H264Stream::decoder
private

Definition at line 38 of file H264Stream.h.

◆ delegate

DgramTwoWayStream* yarp::os::H264Stream::delegate
private

Definition at line 31 of file H264Stream.h.

◆ img

yarp::sig::ImageOf<yarp::sig::PixelRgb> yarp::os::H264Stream::img
private

Definition at line 32 of file H264Stream.h.

◆ imgHeader

yarp::sig::ImageNetworkHeader yarp::os::H264Stream::imgHeader
private

Definition at line 33 of file H264Stream.h.

◆ phase

int yarp::os::H264Stream::phase
private

Definition at line 35 of file H264Stream.h.

◆ remaining

int yarp::os::H264Stream::remaining
private

Definition at line 37 of file H264Stream.h.


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