From patchwork Tue Jun 4 13:55:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 49547 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:9183:0:b0:460:55fa:d5ed with SMTP id s3csp2704653vqg; Tue, 4 Jun 2024 06:56:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW0S0BGrkZaK8JZGk7BdvT0v1ZlR/7OAEhw2BslXIAcqCNF+9TOIkDkV+pDzVCDvaPJDOv1S9xMARh6uLm06ejsyEom1HmilYfUhA== X-Google-Smtp-Source: AGHT+IEjDCaGmCG9ol48/01ICqpi54OJfU17ebFbXjaf1jBYm1JgxZ27j0zBq3wDxz+unikH935T X-Received: by 2002:a17:907:516:b0:a59:b88c:2b2a with SMTP id a640c23a62f3a-a6821b71cdemr631435766b.50.1717509365927; Tue, 04 Jun 2024 06:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717509365; cv=none; d=google.com; s=arc-20160816; b=m3ue5dJcrZ1Q5l39abuZkxTLoorg0Y2Z7kXB8rIMLyGRLp80OLKDOfEId0goa/H5TI 6u9vTF+HZA1flWKpXYkqOXQGyt0iRp8wKMv0HBKKDZeX4Q81EJNa24AnDv3Bf8YI5puh 5ILtoEyclv1Ys1YvguGSBRksaEoVQzw9QHeRzVMiDayZIb3hxadLorZ5flUSjp35c5Ct KX8id9jkXUxa8ggj0LW9D8/lnWisCGczMw3rZ8ECvcf1CZT9dJUa3CImOigA+OnjbYPu o60/UtyBYtt2OkjokAevaSoA2ARB3MzGHMWgRMA4/LWbG3ZZJEwndCUI2EP1h8TJyX3Y 6VKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to:date :to:from:message-id:dkim-signature:delivered-to; bh=gfmH/wqPVzVBGN6F4PS2orUhZqx0vCjmcFmBcIqRWl8=; fh=HnHYuZ9XgUo86ZRXTLWWmQxhslYEI9B9taZ5X1DLFfc=; b=SONyKpW4k5e/MV/dTlAkbrupcKJavrRZtGn40TWkIGKYVbhnEWaFVQuyw3XAYU1Fcj dkmyuWZQr3beHeaCkFdRpTVmhHvtn17IoZN8aKgmfTdTWciC9u7sx/7LCFQ5K0bubnha fFjs2tCT0gbPX03Ot7w0TsOEh2ZYdGgF1WE4hSoSACq/91xh+zEjJp271+1TNFGRbCyg Hyym/CKljt+DoJiXaFBBfumZ6PxxPAd4OUb1O1Luwc0LjZydjTKRPtKjsBlbGNebpdnU agGKAxq38M9sNkCvSugepXe6VO3JcAq1uDO09FKx1qyjwpqAm+CG+2lkSKr2x/OrUa/g bhHQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@foxmail.com header.s=s201512 header.b=tpd2Vu2N; 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=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a691740d423si180392266b.102.2024.06.04.06.56.04; Tue, 04 Jun 2024 06:56:05 -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=@foxmail.com header.s=s201512 header.b=tpd2Vu2N; 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=NONE dis=NONE) header.from=foxmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CEB0368D714; Tue, 4 Jun 2024 16:55:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out203-205-251-80.mail.qq.com (out203-205-251-80.mail.qq.com [203.205.251.80]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BED5468D6FA for ; Tue, 4 Jun 2024 16:55:22 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1717509309; bh=8nR3hXTFPhmXyMWZEPO1v5DP9gO7q88/bcN1D9Mmn2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tpd2Vu2N/PahLhbI0wwJfcemprc7M7GhY7wmEoQ2XPuht45FzJmqpo2AoMEKGEJdP 1be+1R3QUiq4Ypo3cWcDExjDxiSzohCCoJEcvL13lvOtn7QI4EVFG+uWEw3QWelWps O1oGD8bk58hdxDWHIlPAeqCproXVHsmG6zSncpTs= Received: from ZHILIZHAO-MB1.tencent.com ([113.108.77.51]) by newxmesmtplogicsvrsza29-0.qq.com (NewEsmtp) with SMTP id DC59C61C; Tue, 04 Jun 2024 21:55:05 +0800 X-QQ-mid: xmsmtpt1717509308toyxlky4w Message-ID: X-QQ-XMAILINFO: OKkKo7I1HxIefiM35g090iNFi8bxmhcGVNUWJ1FOMYTB5jzu/+82Afzg4RIj7S 3bxucJx262rF+tpc6tINz8zZkEfQl6U8DKOoGV+t8vOJjQgYqhG+9AzQvBI1caAfo4I9h7HA7a44 8FiBRGg/wV+zTqQ1FhlRSUhVPNYfPeioTC/OyEZ6TKfI5kIzrmt97rfVeihhvgawuoOiIVPGnybb Tkz//GpPlMPwDNTe+3FUjIG4MiUxKt8fASJKHSvCjnDdzLdyIVDaqe9quEhqcpWlI7P+9Y4jRs6G gz/osT0j+sNRUSIvDXc8nBCAlOdN1Ul0DrSg/l9iWBqlMCcTbWJF9McdUsHCMiqmrvOjz8KHTMVh H237mBKOG27bjzKod+2ThQ9X2DYud9bl8IynGXe5C+lCfP68qnWG86/2LDD0A4sBPxAT2xL8Uu2M /W6pOdHu8hH3qbS5SiIkIaiSm8ctU9Ji7oQan737+913e0OQ7B4Zkr3xWhk/RUpF/HfD2CZ5YNT2 yjChK5g21C2RJXgIG9sdaJfmT+cMpDSRT7Mjgg48ckyP1a+9O84ts/hy2JVmY5d8jLrU7oj7D+W8 tV850CufSGtYxPqBty5FHFwwa6OoUH1dYUGOTaTLdlLIv9AQOuliAYB05xHWa/HXwwIuCzhJclPj v6RYhQcoet4g+/WMXHFGv7ZLEzJPgMMjeQg9f1OfuqJrnA8AfETTszneIcpJSKJZnEtu5gZJKVmi TDaAtqherZsSbfiO5SCYW3aCZlvMT3w0r3Fy9Y4YLdlxp9069mtKHZYY3+r5VYTe24xIX8yjYOpY jav/A8TUr0cnt8eXcqLlrXDOAceGY7CPnIMsas88sKsGHhcfhbhgh0A8WCAaD5KIv/msL13fxxdW 4AD9Do5hcOE50LbiJCoX8aTGWLzQmAytwqJN0BSn3jvady6dPai8WhLQ2bhK2BwOiLFAIOtTUhD2 ucPaWxhSyyaiSR9hYfiWnqeayY26XTOFbLvN0GiQMl3kSd/oV+OhOVQTuLDEs3kzBrfCeGQLMzEI yJNmI8xg== X-QQ-XMRINFO: OWPUhxQsoeAVDbp3OJHYyFg= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jun 2024 21:55:03 +0800 X-OQ-MSGID: <20240604135504.83169-4-quinkblack@foxmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240604135504.83169-1-quinkblack@foxmail.com> References: <20240604135504.83169-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/5] avutil/timer: Add clock_gettime as a fallback of AV_READ_TIME 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 Cc: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: bES/UaWcNQ99 From: Zhao Zhili --- libavutil/timer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavutil/timer.h b/libavutil/timer.h index 2cd299eca3..74c4d84e69 100644 --- a/libavutil/timer.h +++ b/libavutil/timer.h @@ -46,6 +46,8 @@ #include "macos_kperf.h" #elif HAVE_MACH_ABSOLUTE_TIME #include +#elif HAVE_CLOCK_GETTIME +#include #endif #include "common.h" @@ -70,6 +72,9 @@ # define AV_READ_TIME gethrtime # elif HAVE_MACH_ABSOLUTE_TIME # define AV_READ_TIME mach_absolute_time +# elif HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) +# include "libavutil/time.h" +# define AV_READ_TIME av_gettime_relative # endif #endif