From patchwork Fri Mar 14 20:29:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 22960 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A088CC32F7 for ; Fri, 14 Mar 2025 20:30:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4562F68777; Fri, 14 Mar 2025 21:30:06 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="eRgPmSlC"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7B3DF6052C for ; Fri, 14 Mar 2025 21:30:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741984201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5NECn+RS53amMJbuDehxxJwwkT9kl9PtHPS+Sezo5pQ=; b=eRgPmSlChO89RYmUzw5iPvk0vMgQg9psg9hqfXHTRLZ3SigLw8o4dE5Y9j28hVyFuAoGHN Q3E/e59wR8+47x9Sp1bSNNXpydqWL8/TASmVzp7ZlRjZaseMYggQE63sQ8CPCRIpgFb6HC wF/CNr5DaDKAlQJmOPtia24zgNo6YQk= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-27-H7TLuJecMkukaCdJKiA6Aw-1; Fri, 14 Mar 2025 16:29:59 -0400 X-MC-Unique: H7TLuJecMkukaCdJKiA6Aw-1 X-Mimecast-MFC-AGG-ID: H7TLuJecMkukaCdJKiA6Aw_1741984197 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 81B9C19560B6; Fri, 14 Mar 2025 20:29:57 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.32.19]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 275641954B32; Fri, 14 Mar 2025 20:29:54 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Laurent Pinchart Subject: [RFC PATCH 0/7] Support different outputs for cam streams Date: Fri, 14 Mar 2025 21:29:28 +0100 Message-ID: <20250314202943.112109-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: EobVgn1BZu1Pqar_S1UXiubysdaMV_9fKdDV7zGm4aE_1741984197 X-Mimecast-Originator: redhat.com X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" cam application supports multiple streams but only a single kind of output for all of them at the same time. It would be helpful if it was possible to support different outputs for different streams, for example if a processed stream could be sent to display while a raw stream to files or if a processed stream would be written to PPM files while a raw stream to raw files. This patch series implements this (besides some janitorial patches). There are multiple options how to do it. The selected way is to keep the current output command line options, so that things don’t get unnecessarily more complicated for the users, and adding new --stream child options specifying the output. To keep the implementation simpler, it’s not possible to combine the current output options with the newly introduced stream child options. Examples of newly introduced command line options: cam ... -s role=viewfinder,... --stream-display \ -s role=raw,... --stream-file=raw# or cam ... -s role=viewfinder,... --stream-file=processed#.ppm \ -s role=raw,... --stream-file=raw# Milan Zamazal (7): apps: common: Fix flipped error condition apps: cam: Formatting fixes apps: cam: Remove unused imports apps: cam: Add support for multiple sinks apps: cam: Report error on multiple default sinks apps: cam: Track sink streams apps: cam: Add command line options for stream specific outputs src/apps/cam/camera_session.cpp | 140 ++++++++++++++++++++++++++------ src/apps/cam/camera_session.h | 2 +- src/apps/cam/file_sink.cpp | 3 +- src/apps/cam/frame_sink.cpp | 14 ++++ src/apps/cam/frame_sink.h | 26 ++++++ src/apps/cam/kms_sink.cpp | 16 ++-- src/apps/cam/main.cpp | 27 ++++-- src/apps/cam/main.h | 3 + src/apps/cam/sdl_sink.cpp | 19 ++--- src/apps/common/options.cpp | 2 +- 10 files changed, 202 insertions(+), 50 deletions(-)