Commit a2b59c02 authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/xvba_videx_{x11,glx}: add debugging code

Assert if prerequisites are not met.
parent 78db28b6
...@@ -554,16 +554,23 @@ xvba_DestroySurfaces( ...@@ -554,16 +554,23 @@ xvba_DestroySurfaces(
#if USE_GLX #if USE_GLX
if (obj_surface->gl_surface) { if (obj_surface->gl_surface) {
/* NOTE: multiple VASurfaces can point to the same GLX Surface
* therefor only unref the surface here. The GLX Surface will
* be destroyed automatically when the refcount reaches 0. */
glx_surface_unref(driver_data, obj_surface->gl_surface); glx_surface_unref(driver_data, obj_surface->gl_surface);
obj_surface->gl_surface = NULL; obj_surface->gl_surface = NULL;
} }
#endif #endif
for (j = 0; j < obj_surface->output_surfaces_count; j++) { for (j = 0; j < obj_surface->output_surfaces_count; j++) {
/* NOTE: multiple VASurfaces can point to the same output surface
* therefor only unref the surface here. The output surface will
* be destroyed automatically when the refcount reaches 0. */
output_surface_unref(driver_data, obj_surface->output_surfaces[j]); output_surface_unref(driver_data, obj_surface->output_surfaces[j]);
obj_surface->output_surfaces[j] = NULL; obj_surface->output_surfaces[j] = NULL;
} }
free(obj_surface->output_surfaces); free(obj_surface->output_surfaces);
obj_surface->output_surfaces = NULL;
obj_surface->output_surfaces_count = 0; obj_surface->output_surfaces_count = 0;
obj_surface->output_surfaces_count_max = 0; obj_surface->output_surfaces_count_max = 0;
......
...@@ -633,6 +633,8 @@ destroy_glx_surface( ...@@ -633,6 +633,8 @@ destroy_glx_surface(
if (!obj_glx_surface) if (!obj_glx_surface)
return; return;
ASSERT(obj_glx_surface->refcount == 0);
if (obj_glx_surface->texture) { if (obj_glx_surface->texture) {
gl_destroy_texture(&obj_glx_surface->texture, obj_glx_surface->target); gl_destroy_texture(&obj_glx_surface->texture, obj_glx_surface->target);
obj_glx_surface->texture = 0; obj_glx_surface->texture = 0;
...@@ -1106,6 +1108,7 @@ transfer_surface_native( ...@@ -1106,6 +1108,7 @@ transfer_surface_native(
obj_glx_surface->evergreen_params_count = n_params; obj_glx_surface->evergreen_params_count = n_params;
if (shader_fp && shader_fp_length) { if (shader_fp && shader_fp_length) {
ASSERT(obj_glx_surface->evergreen_shader == NULL);
obj_glx_surface->evergreen_shader = gl_create_shader_object( obj_glx_surface->evergreen_shader = gl_create_shader_object(
shader_fp, shader_fp,
shader_fp_length shader_fp_length
......
...@@ -58,6 +58,8 @@ output_surface_destroy( ...@@ -58,6 +58,8 @@ output_surface_destroy(
object_output_p obj_output object_output_p obj_output
) )
{ {
ASSERT(obj_output->refcount == 0);
#if USE_GLX #if USE_GLX
if (obj_output->glx) { if (obj_output->glx) {
glx_output_surface_destroy(driver_data, obj_output->glx); glx_output_surface_destroy(driver_data, obj_output->glx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment