{"id":3505,"url":"https://patchwork.libcamera.org/api/patches/3505/?format=json","web_url":"https://patchwork.libcamera.org/patch/3505/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200421203954.15585-2-andrey.konovalov@linaro.org>","date":"2020-04-21T20:39:53","name":"[libcamera-devel,1/2] libcamera: pipeline: simple: make sure the formats at the link's pads match","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"058a4db5ff43159d1e36cfd1168b6cbe845046d2","submitter":{"id":25,"url":"https://patchwork.libcamera.org/api/people/25/?format=json","name":"Andrey Konovalov","email":"andrey.konovalov@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3505/mbox/","series":[{"id":818,"url":"https://patchwork.libcamera.org/api/series/818/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=818","date":"2020-04-21T20:39:52","name":"Simple pipeline: skip broken pipeline configurations","version":1,"mbox":"https://patchwork.libcamera.org/series/818/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3505/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3505/checks/","tags":{},"headers":{"Return-Path":"<andrey.konovalov@linaro.org>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1295C62E5D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Apr 2020 22:40:14 +0200 (CEST)","by mail-lf1-x141.google.com with SMTP id h6so12252519lfc.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Apr 2020 13:40:14 -0700 (PDT)","from localhost.localdomain (37-144-159-139.broadband.corbina.ru.\n\t[37.144.159.139]) by smtp.googlemail.com with ESMTPSA id\n\tg6sm476176ljj.78.2020.04.21.13.40.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 21 Apr 2020 13:40:12 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=linaro.org\n\theader.i=@linaro.org header.b=\"PqfAQpxh\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=Jp8I93rfYbbgqNsWDUtvye4rtb6PlZHefKLZKxV+ZFI=;\n\tb=PqfAQpxhlqqQZxshqgP77mXYdkyhlEe1Ly0JLeTH6qe9KZFXBmxJE544O3sZn5rGfQ\n\tDf2wnBAcIMfdYQXgZSqMiWOG21yTVdBtXI2iGRl5+zEDeruX2m1uH4A/0T89SiR5AnZb\n\tz100iQa60wTnDXdN5U3wmWIUFeTy/tNbRT4Y+9J3hqdIOLBe/r6uPFd/ZweAp5tjCM7P\n\tCcvsv4M4vLz6NsjnuImD8F3fj7L+FSBMR0n7QhXq2AP9b4n1aF2sEf0J3ECcQfHHFt1c\n\tqxZnO3PChqLrxfKDQ+8k9guW+7G70f0C7sqWUN+G7ce/rd2BgpAvDklgpTBpbL/KS5Np\n\tDVjw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Jp8I93rfYbbgqNsWDUtvye4rtb6PlZHefKLZKxV+ZFI=;\n\tb=NVOgUx2KIvrd5VEYtbBVbBFydSIYJOQjZ5JRG0J7JBFg3W0KMMHUCivV/P+662QJwf\n\tJr9NjHLPMIDY1aaFZKn899QalBtOhivBnHB+o3pdxSOZsoFmJSdtDqTzVp0KW+9kiych\n\t1wehoHbLWwdY39DCUtF3CGuwmwMMzSeEKxRbHIYu3aMGo2xJvoOQck1xlA/FRwwVY0/b\n\tJW/JNVI8ywjFAJ5P2QfYhHDudBCCAAMLuqBEfPCbe70Dl/PrjAnDNEzy++MVI0S4LUJx\n\t+m2nTZ+eXeQQd4qOX5m/XbcpjHJHWOp7JWfZ1jMaWcXnRAySVRiqWtmK3VpeqZeAqnCH\n\tVKQA==","X-Gm-Message-State":"AGi0PuaGJU1XeBVyx2/3BM3Q2UBCTw6aQJyxJh1Ew33mc74rvnzVthO9\n\t/ecv499GbAugNUrj8PTwYHZOdCexfzY=","X-Google-Smtp-Source":"APiQypIHJ9KByf+3+AeDpycG2zQaXlvRb66eX6evb1q5YlBOf5cp3gsbT2nRWRAw5e+c4kzibFcjeQ==","X-Received":"by 2002:a05:6512:3189:: with SMTP id\n\ti9mr14894381lfe.178.1587501613032; \n\tTue, 21 Apr 2020 13:40:13 -0700 (PDT)","From":"Andrey Konovalov <andrey.konovalov@linaro.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 21 Apr 2020 23:39:53 +0300","Message-Id":"<20200421203954.15585-2-andrey.konovalov@linaro.org>","X-Mailer":"git-send-email 2.17.1","In-Reply-To":"<20200421203954.15585-1-andrey.konovalov@linaro.org>","References":"<20200421203954.15585-1-andrey.konovalov@linaro.org>","Subject":"[libcamera-devel] [PATCH 1/2] libcamera: pipeline: simple: make\n\tsure the formats at the link's pads match","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 21 Apr 2020 20:40:14 -0000"},"content":"Change SimpleCameraData::setupFormats() to return -EINVAL if the sink\npad of the link doesn't support the format set on the source pad of this\nlink.\n\nSigned-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n---\n src/libcamera/pipeline/simple/simple.cpp | 12 ++++++++++++\n 1 file changed, 12 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex b5f9177..8212bd9 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -372,6 +372,7 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n \t\tMediaLink *link = e.link;\n \t\tMediaPad *source = link->source();\n \t\tMediaPad *sink = link->sink();\n+\t\tV4L2SubdeviceFormat source_format;\n \n \t\tif (source->entity() != sensor_->entity()) {\n \t\t\tV4L2Subdevice *subdev = pipe->subdev(source->entity());\n@@ -380,11 +381,22 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,\n \t\t\t\treturn ret;\n \t\t}\n \n+\t\tsource_format = *format;\n \t\tif (sink->entity()->function() != MEDIA_ENT_F_IO_V4L) {\n \t\t\tV4L2Subdevice *subdev = pipe->subdev(sink->entity());\n \t\t\tret = subdev->setFormat(sink->index(), format, whence);\n \t\t\tif (ret < 0)\n \t\t\t\treturn ret;\n+\n+\t\t\tif (format->mbus_code != source_format.mbus_code\n+\t\t\t    || format->size != source_format.size) {\n+\t\t\t\tLOG(SimplePipeline, Debug)\n+\t\t\t\t\t<< \"Source pad format isn't supported \"\n+\t\t\t\t\t<< \"by the sink pad of the link: \"\n+\t\t\t\t\t<< \"Source: \" << source_format.toString()\n+\t\t\t\t\t<< \"Sink: \" << format->toString();\n+\t\t\t\treturn -EINVAL;\n+\t\t\t}\n \t\t}\n \n \t\tLOG(SimplePipeline, Debug)\n","prefixes":["libcamera-devel","1/2"]}