From patchwork Tue Mar 24 17:56:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 3310 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com Return-Path: Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D0CB62BEB for ; Tue, 24 Mar 2020 18:57:14 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=es-iitr-ac-in.20150623.gappssmtp.com header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.b="L9HAGOc8"; dkim-atps=neutral Received: by mail-pj1-x1044.google.com with SMTP id v13so1929006pjb.0 for ; Tue, 24 Mar 2020 10:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dNTjpE4aJ2HhzaxdksRpZD9ZJFccgdF6ws3erMNs82o=; b=L9HAGOc8G9BBb32pnUqHNA9xqWr/WwGtKZjupUEOQDQShY79zb9P3RDeFdnhrXWJ97 NCL3KBFLuHHqyyNnQsNSifgwb38LLrjSxvl8FSPHNrOzBmJZwZLvCzXXwEuAAZaD3Ad6 JsCyMIh6iD0uplH19S9HfR5E4awliusumX6AULk5O/0ueF/tys9kBxgQt60y7NIqNsGE 7aCM0m5NOZK3hZeObp4XEIBF7CKKMfeJBdQoFfSIXL+cqZs2Zo3OxBqjVzCJwVIKUtog 7x9i6gN+zDdyuqBxMLP1jHYwldhyOund1jRrKWKO0Mm0tYtgeojb0ZcrBVFqxXJtRntN avpQ== 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=dNTjpE4aJ2HhzaxdksRpZD9ZJFccgdF6ws3erMNs82o=; b=EUtPjqOGTLkdwoi7Tbv4KPmAUwbtdnNkNaM+GI+CUhLQkAxqZFAP+vdYmOB0G5+b/+ JxJKCIFwLPBP9zsYTE9NS5/lNnFIEYbHbBpv+LgGbzJiY8MZrVg9TJ737kib0guKUDO6 ASmuPDP4qJRFZgJR1rp+jCLvlZPayjzqwmzcCK0MT1rmWeRHWUQN5PucTogRjsoJnbS/ eBWICe6O1yFwYSBzpCkF+zJvILOxEsuUQ1jX07lxLygI/73bgW9gE0ZGL7OcR9ufWEij cghx4D+3hmamVXHj2biBWJIZHKpP/lpI6Vz9O/eLI4o3yV1gjQcldPzs8Sa5BJT5r/Zz sQyA== X-Gm-Message-State: ANhLgQ13OhVxKyUQgKZsfyXs8/Fs1GLNkfe9uB9NS5a2M0Ihtoz+1sDw Cj/pbecgg3lrrPbWrtfUYZZBIQ== X-Google-Smtp-Source: ADFU+vvEz+Lq6Si4B7AhWju30c+CYcDGtoq57FTZuGO98E2u/XBBKpuAJP0IKpnBlC1PbdaMHN0K0A== X-Received: by 2002:a17:902:bb92:: with SMTP id m18mr28265022pls.46.1585072632929; Tue, 24 Mar 2020 10:57:12 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.154]) by smtp.gmail.com with ESMTPSA id b17sm16774962pff.81.2020.03.24.10.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 10:57:12 -0700 (PDT) From: Kaaira Gupta To: libcamera-devel@lists.libcamera.org, Kieran Bingham , Helen Koike , Vaishali Thakkar Cc: Kaaira Gupta Date: Tue, 24 Mar 2020 23:26:43 +0530 Message-Id: <20200324175643.22382-4-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200324175643.22382-1-kgupta@es.iitr.ac.in> References: <20200324175643.22382-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH v2 3/3] libcamera: pipeline: ipu3: Use parameterized StreamConfiguration 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: , X-List-Received-Date: Tue, 24 Mar 2020 17:57:14 -0000 Replace default constructor StreamConfiguration() by its parameterized counterpart by using StreamFormats in generateConfiguration() in ipu3 Signed-off-by: Kaaira Gupta --- src/libcamera/pipeline/ipu3/ipu3.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 36f3990..1400099 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -399,9 +399,18 @@ CameraConfiguration *PipelineHandlerIPU3::generateConfiguration(Camera *camera, }; config = new IPU3CameraConfiguration(camera, data); + ImgUDevice *imgu = data->imgu_; + V4L2VideoDevice *dev = (imgu->output_).dev; + auto formats = (*dev).formats(); + + /* We find the range of the only pixel format that the driver upports. */ + std::vector range = formats[V4L2PixelFormat(PixelFormat(DRM_FORMAT_NV12))]; + std::map> pixelformats; + pixelformats[PixelFormat(DRM_FORMAT_NV12)] = {range}; for (const StreamRole role : roles) { - StreamConfiguration cfg = {}; + StreamFormats format(pixelformats); + StreamConfiguration cfg(format); IPU3Stream *stream = nullptr; cfg.pixelFormat = PixelFormat(DRM_FORMAT_NV12);