18#include <catch2/catch_amalgamated.hpp>
21TEST_CASE(
"pm::image_compression_ffmpegTest",
"[yarp::pm]")
23 YARP_REQUIRE_PLUGIN(
"image_compression_ffmpeg",
"portmonitor")
37 TestCarrier(
"fast_tcp",
true),
38 TestCarrier(
"fast_tcp+send.portmonitor+file.image_compression_ffmpeg+type.dll+recv.portmonitor+file.image_compression_ffmpeg+type.dll",
true),
39 TestCarrier(
"fast_tcp+send.portmonitor+file.image_compression_ffmpeg+encoder.mpeg2video+qmin.3+type.dll+recv.portmonitor+file.image_compression_ffmpeg+decoder.mpeg2video+qmin.3+type.dll",
true),
40 TestCarrier(
"fast_tcp+send.portmonitor+file.image_compression_ffmpeg+encoder.h264+type.dll+recv.portmonitor+file.image_compression_ffmpeg+decoder.h264+type.dll",
false),
41 TestCarrier(
"fast_tcp+send.portmonitor+file.image_compression_ffmpeg+encoder.h265+type.dll+recv.portmonitor+file.image_compression_ffmpeg+decoder.h265+type.dll",
false),
42 TestCarrier(
"fast_tcp+send.portmonitor+file.image_compression_ffmpeg+encoder.mjpeg+pixel_format.0+color_range.jpeg+type.dll+recv.portmonitor+file.image_compression_ffmpeg+decoder.mjpeg+pixel_format.0+color_range.jpeg+type.dll",
false),
43 TestCarrier(
"fast_tcp+send.portmonitor+file.image_compression_ffmpeg+encoder.mjpeg+pixel_format.12+strict.-2+type.dll+recv.portmonitor+file.image_compression_ffmpeg+decoder.mjpeg+pixel_format.12+strict.-2+type.dll",
false)
46 SECTION(
"Test that normally the portmonitor is not used")
52 receiver.
open(
"/recv");
62 constexpr double maxWaitSeconds = 5.0;
63 constexpr double pollIntervalSeconds = 0.1;
66 while (elapsed < maxWaitSeconds)
68 imgrecv = receiver.
read(
false);
69 if (imgrecv !=
nullptr)
74 elapsed += pollIntervalSeconds;
77 if (imgrecv !=
nullptr)
79 CHECK(imgrecv->
width() == 640);
80 CHECK(imgrecv->
height() == 480);
90 std::string ss =
"Non mandatory test failed with carrier: " + tc.carrier;
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
T * read(bool shouldWait=true) override
Read an available object from the port.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
T & prepare()
Access the object which will be transmitted by the next call to yarp::os::BufferedPort::write.
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
static bool setLocalMode(bool flag)
Chooses whether communication is process-local.
Utilities for manipulating the YARP network, including initialization and shutdown.
size_t width() const
Gets width of image in pixels.
void resize(size_t imgWidth, size_t imgHeight)
Reallocate an image to be of a desired size, throwing away its current contents.
size_t height() const
Gets height of image in pixels.
TEST_CASE("pm::image_compression_ffmpegTest", "[yarp::pm]")
void delay(double seconds)
Wait for a certain number of seconds.
The main, catch-all namespace for YARP.