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 905C449B2B for ; Thu, 2 May 2024 19:35:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C8A4168D84C; Thu, 2 May 2024 22:35:38 +0300 (EEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 68BD468D793 for ; Thu, 2 May 2024 22:35:32 +0300 (EEST) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-41c7ac73fddso41612675e9.3 for ; Thu, 02 May 2024 12:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1714678532; x=1715283332; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=tLbl1DMJrRDqIBZAsCsHru2j467OwuPiQ07bilwPzVc=; b=l1QT8LHdIFBUf5tiYU2mOuBqR2WUclR6n/Ggl924seCDsnVm1y+btWzfgPN5DGffRx ijr4QnqgL74Ma/3lYc009B2gbrAwcftQtHljDBJViJYjDWI9+lJntVXGAJMv89G32o5d +hpsrSr7eKO5TrIbpL3bRFd5JBG5Pf1fb/b+rJXHVuj6dX1uVWtfWnS8wW80N5CAGVVF ii8lYtPW7qbq1rV265gRJXbZruZQzfyf2CMyddE84jJHmWQlAgtY7B5FKfYwAc1GIT8V jKYNKIN2fVbxIUM5Sh2w1e1JI7RtNO6YLgOB6iR3hlFSSXZIegFCWoYbGvEOOxo01ntk zBFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714678532; x=1715283332; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tLbl1DMJrRDqIBZAsCsHru2j467OwuPiQ07bilwPzVc=; b=IVV71fhU94MGN+RLTl7cl8eiAaW/r7/zbjh0JTwdCO6JmFCqW3bUXql3nDAFsBlN6I idN7Q4+Oav0OEFF+Q/M2p7klzkCV4uyu0nhp+M8/0znEWHkzJmBqhunlF5qKWiYW1Vnb 2xkColU2ORs/a2OEh7jskdQVTvsRxd0YOcKXSFZDTk0OuiVD9yZHUd3zH/eHzJ2fIdn6 9uL5fV3YJQJpxeLixSUeU7gmmDxNQXOsrHrzAS32jOwhdesrFFm5yC//4VOQeQqI1SyO YeoGPRNn3b4G8+dB/FEsoH04qnzeXT1XY9MvcOfFRwT7qM9+wzZoFDaNb99aJMqtBF3j UPHA== X-Gm-Message-State: AOJu0YwtMx75E4FMh5kXKiMXgO6/kXEbWhsnmW2b2LB81iXXBIai9swe ty4PXKqOnazmmAsZY2Wb5bhfysO9pibZQhowitvRZx3gh87Ap8OnYlFlJb8J3Jyq/t65nmk11Dh e X-Google-Smtp-Source: AGHT+IHMncuYYH6nD1zF7DsHMb2xpVwhW4HYX7fyemZmmrSzh+42gIiXRPeUrYgjDSczdttN4NBClQ== X-Received: by 2002:a05:600c:a45:b0:41a:225f:becc with SMTP id c5-20020a05600c0a4500b0041a225fbeccmr742015wmq.21.1714678531532; Thu, 02 May 2024 12:35:31 -0700 (PDT) Received: from [192.168.0.15] (cpc92302-cmbg19-2-0-cust1183.5-4.cable.virginm.net. [82.1.212.160]) by smtp.gmail.com with ESMTPSA id fm9-20020a05600c0c0900b0041c23148330sm6666207wmb.10.2024.05.02.12.35.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 May 2024 12:35:31 -0700 (PDT) Message-ID: Date: Thu, 2 May 2024 20:35:58 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20240428073911.423287-1-haihao.xiang@intel.com> From: Mark Thompson In-Reply-To: <20240428073911.423287-1-haihao.xiang@intel.com> Subject: Re: [FFmpeg-devel] [PATCH 1/9] lavu/hwcontext_qsv: update AVQSVFramesContext to support dynamic frame pool 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 28/04/2024 08:39, Xiang, Haihao wrote: > From: Haihao Xiang > > Add AVQSVFramesContext.info and update the description. > > Signed-off-by: Haihao Xiang > --- > doc/APIchanges | 3 +++ > libavutil/hwcontext_qsv.c | 4 ++-- > libavutil/hwcontext_qsv.h | 28 +++++++++++++++++++++++++--- > libavutil/version.h | 4 ++-- > 4 files changed, 32 insertions(+), 7 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 0566fcdcc5..4a434b2877 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 > > API changes, most recent first: > > +2024-04-xx - xxxxxxxxxx - lavu 59.17.100 - hwcontext_qsv.h > + Add AVQSVFramesContext.info > + > 2024-04-24 - 8616cfe0890 - lavu 59.16.100 - opt.h > Add AV_OPT_SERIALIZE_SEARCH_CHILDREN. > > diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c > index c7c7878644..f552811346 100644 > --- a/libavutil/hwcontext_qsv.c > +++ b/libavutil/hwcontext_qsv.c > @@ -627,7 +627,7 @@ static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req, > QSVFramesContext *s = ctx->hwctx; > AVQSVFramesContext *hwctx = &s->p; > mfxFrameInfo *i = &req->Info; > - mfxFrameInfo *i1 = &hwctx->surfaces[0].Info; > + mfxFrameInfo *i1 = hwctx->nb_surfaces ? &hwctx->surfaces[0].Info : hwctx->info; > > if (!(req->Type & MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET) || > !(req->Type & (MFX_MEMTYPE_FROM_VPPIN | MFX_MEMTYPE_FROM_VPPOUT)) || > @@ -1207,7 +1207,7 @@ static int qsv_init_internal_session(AVHWFramesContext *ctx, > MFX_IOPATTERN_OUT_SYSTEM_MEMORY; > par.AsyncDepth = 1; > > - par.vpp.In = frames_hwctx->surfaces[0].Info; > + par.vpp.In = frames_hwctx->nb_surfaces ? frames_hwctx->surfaces[0].Info : *frames_hwctx->info; > > /* Apparently VPP requires the frame rate to be set to some value, otherwise > * init will fail (probably for the framerate conversion filter). Since we > diff --git a/libavutil/hwcontext_qsv.h b/libavutil/hwcontext_qsv.h > index e2dba8ad83..9e43a237d4 100644 > --- a/libavutil/hwcontext_qsv.h > +++ b/libavutil/hwcontext_qsv.h > @@ -25,8 +25,8 @@ > * @file > * An API-specific header for AV_HWDEVICE_TYPE_QSV. > * > - * This API does not support dynamic frame pools. AVHWFramesContext.pool must > - * contain AVBufferRefs whose data pointer points to an mfxFrameSurface1 struct. > + * AVHWFramesContext.pool must contain AVBufferRefs whose data pointer points > + * to a mfxFrameSurface1 struct. > */ > > /** > @@ -51,7 +51,29 @@ typedef struct AVQSVDeviceContext { > * This struct is allocated as AVHWFramesContext.hwctx > */ > typedef struct AVQSVFramesContext { > - mfxFrameSurface1 *surfaces; > + /** > + * A pointer to a mfxFrameSurface1 or mfxFrameInfo struct > + * > + * When nb_surfaces is non-zero, it is a pointer to a mfxFrameSurface1 > + * struct. > + * > + * When nb_surfaces is 0, it is a pointer to a mfxFrameInfo struct, all > + * buffers allocated from the pool have the same mfxFrameInfo. > + */ > + union { > + mfxFrameSurface1 *surfaces; > + mfxFrameInfo *info; > + }; doc/developer.texi: "FFmpeg is mainly programmed in the ISO C11 language, except for the public headers which must stay C99 compatible." Anonymous unions are therefore not allowed in public headers. Can you explain what you need the info field for, though? (What is needed but can't be inferred elsewhere? VAAPI in particular is can be mapped here but doesn't contain any special information like this.) > + > + /** > + * Number of frames in the pool > + * > + * It is 0 for dynamic frame pools or AVHWFramesContext.initial_pool_size > + * for fixed frame pools. > + * > + * Note only oneVPL GPU runtime 2.9+ can support dynamic frame pools > + * on d3d11va or vaapi > + */ > int nb_surfaces; +1 to adding proper documentation for these fields. > > /** > diff --git a/libavutil/version.h b/libavutil/version.h > index 735f6832e3..3b5a2e7aaa 100644 > --- a/libavutil/version.h > +++ b/libavutil/version.h > @@ -79,8 +79,8 @@ > */ > > #define LIBAVUTIL_VERSION_MAJOR 59 > -#define LIBAVUTIL_VERSION_MINOR 16 > -#define LIBAVUTIL_VERSION_MICRO 101 > +#define LIBAVUTIL_VERSION_MINOR 17 > +#define LIBAVUTIL_VERSION_MICRO 100 > > #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ > LIBAVUTIL_VERSION_MINOR, \ Thanks, - Mark _______________________________________________ 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".