6 #ifndef IFM3D_RTSP_RTSP_CLIENT_H
7 #define IFM3D_RTSP_RTSP_CLIENT_H
17 #include <ifm3d/common/err.h>
18 #include <ifm3d/device/device.h>
19 #include <ifm3d/device/o3r.h>
20 #include <ifm3d/fg/buffer.h>
21 #include <ifm3d/rtsp/frame_metadata.h>
22 #include <ifm3d/rtsp/module_rtsp.h>
23 #include <ifm3d/rtsp/nal_unit.h>
47 using Ptr = std::shared_ptr<RtspClient>;
93 std::optional<std::string>
url;
96 std::uint16_t port = 8554;
99 std::string stream_path =
"port1";
120 using NalUnitCallback = std::function<void(
const ifm3d::NalUnit&)>;
121 using ErrorCallback = std::function<void(
const ifm3d::Error&)>;
122 using StateChangeCallback = std::function<void(
State)>;
177 std::shared_future<
void> Start();
184 std::shared_future<
void> Stop();
187 [[nodiscard]]
bool IsRunning() const;
190 [[nodiscard]]
State GetState() const;
196 void OnNewFrame(NewFrameCallback callback =
nullptr);
199 void OnNalUnit(NalUnitCallback callback =
nullptr);
202 void OnError(ErrorCallback callback =
nullptr);
205 void OnStateChange(StateChangeCallback callback =
nullptr);
209 std::unique_ptr<Impl> _impl;
The class Buffer represent a STL container to store data from the ifm devices in 2 dimension and supp...
Definition: buffer.h:99
Exception wrapper for library and system errors encountered by the library.
Definition: err.h:126
RTSP/1.0 client that streams H.264 video from an ifm device and, optionally, decodes it into ifm3d::B...
Definition: rtsp_client.h:45
OutputFormat
Pixel layout of decoded frames delivered to OnNewFrame.
Definition: rtsp_client.h:71
State
Lifecycle state of the RTSP session.
Definition: rtsp_client.h:60
RtspClient(ifm3d::Device::Ptr device, const ifm3d::PortInfo &port, Config config)
Constructs a client for a specific port, deriving the RTSP port and stream path from the port's adver...
Transport
RTP transport used for the media stream.
Definition: rtsp_client.h:51
RtspClient(ifm3d::Device::Ptr device)
Constructs a client that streams from the given device using the default configuration.
RtspClient(ifm3d::Device::Ptr device, const ifm3d::PortInfo &port)
Constructs a client for a specific port, deriving the RTSP port and stream path from the port's adver...
RtspClient(ifm3d::Device::Ptr device, Config config)
Constructs a client that streams from the given device.
A single, fully reassembled H.264 NAL unit.
Definition: nal_unit.h:31
Configuration for an RtspClient instance.
Definition: rtsp_client.h:87
std::optional< std::string > decoder
Optional decoder selection.
Definition: rtsp_client.h:110
std::optional< std::string > url
Full RTSP URL override (e.g.
Definition: rtsp_client.h:93