static void DestroySurfaces( vlc_va_vaapi_t *p_va ) { if( p_va->image.image_id != VA_INVALID_ID ) { CopyCleanCache( &p_va->image_cache ); vaDestroyImage( p_va->p_display, p_va->image.image_id ); } else if(p_va->b_supports_derive) { CopyCleanCache( &p_va->image_cache ); } if( p_va->i_context_id != VA_INVALID_ID ) vaDestroyContext( p_va->p_display, p_va->i_context_id ); for( int i = 0; i < p_va->i_surface_count && p_va->p_surface; i++ ) { vlc_va_surface_t *p_surface = &p_va->p_surface[i]; if( p_surface->i_id != VA_INVALID_SURFACE ) vaDestroySurfaces( p_va->p_display, &p_surface->i_id, 1 ); } free( p_va->p_surface ); /* */ p_va->image.image_id = VA_INVALID_ID; p_va->i_context_id = VA_INVALID_ID; p_va->p_surface = NULL; p_va->i_surface_width = 0; p_va->i_surface_height = 0; }
static void Close( vlc_va_t *external ) { vlc_va_vda_t *p_va = vlc_va_vda_Get( external ); msg_Dbg(p_va->p_log, "destroying VDA decoder"); ff_vda_destroy_decoder( &p_va->hw_ctx ) ; if( p_va->hw_ctx.cv_pix_fmt_type == kCVPixelFormatType_420YpCbCr8Planar ) CopyCleanCache( &p_va->image_cache ); free( p_va ); }
static void Close( vlc_va_t *p_external ) { vlc_va_vda_t *p_va = vlc_va_vda_Get( p_external ); ff_vda_destroy_decoder( &p_va->hw_ctx ) ; if( p_va->top_frame ) ff_vda_release_vda_frame( p_va->top_frame ); if( p_va->hw_ctx.cv_pix_fmt_type == kCVPixelFormatType_420YpCbCr8Planar ) CopyCleanCache( &p_va->image_cache ); free( p_va ); }
static void Close( vlc_va_t *va, AVCodecContext *ctx ) { vlc_va_vda_t *p_vda = vlc_va_vda_Get( va ); msg_Dbg(va, "destroying VDA decoder"); ff_vda_destroy_decoder( &p_vda->hw_ctx ) ; if( p_vda->hw_ctx.cv_pix_fmt_type == kCVPixelFormatType_420YpCbCr8Planar ) CopyCleanCache( &p_vda->image_cache ); free( p_vda ); (void) ctx; }
void ArchitectureSpecificCopyHooksDestroy( int i_color_format, ArchitectureSpecificCopyData *p_architecture_specific ) { if (!p_architecture_specific->data) return; #ifdef CAN_COMPILE_SSE2 if( i_color_format == OMX_COLOR_FormatYUV420SemiPlanar && vlc_CPU_SSE2() ) { copy_cache_t *p_surface_cache = (copy_cache_t*)p_architecture_specific->data; CopyCleanCache(p_surface_cache); } #endif free(p_architecture_specific->data); p_architecture_specific->data = NULL; }
static void Delete( vlc_va_t *va, AVCodecContext *avctx ) { vlc_va_sys_t *sys = va->sys; (void) avctx; vlc_mutex_destroy(&sys->lock); CopyCleanCache(&sys->image_cache); vaDestroyContext(sys->hw_ctx.display, sys->hw_ctx.context_id); vaDestroySurfaces(sys->hw_ctx.display, sys->surfaces, sys->count); vaDestroyConfig(sys->hw_ctx.display, sys->hw_ctx.config_id); vaTerminate(sys->hw_ctx.display); #ifdef VLC_VA_BACKEND_XLIB XCloseDisplay( sys->p_display_x11 ); #endif #ifdef VLC_VA_BACKEND_DRM close( sys->drm_fd ); #endif free( sys ); }
static void DxDestroyVideoConversion(vlc_va_dxva2_t *va) { CopyCleanCache(&va->surface_cache); }