|
|
|
@@ -119,6 +119,13 @@ static void dxva2_frames_uninit(AVHWFramesContext *ctx) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
static void dxva2_pool_release_dummy(void *opaque, uint8_t *data) |
|
|
|
{ |
|
|
|
// important not to free anything here--data is a surface object |
|
|
|
// associated with the call to CreateSurface(), and these surfaces are |
|
|
|
// released in dxva2_frames_uninit() |
|
|
|
} |
|
|
|
|
|
|
|
static AVBufferRef *dxva2_pool_alloc(void *opaque, int size) |
|
|
|
{ |
|
|
|
AVHWFramesContext *ctx = (AVHWFramesContext*)opaque; |
|
|
|
@@ -128,7 +135,7 @@ static AVBufferRef *dxva2_pool_alloc(void *opaque, int size) |
|
|
|
if (s->nb_surfaces_used < hwctx->nb_surfaces) { |
|
|
|
s->nb_surfaces_used++; |
|
|
|
return av_buffer_create((uint8_t*)s->surfaces_internal[s->nb_surfaces_used - 1], |
|
|
|
sizeof(*hwctx->surfaces), NULL, 0, 0); |
|
|
|
sizeof(*hwctx->surfaces), dxva2_pool_release_dummy, 0, 0); |
|
|
|
} |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|