From patchwork Thu Aug 29 13:40:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramiro Polla X-Patchwork-Id: 51228 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:402a:b0:48e:c0f8:d0de with SMTP id ky42csp376721vqb; Thu, 29 Aug 2024 07:05:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUp1OnQlgZz5tnIqGyOo8d0w93oF96b3GA5eu0qgBw2bTKZ7yplY5oPTa3RVHVNoSdGw4rHGAm5jbsCA/JHOdWK@gmail.com X-Google-Smtp-Source: AGHT+IENZUkmcqglgPaG5l+bvqZJFlQHpqsqPnXcP5v70ylEZl5dmDCDskRtSnWFZFtkrfvIJrAQ X-Received: by 2002:a2e:be2b:0:b0:2ef:17df:62f9 with SMTP id 38308e7fff4ca-2f610581e14mr12365371fa.7.1724940315022; Thu, 29 Aug 2024 07:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724940315; cv=none; d=google.com; s=arc-20240605; b=OXC7zr59FdoOuYHt2upIwGzJ/yu+qSb6qQlVK0tkW5rxPIc9MIlgyRg12Ls/wZ5xel KnvUFEDF1QnwqScaYXJgCYneMcxRnO3Juu9G50YuZbyQ4yF/JWbjmo9RuURwuKaIy2aF GpHXn9stp8/JkpLNh+iL74P0Vd+6mNthEzDhktlW0KhzHrP7jq7zplhDF0BbID56wEI5 Y/MZhkZ3OgWV12iB91j46N4rejEaetFs2NeumOXlNYB95GGxGd2RnMsv0rNi7HPt26ae 9tJb4YqSf6rbpQU6m8I4rIlNPBlfjaQ73quTEqdDMR+zm05n5P5O4Sm8N2x+n5ryL1oa /4MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=+JXne1i9O06DlA81cyq6P5+vpGzLtZEKiQBmOLmjRyg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=SGGMRyOR/hj54jv8vDzKKvkV+aIii5xwyBNl4dETMRy5np2rW19i/+NXHUaXI7dFMS NxPtoMmGN/jaUWqV9dboJiE7se9ySe5m1j9KQQMp+uYIg5QXRc2ACYXpLdy8gZUTq2AN DZdJooKrv66U7dA5Dsf2Ki6y/HDUvsEF2A9USbNnL8KQ6K5iCIbn6kDtKVB+UqjisOgj OPAQC7zTIH/osgUa+7yea8mZEGzTkkTrKFWE6iHHIzw/9JJ/C729WYm+0GWL1MUPsnLE Dg4XYN/qTqbCX7HGhMBYdl65wrNqJDcoKkGkFPsvW/1jZwp5vA4j4+pCnlyjZ4Hvitpr Q6sw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=i+cEAtPz; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 38308e7fff4ca-2f6151511d4si5428931fa.203.2024.08.29.07.05.14; Thu, 29 Aug 2024 07:05:14 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=i+cEAtPz; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6AEB368DD9A; Thu, 29 Aug 2024 16:40:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8DC5968D7CC for ; Thu, 29 Aug 2024 16:40:04 +0300 (EEST) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-428e0d184b4so5753425e9.2 for ; Thu, 29 Aug 2024 06:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724938803; x=1725543603; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=32jwJdMzjyMPddeehUybI55RhP8kMiH/IDTGu3LDVOI=; b=i+cEAtPzjJ76eFEoy0scPzGojd46lmVFdy7ZnI3pz8guEQxcD4bta5F/TDxsy8F5vg P3L0ryjMEH9WHdUuc1ar5kfKWXkEJpOkyn1p1wqcrIbJgURtYUHp1xZzvKEFpqDk7lIV HKHG5va3KTD/YzulYWw3temqFpPyzk650+GQzWvD+s2pZ72yDIJq7YZHc/Bmqwe5NvoF aytL7QDq5akw1EBb31TSiwAocGqFpqJi5TCYlxCCdjvq6ND32xcjZvHPcSoQuvTll9sf AuobhjnMvc4SsrRFL60AgUmTGeDD0Vkw8Qo727EAGqZGj7bN4oJlgyWtsIzlAsT2uBaB OhEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724938803; x=1725543603; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=32jwJdMzjyMPddeehUybI55RhP8kMiH/IDTGu3LDVOI=; b=MT7WccgJpVzNmDJZ2s4cmMAciDe6cUkZPlYvQw9jMuAe/cJlkxWNKjykPF6agDhimd XTaJkN3xoyzUqoEQrjUSAbSXJFE097MOCB9pneFJCPFvMCvA+3pwxKb3kXV7wma1K7iI 8jln4KduJo0OxgoTf5Xf5OrIuLLa0P3XrNUxRbgb9R4/BX4k1lKJDw+TvUVQlAKHVpVR 3Y/38gke40c9Y8uWGkY5DN8d0R1UQv/qaXwxvJFbr5PTQ0kvtFiRRGM3BgKNHxAcgMML 9XZqFasOedGJHizX2+AmI2kl3ZQ1JWSGNwtSTkFOphXhdJcZyrOtspExuCUsDJdwUfCj IRNQ== X-Gm-Message-State: AOJu0YytMzXovwmZX+B5z9oRRb/DZz7rQpG1b2XpViqcbxv7/FouICxH in6c9PgUtz/p8V0bRFzIbzZ7rbRsKV/LAN5GQsNJnJHh8uM5LKZY2IuBdw== X-Received: by 2002:a05:600c:4707:b0:426:5b21:97fa with SMTP id 5b1f17b1804b1-42bb27a102cmr24019575e9.29.1724938802998; Thu, 29 Aug 2024 06:40:02 -0700 (PDT) Received: from localhost.localdomain ([109.138.158.185]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3749efbf5f6sm1462603f8f.114.2024.08.29.06.40.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 06:40:02 -0700 (PDT) From: Ramiro Polla To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Aug 2024 15:40:00 +0200 Message-Id: <20240829134000.6907-1-ramiro.polla@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] configure: improve check for POSIX ioctl X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: QPystiziHZrP Instead of relying on system #ifdefs which may or may not be correct, detect the POSIX ioctl signature at configure time. --- configure | 2 ++ libavdevice/v4l2.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 63f0429b02..ebbec49993 100755 --- a/configure +++ b/configure @@ -2524,6 +2524,7 @@ HAVE_LIST=" opencl_videotoolbox perl pod2man + posix_ioctl texi2html xmllint zlib_gzip @@ -7158,6 +7159,7 @@ xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint check_headers linux/fb.h check_headers linux/videodev2.h test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete +test_code cc sys/ioctl.h "int ioctl(int, int, ...);" && enable posix_ioctl # check V4L2 codecs available in the API if enabled v4l2_m2m; then diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 42d4b97c8f..0ae6872338 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -111,7 +111,7 @@ struct video_data { int (*open_f)(const char *file, int oflag, ...); int (*close_f)(int fd); int (*dup_f)(int fd); -#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /* POSIX-like */ +#if HAVE_POSIX_IOCTL int (*ioctl_f)(int fd, int request, ...); #else int (*ioctl_f)(int fd, unsigned long int request, ...);