@@ -408,4 +408,41 @@ BOOST_AUTO_TEST_CASE(compressionErrorForBigNullImage)
408408 SAFE_BOOST_CHECK_THROW (stream.send (bigImage).get (), std::invalid_argument);
409409}
410410
411+ BOOST_AUTO_TEST_CASE (uncompressedImages)
412+ {
413+ const unsigned int width = 4 ;
414+ const unsigned int height = 4 ;
415+ const unsigned int byte = width * height * 4 ;
416+ std::unique_ptr<uint8_t []> pixels (new uint8_t [byte]);
417+ ::memset (pixels.get(), 0, byte);
418+ deflect::ImageWrapper image (pixels.get (), width, height, deflect::RGBA);
419+ image.compressionPolicy = deflect::COMPRESSION_OFF;
420+
421+ const size_t expectedFrames = 5 ;
422+
423+ setFrameReceivedCallback ([&](deflect::server::FramePtr frame) {
424+ SAFE_BOOST_REQUIRE_EQUAL (frame->tiles .size (), 1 );
425+ SAFE_BOOST_CHECK (frame->tiles [0 ].format == deflect::Format::rgba);
426+ const auto dim = frame->computeDimensions ();
427+ SAFE_BOOST_CHECK_EQUAL (dim.width (), width);
428+ SAFE_BOOST_CHECK_EQUAL (dim.height (), height);
429+ });
430+
431+ deflect::Stream stream (testStreamId.toStdString (), " localhost" ,
432+ serverPort ());
433+ BOOST_REQUIRE (stream.isConnected ());
434+
435+ for (size_t i = 0 ; i < expectedFrames; ++i)
436+ {
437+ stream.sendAndFinish (image).wait ();
438+ requestFrame (testStreamId);
439+
440+ waitForMessage ();
441+
442+ BOOST_CHECK_EQUAL (getReceivedFrames (), i + 1 );
443+ }
444+
445+ BOOST_CHECK_EQUAL (getReceivedFrames (), expectedFrames);
446+ }
447+
411448BOOST_AUTO_TEST_SUITE_END ()
0 commit comments