[FFmpeg-devel] [PATCH v7 09/10] qsv: use a new method to create mfx session when using oneVPL

Xiang, Haihao haihao.xiang at intel.com
Thu Apr 28 12:31:42 EEST 2022


On Wed, 2022-04-06 at 03:58 +0000, Xiang, Haihao wrote:

[...]
> > > 
> > > 
> 
> 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/API_ref/VPL_disp_api_struct.html#structmfx_impl_description
> > > > > ) and user must select an available implementation before the creation
> > > > > of
> > > > > mfx
> > > > > session, however the device handle is unknown in the SDK when
> > > > > selecting
> > > > > an
> > > > > available implementation, the SDK provides a method to select
> > > > > implementation
> > > > > via
> > > > > the given adapter (on Windows) or DRI device node (on Linux). The
> > > > > default
> > > > > implementation will be selected if child device name is unknown.
> > > > > 
> > > > 
> > > > First of all, whoever made that API should get a stern message.
> > > > Expecting to properly interoperate with the dominant platform APIs
> > > > should be a primary goal, and it sounds like it was somehow shoehorned
> > > > in after the fact.
> > > > 
> > > > For D3D11 for example, you can get the IDXGIAdapter a device was
> > > > created from, isn't there enough information in there to pass-on
> > > > without storing a string field?
> > > > IDXGIAdapter::GetDesc has tons of identification information to
> > > > identify the device in use.
> > > > 
> > > > D3D9 probably has something similar, haven't checked right now.
> > > 
> > > 
> > > Thanks for the info, I may get AdapterLuid from the adapter description,
> > > however
> > > the required parameter in oneVPL is the index of the adapter, is there a
> > > way
> > > to
> > > map AdapterLuid to adapter index ? (Sorry for this dumb question)
> > > 
> > > There is `IDirect3DDeviceManager9 *devmgr` only in AVDXVA2DeviceContext
> > > for
> > > D3D9, it seems we have to add other members to get adapter description.
> > > 
> > > As for vaapi, there is no API to get the used DRI device from VADisplay
> > > handle,
> > > we have to store this info in AVVAAPIDeviceContext, and I prefer using the
> > > same
> > > way for d3d9 & d3d11va too.
> > > 
> > 
> > I'm not sure about VAAPI, but not storing a string just for this one
> > purpose seems like a win to me.
> > What values would
> > mfxImplDescription.mfxDeviceDescription.device.DeviceID contain, and
> > would that perhaps match something in the D3D11 or DXVA2 device
> > description?
> > 
> > You already have big alternate pathes inside those functions for
> > windows or vaapi, so that doesn't seem like a big step to handle
> > separately.
> 
> Thanks, I will try other members in mfxImplDescription and update you whether
> it
> is doable.


We updated the patch not to change AVD3D11VADeviceContext and
AVDXVA2DeviceContext. Could you take a look when you have time ?

https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295760.html

Thanks
Haihao



More information about the ffmpeg-devel mailing list