Quoting Hendrik Leppkes (2016-05-03 15:05:10)
> On Tue, May 3, 2016 at 2:56 PM, Anton Khirnov <[email protected]> wrote:
> > +static int dxva2_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
> > +                               const AVFrame *src)
> > +{
> > +    IDirect3DSurface9 *surface;
> > +    D3DSURFACE_DESC    surfaceDesc;
> > +    D3DLOCKED_RECT     LockedRect;
> > +    HRESULT            hr;
> > +
> > +    int download = !!src->hw_frames_ctx;
> > +
> > +    surface = (IDirect3DSurface9*)(download ? src->data[3] : dst->data[3]);
> > +
> > +    hr = IDirect3DSurface9_GetDesc(surface, &surfaceDesc);
> > +    if (FAILED(hr)) {
> > +        av_log(ctx, AV_LOG_ERROR, "Error getting a surface description\n");
> > +        return AVERROR_UNKNOWN;
> > +    }
> > +
> > +    hr = IDirect3DSurface9_LockRect(surface, &LockedRect, NULL, 
> > D3DLOCK_READONLY);
> 
> Apparently this function is meant to support upload as well? Probably
> shouldn't lock readonly in that case then.
> 

Right, changed to D3DLOCK_DISCARD for upload.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to