#include "../../video_chroma/copy.h"
static int Open(vlc_va_t *, AVCodecContext *, const es_format_t *);
-static void Close(vlc_va_t *);
+static void Close(vlc_va_t *, AVCodecContext *);
vlc_module_begin()
set_description(N_("DirectX Video Acceleration (DXVA) 2.0"))
(void) data;
}
-static void Close(vlc_va_t *va)
+static void Close(vlc_va_t *va, AVCodecContext *ctx)
{
vlc_va_sys_t *sys = va->sys;
+ (void) ctx;
DxDestroyVideoConversion(sys);
DxDestroyVideoDecoder(sys);
DxDestroyVideoService(sys);
return VLC_SUCCESS;
error:
- Close(va);
+ Close(va, ctx);
return VLC_EGENERIC;
}
/* */
static void vlc_va_Stop(void *func, va_list ap)
{
vlc_va_t *va = va_arg(ap, vlc_va_t *);
- void (*close)(vlc_va_t *) = func;
+ AVCodecContext *ctx = va_arg(ap, AVCodecContext *);
+ void (*close)(vlc_va_t *, AVCodecContext *) = func;
- close(va);
+ close(va, ctx);
}
vlc_va_t *vlc_va_New(vlc_object_t *obj, AVCodecContext *avctx,
return va;
}
-void vlc_va_Delete(vlc_va_t *va)
+void vlc_va_Delete(vlc_va_t *va, AVCodecContext *avctx)
{
- vlc_module_unload(va->module, vlc_va_Stop, va);
+ vlc_module_unload(va->module, vlc_va_Stop, va, avctx);
vlc_object_release(va);
}
* Destroys a libavcodec hardware acceleration back-end.
* All allocated surfaces shall have been released beforehand.
*/
-void vlc_va_Delete(vlc_va_t *);
+void vlc_va_Delete(vlc_va_t *, AVCodecContext *);
#endif
return VLC_EGENERIC;
}
-static void Delete( vlc_va_t *va )
+static void Delete( vlc_va_t *va, AVCodecContext *avctx )
{
vlc_va_sys_t *sys = va->sys;
+ (void) avctx;
if( sys->i_surface_width || sys->i_surface_height )
DestroySurfaces( sys );
return VLC_SUCCESS;
}
-static void Close( vlc_va_t *external )
+static void Close( vlc_va_t *external, AVCodecContext *ctx )
{
vlc_va_vda_t *p_va = vlc_va_vda_Get( external );
CopyCleanCache( &p_va->image_cache );
free( p_va );
+ (void) ctx;
}
static int Setup( vlc_va_t *external, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,
return VLC_SUCCESS;
}
-static void Close( vlc_va_t *external )
+static void Close( vlc_va_t *external, AVCodecContext *avctx )
{
- vlc_va_vda_t *p_va = vlc_va_vda_Get( external );
-
- av_vda_default_free(p_va->avctx);
+ av_vda_default_free(avctx);
+ (void) external;
}
static int Setup( vlc_va_t *external, void **pp_hw_ctx, vlc_fourcc_t *pi_chroma,
avcodec_free_frame( &p_sys->p_ff_pic );
if( p_sys->p_va )
- vlc_va_Delete( p_sys->p_va );
+ vlc_va_Delete( p_sys->p_va, p_sys->p_context );
vlc_sem_destroy( &p_sys->sem_mt );
}
vlc_va_t *p_va = p_sys->p_va;
if( p_va != NULL )
- vlc_va_Delete( p_va );
+ vlc_va_Delete( p_va, p_context );
/* Enumerate available formats */
bool can_hwaccel = false;
return pi_fmt[i];
}
- vlc_va_Delete( p_va );
+ vlc_va_Delete( p_va, p_context );
end:
/* Fallback to default behaviour */
#include "../../codec/avcodec/va.h"
static int Open(vlc_va_t *, AVCodecContext *, const es_format_t *);
-static void Close(vlc_va_t *);
+static void Close(vlc_va_t *, AVCodecContext *);
vlc_module_begin()
set_description(N_("VDPAU video decoder"))
return VLC_EGENERIC;
}
-static void Close(vlc_va_t *va)
+static void Close(vlc_va_t *va, AVCodecContext *avctx)
{
vlc_va_sys_t *sys = va->sys;