YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
GstreamerStream Class Reference

#include <gstreamer_carrier/GstreamerStream.h>

+ Inheritance diagram for GstreamerStream:

Public Member Functions

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

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.
 

Detailed Description

Definition at line 20 of file GstreamerStream.h.

Constructor & Destructor Documentation

◆ GstreamerStream()

GstreamerStream::GstreamerStream ( )
inline

Definition at line 29 of file GstreamerStream.h.

◆ ~GstreamerStream()

GstreamerStream::~GstreamerStream ( )
virtual

Definition at line 64 of file GstreamerStream.cpp.

Member Function Documentation

◆ beginPacket()

void GstreamerStream::beginPacket ( )
overridevirtual

Mark the beginning of a logical packet.

This is a unit that should be treated in an atomic fashion by YARP. If any part is corrupted, the whole should be dropped.

Implements yarp::os::TwoWayStream.

Definition at line 225 of file GstreamerStream.cpp.

◆ close()

void GstreamerStream::close ( )
inlineoverridevirtual

Terminate the stream.

Implements yarp::os::TwoWayStream.

Definition at line 67 of file GstreamerStream.h.

◆ closeMain()

void GstreamerStream::closeMain ( )
virtual

Definition at line 92 of file GstreamerStream.cpp.

◆ endPacket()

void GstreamerStream::endPacket ( )
overridevirtual

Mark the end of a logical packet (see beginPacket).

Implements yarp::os::TwoWayStream.

Definition at line 229 of file GstreamerStream.cpp.

◆ getFrame()

yarp::sig::ImageOf< yarp::sig::PixelRgb > * GstreamerStream::getFrame ( )

Definition at line 109 of file GstreamerStream.cpp.

◆ getInputStream()

InputStream & GstreamerStream::getInputStream ( )
inlineoverridevirtual

Get an InputStream to read from.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 42 of file GstreamerStream.h.

◆ getLocalAddress()

const yarp::os::Contact & GstreamerStream::getLocalAddress ( ) const
inlineoverridevirtual

Get the address of the local side of the stream.

Returns
the address of the local side of the stream. The address will be tagged as invalid if the stream is not set up.

Implements yarp::os::TwoWayStream.

Definition at line 52 of file GstreamerStream.h.

◆ getOutputStream()

OutputStream & GstreamerStream::getOutputStream ( )
inlineoverridevirtual

Get an OutputStream to write to.

Returns
the InputStream associated with this object.

Implements yarp::os::TwoWayStream.

Definition at line 47 of file GstreamerStream.h.

◆ getRemoteAddress()

const yarp::os::Contact & GstreamerStream::getRemoteAddress ( ) const
inlineoverridevirtual

Get the address of the remote side of the stream.

Returns
the address of the remote side of the stream. The address will be tagged as invalid if the stream is not set up.

Implements yarp::os::TwoWayStream.

Definition at line 57 of file GstreamerStream.h.

◆ interrupt()

void GstreamerStream::interrupt ( )
overridevirtual

Interrupt the stream.

If the stream is currently in a blocked state, it must be unblocked.

Reimplemented from yarp::os::InputStream.

Definition at line 69 of file GstreamerStream.cpp.

◆ isOk()

bool GstreamerStream::isOk ( ) const
overridevirtual

Check if the stream is ok or in an error state.

Returns
true iff the stream is ok

Implements yarp::os::TwoWayStream.

Definition at line 103 of file GstreamerStream.cpp.

◆ open() [1/2]

bool GstreamerStream::open ( const std::string &  pipeline_string,
const yarp::os::Contact local,
const yarp::os::Contact remote 
)
virtual

Definition at line 39 of file GstreamerStream.cpp.

◆ open() [2/2]

bool GstreamerStream::open ( const std::string &  pipeline_string,
const yarp::os::Contact remote 
)
virtual

Definition at line 33 of file GstreamerStream.cpp.

◆ prepareNextFrame()

void GstreamerStream::prepareNextFrame ( )

Definition at line 132 of file GstreamerStream.cpp.

◆ read()

yarp::conf::ssize_t GstreamerStream::read ( yarp::os::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

Implements yarp::os::InputStream.

Definition at line 141 of file GstreamerStream.cpp.

◆ reset()

void GstreamerStream::reset ( )
overridevirtual

Reset the stream.

Implements yarp::os::TwoWayStream.

Definition at line 221 of file GstreamerStream.cpp.

◆ write()

void GstreamerStream::write ( const yarp::os::Bytes b)
overridevirtual

Write a block of bytes to the stream.

Parameters
bthe bytes to write

Implements yarp::os::OutputStream.

Definition at line 217 of file GstreamerStream.cpp.


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