YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
GstreamerCarrier.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024-2024 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_GSTREAMERCARRIER_H
7#define YARP_GSTREAMERCARRIER_H
8
10
16{
17 std::string pipeline_string;
18
19public:
21
22 Carrier* create() const override;
23
24 std::string getName() const override;
25
26 bool checkHeader(const yarp::os::Bytes& header) override;
27 void getHeader(yarp::os::Bytes& header) const override;
28 void setParameters(const yarp::os::Bytes& header) override;
29 bool requireAck() const override { return false; }
30 bool isConnectionless() const override;
31 bool respondToHeader(yarp::os::ConnectionState& proto) override;
33
35 bool isPush() const override { return false; }
36 bool canAccept() const override { return true; }
37 bool canOffer() const override { return true; }
38 bool isTextMode() const override { return false; }
39 bool canEscape() const override { return false; }
40
41 bool supportReply() const override { return false; }
42
43 bool isLocal() const override { return false; }
44
45 bool prepareSend(yarp::os::ConnectionState& proto) override;
46 bool sendHeader(yarp::os::ConnectionState& proto) override;
48 bool expectExtraHeader(yarp::os::ConnectionState& proto) override;
49 bool isActive() const override
50 {
51 return true;
52 }
53
54 bool expectAck(yarp::os::ConnectionState& proto) override;
55 bool write(yarp::os::ConnectionState& proto, yarp::os::SizedWriter& writer) override;
56 bool reply(yarp::os::ConnectionState& proto, yarp::os::SizedWriter& writer) override;
57 std::string toString() const override;
58 bool expectIndex(yarp::os::ConnectionState& proto) override;
59
60 bool sendAck(yarp::os::ConnectionState& proto) override;
61
62 yarp::os::Face* createFace() const override;
63};
64
65
66/*example:
67gst-launch-1.0 -v videotestsrc ! "video/x-raw, format=(string)RGB, width=(int)640, height=(int)480" ! videoconvert ! openh264enc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=127.0.0.1 port=15000
68gst-launch-1.0 -v videotestsrc ! "video/x-raw, format=(string)I420, width=(int)640, height=(int)480" ! openh264enc ! h264parse ! udpsink host = 127.0.0.1 port = 15000
69yarp name register /gst gstreamer 127.0.0.1 15000
70yarp read /ccc //DEBUG
71yarp connect /gst /ccc gstreamer
72
73*/
74
75#endif
GstreamerCarrier.
bool canOffer() const override
Check if writing is implemented for this carrier.
bool sendAck(yarp::os::ConnectionState &proto) override
Send an acknowledgement, if needed for this carrier.
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
bool expectIndex(yarp::os::ConnectionState &proto) override
Expect a message header, if there is one for this carrier.
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
bool prepareSend(yarp::os::ConnectionState &proto) override
Perform any initialization needed before writing on a connection.
bool canAccept() const override
Check if reading is implemented for this carrier.
bool expectReplyToHeader(yarp::os::ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
bool isTextMode() const override
Check if carrier is textual in nature.
bool sendHeader(yarp::os::ConnectionState &proto) override
Write a header appropriate to the carrier to the connection, followed by any carrier-specific data.
bool reply(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
bool expectExtraHeader(yarp::os::ConnectionState &proto) override
Receive any carrier-specific header.
bool respondToHeader(yarp::os::ConnectionState &proto) override
Respond to the header.
Carrier * create() const override
Factory method.
yarp::os::Face * createFace() const override
Create new Face object that the carrier needs.
bool isPush() const override
Check if carrier is "push" or "pull" style.
bool expectAck(yarp::os::ConnectionState &proto) override
Receive an acknowledgement, if expected for this carrier.
bool checkHeader(const yarp::os::Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
bool isActive() const override
Check if carrier is alive and error free.
bool canEscape() const override
Check if carrier can encode administrative messages, as opposed to just user data.
void setParameters(const yarp::os::Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
void getHeader(yarp::os::Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
bool supportReply() const override
This flag is used by YARP to determine whether the connection can carry RPC traffic,...
bool expectSenderSpecifier(yarp::os::ConnectionState &proto) override
Expect the name of the sending port.
std::string toString() const override
Get name of carrier.
bool isLocal() const override
Check if carrier operates within a single process.
bool write(yarp::os::ConnectionState &proto, yarp::os::SizedWriter &writer) override
Write a message.
A simple abstraction for a block of bytes.
Definition Bytes.h:24
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
Definition Carrier.h:44
The basic state of a connection - route, streams in use, etc.
The initial point-of-contact with a port.
Definition Face.h:20
Minimal requirements for an efficient Writer.
Definition SizedWriter.h:32