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 0999040514 for ; Fri, 22 Jul 2022 13:27:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AACE268B6EA; Fri, 22 Jul 2022 16:27:46 +0300 (EEST) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0663568ABD8 for ; Fri, 22 Jul 2022 16:27:40 +0300 (EEST) Received: by mail-qv1-f48.google.com with SMTP id i7so3428734qvr.8 for ; Fri, 22 Jul 2022 06:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=5N6H+R7lp8z+2L6Q+qejnXdmuj+Y4uttc7gj3DXyHPQ=; b=qHjo9jIzioyX3jpcvDag4pLYSpk1ccVkUMTbNngB4GkRF/bAD6yq7yhvVMLKtrxUtq NLqQPHh90FhFfGGDrMKnNdyO5tV10ToBZEZp1iTw69y7qqrFEdnsNd0dxaRVfwHSDbsP JydPplfWT6r+UmxxTzDuOLP/kshzde8f5tIF1eqgJGg3K2W/jfKgOp/cy5VKPJFIbX/F ATdzxXP7i32K4+81706vSqr/c2kQajqtGxiP8BDXae/HSi+N0uW0iA4Cl9j72j2Ami4Q 4NPBhsXgbpN0WHAAIGxC5tXJ6Nsxq8T9bA5hDbYIMf6ydQ9LCiXLrVceeEMdXadfqdHY gEbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=5N6H+R7lp8z+2L6Q+qejnXdmuj+Y4uttc7gj3DXyHPQ=; b=Du5P4r6Tf9VVHjpcxHvX3r4GU7JZhBzeRglRtrt7h8I8F19v3HRe7WMccRmSz4x7cI hrq+/LhtZBCaZ/TAszXYiYfpb87+JsKnbJ1W7Q9Urf21N4DX3KKgUQa009e3Fa5+4aPf WbLhLSgVMzHZvbJmPQ/XXsLPvTP+0TMI6X7mEF/QvmidZVp6gxwI85qXZYtZyxW5AKG/ 6p1ROcG18qqER0hV/l+WDc8hDlrcm6vx9VaCDxVTGRfaYDMhjkJAEKAuQnhmr16ZC/P8 XEPnQUh+fgmxMDxClSEknLkIestmGpFzkMjy3tY0tWPNs1khEKnCIA7EfZbPLHa2M/Y2 GiCA== X-Gm-Message-State: AJIora/YPomQ3RZpsgsowVwQjAjzvxSO+487gMKdQibhXI0ce+OWcSXv 6QJlrkMynbSMO5FtfdDswzYs13eK1a6VhqAnYgTqVLhlLtuqQg== X-Google-Smtp-Source: AGRyM1sDazcTWsA37b+YnUIV2ftYWke8EQk095V/8MdU3CFigJYMNxDCLRe0av3q6qAwXp0P0DVGYRGExt3rk0RfZgs= X-Received: by 2002:a05:6214:508b:b0:473:467d:c280 with SMTP id kk11-20020a056214508b00b00473467dc280mr476393qvb.8.1658496457778; Fri, 22 Jul 2022 06:27:37 -0700 (PDT) MIME-Version: 1.0 References: <20220720105646.716398-1-emil.l.velikov@gmail.com> <20220720105646.716398-4-emil.l.velikov@gmail.com> In-Reply-To: From: Emil Velikov Date: Fri, 22 Jul 2022 14:27:26 +0100 Message-ID: To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH v2 3/3] hwcontext_vaapi: #if guard VAAPI_DRM specifics 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 Thu, 21 Jul 2022 at 22:06, Mark Thompson wrote: > > On 20/07/2022 11:56, Emil Velikov wrote: > > From: Emil Velikov > > > > Similar to the VAAPI_X11 bits, guard all the VAAPI_DRM parts behind a > > compiler guard. > > > > Signed-off-by: Emil Velikov > > --- > > libavutil/hwcontext_vaapi.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c > > index 7734a50fc0..7aea3e7b96 100644 > > --- a/libavutil/hwcontext_vaapi.c > > +++ b/libavutil/hwcontext_vaapi.c > > @@ -18,6 +18,10 @@ > > > > #include "config.h" > > > > +#if !HAVE_VAAPI_X11 && !HAVE_VAAPI_DRM > > +#error "At least one VAAPI winsys is required X11 or DRM" > > No it isn't. > > Originally there wasn't a possibility to link with any winsys here - libavcodec users had to get the device themselves and pass it in. > > The winsys link was added to the ffmpeg utility initially for command-line use and then moved to libavutil when it was clear that it would be useful to other library users; there isn't any requirement to use it, though. (E.g. disable it and note that programs handling the winsys themselves like mpv and vlc still work perfectly well.) > Assuming I'm reading the code correctly, currently when both are undefined vaapi_device_create() will be basically a dummy, doing some basic malloc + opts parsing and erroring out. So as-is functions like av_hwdevice_ctx_alloc() will return success, although as av_hwdevice_ctx_create() is called later on it will always fail. My aim was to effectively omit the HWContextType vaapi instance in the final libavutil, since it cannot work. Perhaps there's a better way to achieve that? In either case, I will drop that check for now. Thank you o/ Emil _______________________________________________ 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".