[FFmpeg-devel] [PATCH] H264 DXVA2 implementation

Joakim Plate elupus
Fri Jan 15 14:02:43 CET 2010


Laurent Aimar <fenrir <at> videolan.org> writes:

> 
> Hi,
> 
> On Fri, Jan 15, 2010, elupus wrote:
> > On Thu, 14 Jan 2010 20:44:38 +0100, Laurent Aimar wrote:
> > > On Thu, Jan 14, 2010, elupus wrote:
> > >> [11 quoted lines suppressed]
> > >  Thanks for the information.
> > >  Just to be sure:
> > >  - LPDIRECTXVIDEODECODER, LPDIRECTXVIDEOACCELERATIONSERVICE, 
LPDIRECTXVIDEODECODERSERVICE,
> > >    LPDIRECT3DDEVICEMANAGER9 are not defined ?
> > 
> > Right.
> > 
> > >  - Can IDirectXVideoDecoder *, IDirectXVideoAccelerationService * ... be 
directly used
> > >  or I need to use struct IDirectXVideoDecoder * ... ?
> > 
> > I think the C version used for ffmpeg does allow you to skip the struct (it
> > compiled fine for me)
>  Thanks
> 
> > Another thing i just noted:
> > const DXVA2_ConfigPictureDecode *cfg;
> > 
> > Remove the const. Just makes things messier to setup.
>  FFmpeg must not modify this structure, so the const is needed IMO.
> In VLC, it does not make any problem to setup:
>  dxva_ctx->cfg = &vlc_ctx->cfg;
> 
> Regards,
> 

Well, in my case it did. I preallocated the structure as follows.
dxva_cfg      = calloc()
dxva_cfg->cfg = calloc()

Then later
DXVA2_ConfigPictureDecode cfg = {}
-- Setup the on stack cfg structure
-- finally
*dxva_cfg->cfg = cfg;

Which then complained about cfg being const. I would have had to use some 
weird cast to get around it. Just find it pointless to make the structure 
const. No big deal obviously, could just use memcpy and cast away the const.

On another note.. You happen to know how to use the GPU to convert the NV12 
surface DXVA gives you directly to a texture using GPU?

For some reason D3DXLoadSurfaceFromSurface keeps returning error on me. I 
don't really want to move the data back to CPU memory like you are doing in 
vlc.






More information about the ffmpeg-devel mailing list