From patchwork Thu Jun 27 01:22:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Hou X-Patchwork-Id: 20423 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 0D2DCBDB1D for ; Thu, 27 Jun 2024 01:22:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E80E162C96; Thu, 27 Jun 2024 03:22:49 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=nxp.com header.i=@nxp.com header.b="JYU4GxRe"; dkim-atps=neutral Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on20615.outbound.protection.outlook.com [IPv6:2a01:111:f403:2606::615]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B4745619C9 for ; Thu, 27 Jun 2024 03:22:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VpOYdJdL6PP5IBtUwMoA8cPHSFOxzNYSwUQTtLZAX66NEPNTkFmFCp6bhXk8+k/eRUbViw4hskzM+seFE518x3JPozG86v9lysVhAHre4bdQuiSQs2z2y+yP0rW4pcKa3i9h8cRTD+1cTZqpOJrxLF7AAOLoG4m+BrXrgvgTMaparWUmMpE+I9m7hbnM5pbRJuA1DYSFdPQnlu3pNULgv+341amege5MkXqhiiqt/NQYBm/3gIfy99bXjwqtTsPNIs7pfbyD92S6oBhqtkQBPMVo7Y5GzHun/9decPmEMSGIUz7tDAXMGnRjZ2tlzM79w57qWDAXQwOa81NUSiKseA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UPMhItE6h4oeNRqIh3EfvpE3ZCV4iKNPovAaDXBEc04=; b=bI52u7M3acRnnoyxG0tRYcyDXLTsTTsdHu4Nh3cecq9Xf39PNorejEbFPjkIZ3XmbfAOlxu/Mo6AcmENrk+2R4SMZvKTErtu8itsHDTxVKyq9SAbCpV5JMMuR4Fb5mOsR7YU88GrkvlG/nrOXvlZB53evGqv24euHRwWL5eQ8iT3uJ52AwopeWgpymOBa5f0N9uAv/DQR6Fe2aFWpzEJFzKYfrho0O6sWJI5ydMtN/w3+xWpHl1GF7lfNwOoJjksLJTS2DdIVeg3QYjGxsWECnrxebkKEfDWbyG5236PPUgK8seNvHbeWQ8yAAODaZPTj0lJFAJBEh8M3RIjCI9h5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UPMhItE6h4oeNRqIh3EfvpE3ZCV4iKNPovAaDXBEc04=; b=JYU4GxReheSjl7iwLYBry4c9Ud1IVHNHD+vpv0jDjYlyAWnuSEN4mtBps8J6tFFbp/rj6G7akZub3BHPhD+p9YraWUt242088VBnwmIJBQFnKFhcRKxo1ztE13sAttVFZJ8SNJ8t12JpA8B7e3AV0HrIP/D1NhWPvRRqfkob+88= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB8285.eurprd04.prod.outlook.com (2603:10a6:102:1ca::15) by DB9PR04MB9305.eurprd04.prod.outlook.com (2603:10a6:10:36f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.35; Thu, 27 Jun 2024 01:22:44 +0000 Received: from PAXPR04MB8285.eurprd04.prod.outlook.com ([fe80::e003:8fb:64ea:acfd]) by PAXPR04MB8285.eurprd04.prod.outlook.com ([fe80::e003:8fb:64ea:acfd%7]) with mapi id 15.20.7698.025; Thu, 27 Jun 2024 01:22:43 +0000 From: Hou Qi To: libcamera-devel@lists.libcamera.org Cc: jared.hu@nxp.com, qi.hou@nxp.com, julien.vuillaumier@nxp.com Subject: [PATCH] gstreamer: Fix critical warning "gst_value_set_int_range_step: assertion 'start < end' failed" Date: Thu, 27 Jun 2024 10:22:04 +0900 Message-Id: <20240627012204.1949820-1-qi.hou@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI2PR01CA0005.apcprd01.prod.exchangelabs.com (2603:1096:4:191::23) To AS8PR04MB8278.eurprd04.prod.outlook.com (2603:10a6:20b:3ff::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB8285:EE_|DB9PR04MB9305:EE_ X-MS-Office365-Filtering-Correlation-Id: e359b1ba-db3c-4c0f-15cd-08dc9647a2f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 1dsgWlrKGZlmMqix0eC0/8BZFFxDMJJAjZVaJmEPTCVgujpxY1Szcr99/XBfgXbb4VFgDrBOZdzmWFOZ/qC5/8AGanTOrvdGbLj2XORsLfAozqjMFKYTZaWR3/QTzIUXauzorsAsfXSwctlNNSh0aXTIfIaw41AfD/m6JtBRzxu1iLnnVJ4O2iURQuPB/wd5R+LbXnH0BNGayLOxC6sGcyErEuE8V05Wc+70h9dvDWzAgwEqht9o4cxK/zXk6PFKqldLO+BjDUa5xYohRCLb1vETYNDr8pLciMj2HhRP1b5EEzf+5axUHYjDZ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Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB8285.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VH0EndgCMQCvBxMGNpmUdeCwrWzDl0GZ1lrOunBc97BSlcNiMALybfx1ASLI21RoA9RFwGpMQgimjtEacNGzP9PJ0mGII9Rw9kzkB/1zcdqfXgEB9RSBXjzEyIZFXs9kSICPts6F7A+OlBRVSN7iFxlROb8nxYOJ1VZgaorKrc0epR9pla7wkhscZ/hujU8kcqNJhpBqJJUA/Vps56F40YYF0/FPBEo3vy7RirwTSPX6Ie7tlUf8GEyQ7D6Y1ZM8cVHhWRCA5CgrFkXGoFpBiw8Gn4zAS5ZR3IUJZqkNEQuPz8El4IEKx/EtmfGM+e1cLW3Fz6dI2OIvM6v9JOAEC+OUwgEnb8YoQThEvHNR0b1gYWntR9fuDeTPY7tTsShcaAlyEegUe8W3fzbxVU2/g0es2CvU7lwwKVl3xja06CH+ZOq1dc/wZ207sXav+n5RqDcoa0sHrUWjt638+7pgCjGmt5BmD/6vtA8l+KY/6wPmH8m+IAgk3yaG2qYSzBWqPKPPIi1PPiwFIYjNnyHrydddCjsKOcvunvA2ldPioS1l/O+c8qRsGscOam4VePq1ZvYWP7gzbQpxY7+66J+7xjJt61h4wRMFaAa2786NVd6OAIfXrV01V4hJ+e1n9xV0fgU/zaezkYKuWicwIpqlLKfpUdGPWFxEJbVy5BcMxL8JzVyVWrBnziesawKQ4waInT3RitydZVMgDl4C3wyCHhoH8Ym6MYcwvdVpJgmi7LJZMxVYwAXmivj9Mv4irFIOlLxMbArSMOUVA5GkSEDgrdmrWYm3Gj/+OPTkig7mUHZ5cIs4i58GLZZyDfOqANj94u+5a5CvcW6YkI3ifzLgN67OlzDgaMqu8+rEMrpWSQ/s76lA3doGoUZ/R8yfOVXi4zpdccSuINsA4rXQIkJNdAvjJHXO7wtXypN9xLucwWayV4KgF7YkJDmPMSkZE5KvrebBfzX+6Wa0v4CMo8HR9B9ZFu1TlIs5kWMhCmXp7tp/COyWZ+DfoWqGiEglcHjQnztQXL3bSom9zcWyQLg/j50W6Zs9k2VIa5FTtoF9fkMade54Far+XGtHwfNk1C8KF8AIP6s+7F6YdnG3QhQ7+Gp0+ccBVFjKSYd6PUaMuIoNjId60nSyxLOg4bpr//DK4CMNX144p8pNZnMjBu+XIUdwCRTX7BweYgpkpK/gjK3VlLF2SxqZg0KixwGYjpqT8mEHAVmiomGyi0vLORmKIk2EAo13siP0WJEchzjPP63jLsCMqcTnGqlvJzYvBMzOfpaEe9yGWgiFhSpT023erUQOlsVuz8ymKASBMN77QKZN8yeyYGAjRcGiZ7FgOS09xLHkkkmiIGvKyBl2plXhd7/w5lTMqDwtBiLIhIjajeyOj86w/bbbJcs+EbQE9PtR4t1pR5j7gUdHKRKWT9Fpl1RSG1E5cuhXJ02S8UjypSvUOOgCq0nCSoyLDJBGaF6nxHwJsiOLLBsTCcppNwI+A6pfokTW7uAnM6NPEkG9XdQh51gkcIC+GKYAY+74ScMXZN9MBuzhIJ4W0h7QOikJeC8adfy6YIMZCp8rBGXv6cI= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e359b1ba-db3c-4c0f-15cd-08dc9647a2f1 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8278.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 01:22:43.7586 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZQDNWbZrcsqBPzFHiwJmDFXU607YrZr2ETTJ9r4AIRmSS6jWhGE4JQnepn8KqcMT X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9305 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" This changes is fixing critical error message "gst_value_set_int_range_step: assertion 'start < end' failed" observed when building GStreamer caps from a stream configuration whose size range holds a single size. GStreamer range step definition requires distinct min and max values definitions, otherwise above error message is output. Libcamera SizeRange instance may define a single size leading to identical min and max values. Add a test to avoid building GStreamer range step from a single-size SizeRange to avoid such error. Signed-off-by: Hou Qi Reviewed-by: Umang Jain Reviewed-by: Umang Jain Reviewed-by: Paul Elder --- src/gstreamer/gstlibcamera-utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp index ec4da435..b6672b9f 100644 --- a/src/gstreamer/gstlibcamera-utils.cpp +++ b/src/gstreamer/gstlibcamera-utils.cpp @@ -354,7 +354,7 @@ gst_libcamera_stream_formats_to_caps(const StreamFormats &formats) } const SizeRange &range = formats.range(pixelformat); - if (range.hStep && range.vStep) { + if (range.hStep && range.vStep && range.min != range.max) { GstStructure *s = gst_structure_copy(bare_s); GValue val = G_VALUE_INIT;