All pastes #2056559 Raw Edit

Something

public text v1 · immutable
#2056559 ·published 2011-05-11 03:45 UTC
rendered paste body
diff --git a/mythtv/libs/libmythui/mythrender_vdpau.cpp b/mythtv/libs/libmythui/mythrender_vdpau.cpp
index 0b2c081..3392c15 100644
--- a/mythtv/libs/libmythui/mythrender_vdpau.cpp
+++ b/mythtv/libs/libmythui/mythrender_vdpau.cpp
@@ -422,6 +422,40 @@ void MythRenderVDPAU::WaitForFlip(void)
     INIT_ST
     VdpTime dummy = 0;
     usleep(2000);
+
+    {
+        //LOCK_RENDER
+        //CHECK_STATUS()
+        QString out;
+        VdpTime time;
+        VdpPresentationQueueStatus status;
+        bool this_idle = false;
+        bool some_idle = false;
+        for (int i = 0; i < m_surfaces.size(); i++)
+        {
+            VdpOutputSurface surf = m_outputSurfaces[m_surfaces[i]].m_id;
+            vdp_presentation_queue_query_surface_status(m_flipQueue, surf,
+                                                        &status, &time);
+            if (VDP_PRESENTATION_QUEUE_STATUS_IDLE == status)
+            {
+                some_idle = true;
+                if (surf == surface)
+                    this_idle = true;
+                out += "I";
+            }
+            else if (VDP_PRESENTATION_QUEUE_STATUS_QUEUED == status)
+                out += "Q";
+            else if (VDP_PRESENTATION_QUEUE_STATUS_VISIBLE == status)
+                out += "V";
+        }
+        //VERBOSE(VB_IMPORTANT, LOC + QString("Queue status: %1").arg(out));
+        if (!some_idle || !this_idle)
+        {
+            VERBOSE(VB_PLAYBACK, LOC + QString("Queue: current %1 some %2 (%3)")
+                .arg(this_idle).arg(some_idle).arg(out));
+        }
+    }
+
     vdp_st = vdp_presentation_queue_block_until_surface_idle(
                 m_flipQueue, surface, &dummy);
     CHECK_ST
@@ -1501,6 +1535,8 @@ bool MythRenderVDPAU::GetProcs(void)
         vdp_presentation_queue_get_time);
     GET_PROC(VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR,
         vdp_presentation_queue_set_background_color);
+    GET_PROC(VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS,
+        vdp_presentation_queue_query_surface_status);
     GET_PROC(VDP_FUNC_ID_DECODER_CREATE,  vdp_decoder_create);
     GET_PROC(VDP_FUNC_ID_DECODER_DESTROY, vdp_decoder_destroy);
     GET_PROC(VDP_FUNC_ID_DECODER_RENDER,  vdp_decoder_render);
@@ -1716,6 +1752,7 @@ void MythRenderVDPAU::ResetProcs(void)
     vdp_presentation_queue_target_create_x11 = NULL;
     vdp_presentation_queue_get_time = NULL;
     vdp_presentation_queue_set_background_color = NULL;
+    vdp_presentation_queue_query_surface_status = NULL;
     vdp_decoder_create = NULL;
     vdp_decoder_destroy = NULL;
     vdp_decoder_render = NULL;
diff --git a/mythtv/libs/libmythui/mythrender_vdpau.h b/mythtv/libs/libmythui/mythrender_vdpau.h
index 2a0d675..cbaa34f 100644
--- a/mythtv/libs/libmythui/mythrender_vdpau.h
+++ b/mythtv/libs/libmythui/mythrender_vdpau.h
@@ -211,6 +211,8 @@ class MUI_PUBLIC MythRenderVDPAU : public MythRender
     VdpPresentationQueueGetTime     *vdp_presentation_queue_get_time;
     VdpPresentationQueueSetBackgroundColor
                                     *vdp_presentation_queue_set_background_color;
+    VdpPresentationQueueQuerySurfaceStatus
+                                    *vdp_presentation_queue_query_surface_status;
     VdpDecoderCreate                *vdp_decoder_create;
     VdpDecoderDestroy               *vdp_decoder_destroy;
     VdpDecoderRender                *vdp_decoder_render;