diff --git a/components/streams/src/receiver.cpp b/components/streams/src/receiver.cpp index da2a97577ec357ebba436c206fa2a65f1a1fe697..30043cd5f5c31427a3980a95aadeb6b1183d39ec 100644 --- a/components/streams/src/receiver.cpp +++ b/components/streams/src/receiver.cpp @@ -222,9 +222,14 @@ void Receiver::_processVideo(const StreamPacket &spkt, const Packet &pkt) { InternalVideoStates &ividstate = _getVideoFrame(spkt); auto [tx,ty] = ftl::codecs::chooseTileConfig(pkt.frame_count); - int width = ftl::codecs::getWidth(pkt.definition); - int height = ftl::codecs::getHeight(pkt.definition); - int sheight = height; + + int width = ividstate.state.getLeft().width; + int height = ividstate.state.getLeft().height; + + if (width == 0 || height == 0) { + LOG(WARNING) << "No calibration, skipping frame"; + return; + } //LOG(INFO) << " CODEC = " << (int)pkt.codec << " " << (int)pkt.flags << " " << (int)spkt.channel; //LOG(INFO) << "Decode surface: " << (width*tx) << "x" << (height*ty); diff --git a/components/streams/test/receiver_unit.cpp b/components/streams/test/receiver_unit.cpp index 1a00ad4ee04fbfc71876c98536b97350b9a60df3..7ff3df42d4eb7631074fd99801f0a291b4ea8d1e 100644 --- a/components/streams/test/receiver_unit.cpp +++ b/components/streams/test/receiver_unit.cpp @@ -119,7 +119,7 @@ TEST_CASE( "Receiver generating onFrameSet" ) { SECTION("multi-frameset") { cv::cuda::GpuMat m(cv::Size(1280,720), CV_8UC4, cv::Scalar(0)); - ftl::stream::injectCalibration(&stream, dummy, 1, 0, 0); + ftl::stream::injectCalibration(&stream, dummy, 1, 1, 0); bool r = encoder.encode(m, pkt); REQUIRE( r );