From patchwork Sat Aug 28 18:18:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vedant Paranjape X-Patchwork-Id: 13562 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 1B192BD87D for ; Sat, 28 Aug 2021 18:18:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 36E906916C; Sat, 28 Aug 2021 20:18:42 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HL3lJVri"; dkim-atps=neutral Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5114D61534 for ; Sat, 28 Aug 2021 20:18:41 +0200 (CEST) Received: by mail-pf1-x430.google.com with SMTP id s29so3866065pfw.5 for ; Sat, 28 Aug 2021 11:18:41 -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:mime-version :content-transfer-encoding; bh=Tt01e3/54b6MIVYvAyzcO8G89O4BFMhZz+5X1S/qWUg=; b=HL3lJVriOQxU/wsIWlzwqHhE8GJjK+3At6Qu0jZutTe6kPgtdmVpFjU6yaEbzxC5ys AV6kHd+R6wvLEbTCxapJ/NjhqDOcgHhMuoS35hBF/rv+XKrPV1yHA8qXj2cOMlx1msTB UH2oMtkv0rxjPqSbRHcKonYbu/wX2gpiqflxyWz9ZuIWADhKXdHYtIz+9SnO3FMf6Wnd 7fazs6ddFeOLPEKMowVY5NDvP/A4yeK/mcc3WrhjFptY/xnQ3ctSRw4oSgACMGv9TWJn j5uY7Imv3Olpft83OKwLrBp26wIS9oYWXI2vuSJbL1Yu6JQTXbQdR6aw3qjxNdduN6L9 1kUA== 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:mime-version :content-transfer-encoding; bh=Tt01e3/54b6MIVYvAyzcO8G89O4BFMhZz+5X1S/qWUg=; b=DLEtes9/nFwvoya9lUUY+ulqbnvcHj7fpRxuO9KDWxUSVStU0iqg2uMNo/RvBDVz44 5EqcbpygcnAhEMPbi3flQ1wmCKRXvxYj8FHi7tJJ+ejVgDwhK9UsEiZ82atOxz1L2QsK i3uEznZO/kMx5D3RZRuKQSEsQMXvTarmKMxhFPtLQyKdCC9krMdYPimppPVq5MnAxqfN 1rSM6AbYa4vto0ljxCaWp9U/2hNYdmdqsKSmP41ndWrS0JF+bQZHLWyIR50w1Q1YzSR5 /KHf38Z9QGPOdxvesQRy1wO708l6jVcEKXJoNgJysK/V6SZWZo++OvmaysLXUgZoiMo5 ddrw== X-Gm-Message-State: AOAM533k87sEQGkG17i+V4GnD/0zCJaZuVsDPPng8MzU45tdfNZi1pUz lHUpPZTEvFjOCEh3D3qvRyDc6OKlfDyA3uH1 X-Google-Smtp-Source: ABdhPJzLZrI8toT7rEX9FW8DKPrJyuZGqYWewZksa061V6xMaVXLUpwm/W5xmhTIHIc9CD08i5ERSg== X-Received: by 2002:aa7:8e4f:0:b0:3ee:27d5:28bc with SMTP id d15-20020aa78e4f000000b003ee27d528bcmr15114416pfr.24.1630174719506; Sat, 28 Aug 2021 11:18:39 -0700 (PDT) Received: from localhost.localdomain ([1.186.166.201]) by smtp.googlemail.com with ESMTPSA id v20sm11181847pgi.39.2021.08.28.11.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Aug 2021 11:18:39 -0700 (PDT) From: Vedant Paranjape To: libcamera-devel@lists.libcamera.org Date: Sat, 28 Aug 2021 23:48:24 +0530 Message-Id: <20210828181824.378795-1-vedantparanjape160201@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1] test: gstreamer: Add minimal validation of camera output 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: , Cc: Vedant Paranjape Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Read stats property of fakesink which has Sink Statistics, It is expected to be a non-zero number after running gstreamer element for two seconds. Signed-off-by: Vedant Paranjape --- > I would like some minimal validation. I would expect that after 2s some frames > got "rendered" properly. You can read the GstStructure property "stats" from > fakevideosink / fakesink, and read the "rendered" field. Make sure this not zero > perhaps ? This change was suggested by Nicolas Dufresne in the mailing list --- test/gstreamer/gstreamer_single_stream_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/gstreamer/gstreamer_single_stream_test.cpp b/test/gstreamer/gstreamer_single_stream_test.cpp index 4c8d4804..5d56e762 100644 --- a/test/gstreamer/gstreamer_single_stream_test.cpp +++ b/test/gstreamer/gstreamer_single_stream_test.cpp @@ -134,8 +134,15 @@ protected: g_autoptr(GstBus) bus = gst_element_get_bus(pipeline_); g_autoptr(GstMessage) msg = gst_bus_timed_pop_filtered(bus, timeout, msgType); + gint sinkStats; + g_object_get(sink0_, "stats", &sinkStats, NULL); + gst_element_set_state(pipeline_, GST_STATE_NULL); + if (sinkStats <= 0) { + return TestFail; + } + /* Parse error message */ if (msg == NULL) return TestPass;