From patchwork Sat Mar 30 21:33:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 10878597 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D955D15AC for ; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB1FB288B5 for ; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB4C6288B6; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B322288B2 for ; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730638AbfC3Vgd (ORCPT ); Sat, 30 Mar 2019 17:36:33 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45069 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730395AbfC3Vgc (ORCPT ); Sat, 30 Mar 2019 17:36:32 -0400 Received: by mail-wr1-f65.google.com with SMTP id s15so6908161wra.12 for ; Sat, 30 Mar 2019 14:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=QPC/0lED49+IBZ6vO8lGlkFuv2ulajJkH3L3H4F5Ytc=; b=qT/M5hh+TThR1LzcFFnLS0hn8uwFClYfoMpFlg4NYWTzWW+LkTThvxo9yOJ6RjLJE8 fqy+9g+9yH34L+qDisRyrfwik21uS4AK92o9whYxhjcO8kHEXEIHYV9Q7QgaZmodKQDp rIx5m1utYwA8wGdm4btFUoWxLcg1lNLPiRywmJQxONjoTOLu87kyWz1KxFmpjoUG42+h TQuKeFlngSh6Bdga4Y20iPRrP94MY5LgjIajFcHrHctZR/Mel2tuHLYNdyHvkFLWU1pk 2ZScqTr+U9+iQKB7R4g2sfIVeVNfK3Uf3slHqfY8yNye639/3COLQaHNCWD4X3NFPi5V fnvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QPC/0lED49+IBZ6vO8lGlkFuv2ulajJkH3L3H4F5Ytc=; b=pMBGF9phAm5dmYbuxhxlZg52/xEpLlq6yG/BUi0iYFmXcSF1ln2+Dtm+iUH6xotbt0 cprbSpALU/2aIKs8szg7GSgMFUGBc9y9fCrXYPx7tBoCRAU8FNE7SM1HC0gUdI0Dd7Yg meA8OkDy4GZmnDDiHfnqVMZ8yQ4PmNrm5sr3smaPY2wDzlti/ip2TWy7zHb7+IXmUB/U MSHeI0SDJ3UwsYAqozY+eXYFC/uC+j8U6nW4fZFoUtrrV391T/hyUvi+62JcTxRnov7G BxVlQnHIkNTscbtmMc/qX/K/YzC+ijDKfClJBJb3A1DmzGUsK0H+IofZUcPm7tfPYMX3 r9kg== X-Gm-Message-State: APjAAAUrNihurTTQKY+mO5uObjgfJods0ZquzQpSGeCFasTPeQ8SM+Pg Yz8xupw84QdGnP4K+U62FT2Cr7S31fw= X-Google-Smtp-Source: APXvYqzQtutaRGUGaW041w4IPvi7oP4vmjKw3GLhPWZdlPU7sJO8P5xERAAMBfsP97zM9SxWEheC8Q== X-Received: by 2002:a5d:6b43:: with SMTP id x3mr38503858wrw.76.1553981790843; Sat, 30 Mar 2019 14:36:30 -0700 (PDT) Received: from localhost.localdomain (ip5f5ab07d.dynamic.kabel-deutschland.de. [95.90.176.125]) by smtp.gmail.com with ESMTPSA id s10sm6066144wmh.0.2019.03.30.14.36.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2019 14:36:29 -0700 (PDT) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, helen.koike@collabora.com, Dafna Hirschfeld Subject: [PATCH v4l-utils 1/3] v4l2-ctl: declare hdr variable as const Date: Sat, 30 Mar 2019 14:33:39 -0700 Message-Id: <20190330213341.107939-1-dafna3@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP declare the hdr param with 'const' in functions that use fwht header in order to set the fwht stateless params. Signed-off-by: Dafna Hirschfeld --- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 85f97722..28bc8c68 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -837,7 +837,7 @@ static int alloc_fwht_req(int media_fd, unsigned index) return 0; } -static void set_fwht_req_by_idx(unsigned idx, struct fwht_cframe_hdr *hdr, +static void set_fwht_req_by_idx(unsigned idx, const struct fwht_cframe_hdr *hdr, __u64 last_bf_ts, __u64 ts) { struct v4l2_ctrl_fwht_params fwht_params; @@ -857,7 +857,7 @@ static int get_fwht_req_by_ts(__u64 ts) return -1; } -static bool set_fwht_req_by_fd(struct fwht_cframe_hdr *hdr, +static bool set_fwht_req_by_fd(const struct fwht_cframe_hdr *hdr, int req_fd, __u64 last_bf_ts, __u64 ts) { struct v4l2_ctrl_fwht_params fwht_params; @@ -874,7 +874,7 @@ static bool set_fwht_req_by_fd(struct fwht_cframe_hdr *hdr, return false; } -static int set_fwht_ext_ctrl(cv4l_fd &fd, struct fwht_cframe_hdr *hdr, +static int set_fwht_ext_ctrl(cv4l_fd &fd, const struct fwht_cframe_hdr *hdr, __u64 last_bf_ts, int req_fd) { v4l2_ext_controls controls; From patchwork Sat Mar 30 21:33:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 10878599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EFD441874 for ; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC02A288B2 for ; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2DC8288DA; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BF26288B3 for ; Sat, 30 Mar 2019 21:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730692AbfC3Vge (ORCPT ); Sat, 30 Mar 2019 17:36:34 -0400 Received: from mail-wr1-f51.google.com ([209.85.221.51]:46336 "EHLO mail-wr1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730563AbfC3Vgd (ORCPT ); Sat, 30 Mar 2019 17:36:33 -0400 Received: by mail-wr1-f51.google.com with SMTP id t17so6887456wrw.13 for ; Sat, 30 Mar 2019 14:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aFvF0Q4D0PukKPG4/XfOrovojL53MxWzXeQyHZKZkVo=; b=d2HQ+W6skQ44Ua6xNlKENMqJXrRxBl3XzaHJfuWWGx3g/DKyuSkRMZYkvHl9VgQGjC 6VTu32uUf1VAsrUiCOVNVB8aQS0g9G2AWh+wCzoHFHILfo6Ia5oSaxTDDS44FSeDBVUB lwvlICVk6aCyvHn4POHOZ4khWnHC1tCV4di52JzNKUGsL6vYyaB3HSl6XzqkKawwt45e guJbP5dkf1oxei2pcpkIhClLsJLlENvLQUqwjF28H+CnHMTmUsxGhGkmCrkP7jtaXRYV VfDuFLerZRz5CJ5F7ubzTBIH3w/VvqtIR9ECQI9V2xFlRD4sqXTEbKi9qF+0FtKcuXfL v29Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aFvF0Q4D0PukKPG4/XfOrovojL53MxWzXeQyHZKZkVo=; b=Du9bT8uRLi3enXyJk29Xa1H1O8N5djL149N9GXzCd5gpqUWKYTNQFGM7wxmqwwp8tq yHZRVvZqimsizBRtE+/c+qbiRZX+TqjGeGNo5vBN5IxAVGkLQhnv3tjLwynI9ayyHhUh Nq7ZyI72jb8Y09+jMCAPasBHcSSxXpknfEcu3Et99pL15JtNAdd6L2gSzlbKkF1uwMH4 lDQE0FD0EGTLHFusHSwBTN4vohtgIrSFEAD2zs2gW6eWp5vKnC1MrlMu0C3YeGFwVpks r5HCBQMsY60UmpiyuRoEELaQNqFcLcIz+UyF0ue8UTToSeaLEKQHuAQhuW4uTky42HmM 1KLg== X-Gm-Message-State: APjAAAVLD+yoI0vhW+YIymQoSsoGiW34iG/pxlhE18t+Y/wFb70pnpal /tRaOI3iyUPGFeVUyw9XFyZ5fjuexJ4= X-Google-Smtp-Source: APXvYqymnSDtIviVxxJ/vscpd6r+JQivreGHeYvxorWFtyM9cNLy28BSSnV1/D8NmfrO/H+Qa6YMow== X-Received: by 2002:a5d:4d42:: with SMTP id a2mr38327832wru.130.1553981791894; Sat, 30 Mar 2019 14:36:31 -0700 (PDT) Received: from localhost.localdomain (ip5f5ab07d.dynamic.kabel-deutschland.de. [95.90.176.125]) by smtp.gmail.com with ESMTPSA id s10sm6066144wmh.0.2019.03.30.14.36.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2019 14:36:31 -0700 (PDT) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, helen.koike@collabora.com, Dafna Hirschfeld Subject: [PATCH v4l-utils 2/3] v4l2-ctl: fix debug prints Date: Sat, 30 Mar 2019 14:33:40 -0700 Message-Id: <20190330213341.107939-2-dafna3@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190330213341.107939-1-dafna3@gmail.com> References: <20190330213341.107939-1-dafna3@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP replace 'set_fwht_ext_ctrls' with 'set_fwht_ext_ctrl' in debug prints Signed-off-by: Dafna Hirschfeld --- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 28bc8c68..daa93968 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -1249,7 +1249,7 @@ static int do_setup_out_buffers(cv4l_fd &fd, cv4l_queue &q, FILE *fin, bool qbuf if (set_fwht_ext_ctrl(fd, &last_fwht_hdr, last_fwht_bf_ts, buf.g_request_fd())) { - fprintf(stderr, "%s: set_fwht_ext_ctrls failed on %dth buf: %s\n", + fprintf(stderr, "%s: set_fwht_ext_ctrl failed on %dth buf: %s\n", __func__, i, strerror(errno)); return QUEUE_ERROR; } @@ -1539,7 +1539,7 @@ static int do_handle_out(cv4l_fd &fd, cv4l_queue &q, FILE *fin, cv4l_buffer *cap if (set_fwht_ext_ctrl(fd, &last_fwht_hdr, last_fwht_bf_ts, buf.g_request_fd())) { - fprintf(stderr, "%s: set_fwht_ext_ctrls failed: %s\n", + fprintf(stderr, "%s: set_fwht_ext_ctrl failed: %s\n", __func__, strerror(errno)); return QUEUE_ERROR; } From patchwork Sat Mar 30 21:33:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 10878601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D979139A for ; Sat, 30 Mar 2019 21:36:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89EAF288B2 for ; Sat, 30 Mar 2019 21:36:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DBA1288B5; Sat, 30 Mar 2019 21:36:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19C65288B2 for ; Sat, 30 Mar 2019 21:36:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730725AbfC3Vgf (ORCPT ); Sat, 30 Mar 2019 17:36:35 -0400 Received: from mail-wr1-f48.google.com ([209.85.221.48]:32797 "EHLO mail-wr1-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730395AbfC3Vgf (ORCPT ); Sat, 30 Mar 2019 17:36:35 -0400 Received: by mail-wr1-f48.google.com with SMTP id q1so6949880wrp.0 for ; Sat, 30 Mar 2019 14:36:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gg0RoNdHzgiz8shIEh3iitwCcykj9Z0AcA1mVIWiVfs=; b=pCK8jzR2/N304y/hjmub6sXlMOUzJCLTffbywAXdYaVyymY5ZbZm7UPdmenE3r7FMl GCFcOmtddkt8MPjDXcl86RgK3ScbE4uQQdAW8JkFKYpH75pAwYOC8lVoREHfVwSeL4fy gsoz/NWala9bmk+5a3w3yaEUnI4woENnxGThzBWMZXpjKjn+5W6I1W8/dOwV8iyvAdXC ogweyHdDWT2HsfwLMG+l4jnj+yxVoXmFuW/RRa93Vo5fCxDnji6bhDCW5QtrCxDl86Vv QE2z1Hng5Es+5gOR+uVV2aZ0DBUNGC8ow2Cr5EoXYQQ2UYe2+Qu24uQka7iWOcNTi7dK 6QhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gg0RoNdHzgiz8shIEh3iitwCcykj9Z0AcA1mVIWiVfs=; b=KfKfpazdli8hqbNjUtWLW7HAEhuoHtgOddC6x80iemTbr4xTRQT3E63WxQNpDPwHJG Hc4WPFM0NIwD+QLAkg983Y8EEexhjAlf8xxK7wPJ5V7VyxAdlyk51GnCamKUCup7WLE5 0yvgP9+G/IhLlw7sdROhazN2ZaAh0OoYl497Grj+sB0S+lskGaVLPg+M3WsFbf4goG/K rRUJnKjVwxyTyggsJbE3HmTJFL48Y483DaVjBKSLqwELCTbW0iWQQI9q2gFhBI9f2Uwr I1X6nzGHYUFvcqzdhoX5QAJjZM0WqL14hmJy9uVZIRXX6UPRRF3PZe2Bct9DtDANnKoT IEQA== X-Gm-Message-State: APjAAAUle702bHpbSW9/ENfbqE57FT5iYynCOTD6GK3SrABKYQvgpfiX N5ZAhkRhhTsUIOIFb+cL8TlhAv5Usa8= X-Google-Smtp-Source: APXvYqyibO2BbuPfjVGrALjzsG9qf2j/BI/bsvMHZc0Zo8QfeBqkiUE/SMXtYSOtcAnjL9it3vwekA== X-Received: by 2002:adf:c7c8:: with SMTP id y8mr38855589wrg.149.1553981792944; Sat, 30 Mar 2019 14:36:32 -0700 (PDT) Received: from localhost.localdomain (ip5f5ab07d.dynamic.kabel-deutschland.de. [95.90.176.125]) by smtp.gmail.com with ESMTPSA id s10sm6066144wmh.0.2019.03.30.14.36.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2019 14:36:32 -0700 (PDT) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, helen.koike@collabora.com, Dafna Hirschfeld Subject: [PATCH v4l-utils 3/3] v4l2-ctl: add support for fwht stateless decoder Date: Sat, 30 Mar 2019 14:33:41 -0700 Message-Id: <20190330213341.107939-3-dafna3@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190330213341.107939-1-dafna3@gmail.com> References: <20190330213341.107939-1-dafna3@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP adjust the code to support both encoder and decoder for stateless fwht Signed-off-by: Dafna Hirschfeld --- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index daa93968..0d3c89ef 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -82,6 +82,7 @@ static unsigned int composed_height; static bool support_cap_compose; static bool support_out_crop; static bool in_source_change_event; +static bool is_stateless; static __u64 last_fwht_bf_ts; static fwht_cframe_hdr last_fwht_hdr; @@ -1234,7 +1235,7 @@ static int do_setup_out_buffers(cv4l_fd &fd, cv4l_queue &q, FILE *fin, bool qbuf if (fin && !fill_buffer_from_file(fd, q, buf, fmt, fin)) return QUEUE_STOPPED; - if (fmt.g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS) { + if (is_stateless) { int media_fd = mi_get_media_fd(fd.g_fd()); if (media_fd < 0) { @@ -1268,7 +1269,7 @@ static int do_setup_out_buffers(cv4l_fd &fd, cv4l_queue &q, FILE *fin, bool qbuf if (!--stream_count) return QUEUE_STOPPED; } - if (fmt.g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS) { + if (is_stateless) { set_fwht_req_by_idx(i, &last_fwht_hdr, last_fwht_bf_ts, buf.g_timestamp_ns()); last_fwht_bf_ts = buf.g_timestamp_ns(); @@ -1530,7 +1531,7 @@ static int do_handle_out(cv4l_fd &fd, cv4l_queue &q, FILE *fin, cv4l_buffer *cap (u8 *)q.g_dataptr(buf.g_index(), j)); } - if (fmt.g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS) { + if (is_stateless) { if (ioctl(buf.g_request_fd(), MEDIA_REQUEST_IOC_REINIT, NULL)) { fprintf(stderr, "Unable to reinit media request: %s\n", strerror(errno)); @@ -1551,7 +1552,7 @@ static int do_handle_out(cv4l_fd &fd, cv4l_queue &q, FILE *fin, cv4l_buffer *cap fprintf(stderr, "%s: failed: %s\n", "VIDIOC_QBUF", strerror(errno)); return QUEUE_ERROR; } - if (fmt.g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS) { + if (is_stateless) { if (!set_fwht_req_by_fd(&last_fwht_hdr, buf.g_request_fd(), last_fwht_bf_ts, buf.g_timestamp_ns())) { fprintf(stderr, "%s: request for fd %d does not exist\n", @@ -2392,7 +2393,12 @@ static void stateless_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out, unsigned count[2] = { 0, 0 }; int fd_flags = fcntl(fd.g_fd(), F_GETFL); bool stopped = false; + enum codec_type codec_type = get_codec_type(fd); + if (codec_type == ENCODER) { + last_fwht_hdr.width = htonl(cropped_width); + last_fwht_hdr.height = htonl(cropped_height); + } if (out.reqbufs(&fd, reqbufs_count_out)) { fprintf(stderr, "%s: out.reqbufs failed\n", __func__); return; @@ -2576,7 +2582,9 @@ static void streaming_set_m2m(cv4l_fd &fd, cv4l_fd &exp_fd) if (out.export_bufs(&exp_fd, exp_fd.g_type())) goto done; } - if (fmt[OUT].g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS) + is_stateless = fmt[OUT].g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS || + fmt[CAP].g_pixelformat() == V4L2_PIX_FMT_FWHT_STATELESS; + if (is_stateless) stateless_m2m(fd, in, out, file[CAP], file[OUT], fmt[CAP], fmt[OUT], exp_fd_p); else stateful_m2m(fd, in, out, file[CAP], file[OUT], fmt[CAP], fmt[OUT], exp_fd_p);