From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1E34740196 for ; Mon, 2 Oct 2023 15:47:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 72D3A68CCDE; Mon, 2 Oct 2023 18:47:05 +0300 (EEST) Received: from mail-vk1-f172.google.com (mail-vk1-f172.google.com [209.85.221.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7CE1B68CBCA for ; Mon, 2 Oct 2023 18:46:59 +0300 (EEST) Received: by mail-vk1-f172.google.com with SMTP id 71dfb90a1353d-49d55b90a5aso1065045e0c.0 for ; Mon, 02 Oct 2023 08:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696261618; x=1696866418; darn=ffmpeg.org; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=r05g86lnBYA4NY7Dc/nDJP7JKGmvwAHsrxudxRRJ7nE=; b=SIp2wnVZNl77i5n8PgRjj1t7nVUPXc6EWNJrzfurAmoLdqKFh6O8F428PHaDf69gkO 5k+eewHsvf21UpfGHmKXn8pJ3kjN4YAadvELHt6XdSjppV48gA5sMlXBK6+9vy5R7+MT X4vqk1QgCurg9iWLOLwIgUXqBLurJcGEuZitOz97DMxHXqM+1TY/24pJXszMO89/ZLkQ QRUttemRyJfpEFa9vB7loCwxKDGGyFz6mc9+TgW19TqaOVUqMPsYNy5FvSoiW7zAjr3/ 3tDu1Y/l95u35rUgjD8DOi4NoZZ5+vv1QKODqsSFwVfrcm8+h3ptSHsqvw4gOWauRtPw BLHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696261618; x=1696866418; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r05g86lnBYA4NY7Dc/nDJP7JKGmvwAHsrxudxRRJ7nE=; b=HCOb9QIUJaArvjAJw6NSKCywhUJjhUYxxLLRlRFdAgsSqbD4b5WNdEOqKRTI8sdyZQ mTWj2/F3gbu0kprepGdZuHrXBXa1K7ewld5xBvH35Tg5d8qYqRNrF1y0VrjKQR8x+pVc 0vBJ90FHACQhugam2bKCOPFi2C4OUfJ9tvr5udvPR/WFK8YFOC6Fdckgeodr+DiZDQse gvmG/FujirvW7rSl0nQgVMsfF78SDS6HldWyDJIYri9RdMxvY/TIeEwYtaAiO18lBzBm yj9TL+aui97KShMWE8N3bSItkSUr8sHEGG06eeUISQuKj4S1S+bZOioqPMPn6qHlfUiU wmgA== X-Gm-Message-State: AOJu0YwZEu2BWuV0jo5TWzPorxW+fnZ/0/alw48ROtDk2t3EsGUBZrH9 o3P0tYMIYdBP1jXKAg0j3a8lgNmVOJoQ9Sv1/xKgevFq6Tk= X-Google-Smtp-Source: AGHT+IHrXoe9d2Vb5ie50idanYda0EmIPgv13v9WnB9nlgkUVhPzaewG01roUa6JCRBTeCH2lQMQB1r5tbkceR+uAik= X-Received: by 2002:a05:6122:d22:b0:49d:2a13:58fc with SMTP id az34-20020a0561220d2200b0049d2a1358fcmr10036vkb.2.1696261617727; Mon, 02 Oct 2023 08:46:57 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a59:b34a:0:b0:405:b46f:a850 with HTTP; Mon, 2 Oct 2023 08:46:57 -0700 (PDT) In-Reply-To: <169624223128.6638.14929681328366750242@lain.khirnov.net> References: <20230929-v4l2-strides-v1-1-26c10bf10726@asahilina.net> <169624223128.6638.14929681328366750242@lain.khirnov.net> From: Paul B Mahol Date: Mon, 2 Oct 2023 17:46:57 +0200 Message-ID: To: FFmpeg development discussions and patches , Asahi Lina Subject: Re: [FFmpeg-devel] [PATCH] avdevice/v4l2: Switch to wrapped AVFrames and implement strides 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 10/2/23, Anton Khirnov wrote: > Quoting Asahi Lina via ffmpeg-devel (2023-09-29 09:52:23) >> V4L2 provides a line stride to the client for hardware that has >> alignment requirements. rawvideo cannot represent this, so switch to >> wrapped_avframe for raw video formats and calculate the plane strides >> manually. >> >> This is slightly messy because the existing helper APIs expect >> dimensions and an alignment value, while v4l2 provides the stride of >> plane 0 and the subsequent plane strides are implied, so we need to >> open-code the logic to calculate the plane strides. >> >> This makes vertical video work properly on Apple Macs with "1080p" >> cameras, which are actually square and can support resolutions like >> 1080x1920, which require stride padding to a multiple of 64 bytes. >> >> In principle, this could be extended to support the V4L2 multiplanar >> API, though there seem to be practically no capture (not M2M) drivers >> that support this, so it's not terribly useful right now. >> >> Signed-off-by: Asahi Lina >> --- >> libavdevice/v4l2-common.c | 68 +++++++++++------------ >> libavdevice/v4l2.c | 138 >> +++++++++++++++++++++++++++++++++++++++------- >> 2 files changed, 151 insertions(+), 55 deletions(-) > > Wrapped AVFrames is an abominable hack that should be going away, not > spread to new places. The correct approach is move v4l2 rawvideo to a > lavfi source filter, then none of these hacks are needed. But that would break SDR seeking. And also break bunch of avdevice, and make Nicolas sad. > > -- > Anton Khirnov > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".