]> git.vomp.tv Git - vompclient.git/commitdiff
Fix deadlock between imageomx and videoomx, contains ugly debug code to be removed...
authorMarten Richter <marten.richter@freenet.de>
Sun, 19 Oct 2014 17:19:04 +0000 (19:19 +0200)
committerMarten Richter <marten.richter@freenet.de>
Sun, 19 Oct 2014 17:19:04 +0000 (19:19 +0200)
osdopenvg.cc
other/defposter.png
videoomx.cc

index de536d9561e8fff078ec0ba93dcc4aec2b84b3b9..77f0b425271fc5f2c6f76ae59123b06f605fee36 100644 (file)
@@ -1093,7 +1093,7 @@ void OsdOpenVG::executeDrawCommand(SVGCommand & command)
        } break;
        }
 }
-
+int imcount=0;// this is debug code and should not go into release
 unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
 {
        switch (command.task){
@@ -1103,8 +1103,8 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                 return 0;
        } break;
 
-       case OVGdestroyImageRef: {
-               //Log::getInstance()->log("OSD", Log::DEBUG, "TVMedia Draw Image Destroy %x",command.param1);
+       case OVGdestroyImageRef: {imcount--;
+               Log::getInstance()->log("OSD", Log::DEBUG, "TVMedia Draw Image Destroy %x %d",command.param1,imcount);
                vgDestroyImage((VGImage)command.param1);
                return 0;
        } break;
@@ -1113,7 +1113,7 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                vgDestroyPaint((VGPaint)command.param1);
                return 0;
        } break;
-       case OVGcreateImagePalette: {
+       case OVGcreateImagePalette: {imcount++;
                VGImage input=vgCreateImage(VG_A_8,command.param1, command.param2,
                                VG_IMAGE_QUALITY_NONANTIALIASED|
                                VG_IMAGE_QUALITY_FASTER|VG_IMAGE_QUALITY_BETTER);
@@ -1136,7 +1136,7 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
 
                return handle;
        } break;
-       case OVGcreateMonoBitmap: {
+       case OVGcreateMonoBitmap: {imcount++;
                VGImage handle=vgCreateImage(VG_A_1,command.param1, command.param2,
                                        VG_IMAGE_QUALITY_FASTER);
                //Log::getInstance()->log("OSD", Log::DEBUG, "Draw create mono  %d %d %x %d",command.param1,command.param2,vgGetError(),handle);
@@ -1183,10 +1183,10 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                //Log::getInstance()->log("OSD", Log::DEBUG, "Draw create file  %d %d %x %d",command.param1,command.param2,vgGetError(),handle);
                return handle;
        } break;*/
-       case OVGcreateImageMemory: {
+       case OVGcreateImageMemory: {imcount++;
                PictureInfo *info = (PictureInfo*) command.data;
                VGImage handle;
-               //Log::getInstance()->log("OSD", Log::DEBUG, "TVMedia OVGcreateImageMemory");
+               Log::getInstance()->log("OSD", Log::DEBUG, "TVMedia OVGcreateImageMemory %d",imcount);
                handle=vgCreateImage(VG_sABGR_8888,info->width,info->height,VG_IMAGE_QUALITY_BETTER);
                vgImageSubData(handle,info->image,info->width*4,
                                                        VG_sABGR_8888,0,0,info->width,info->height);
@@ -1212,12 +1212,12 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command)
                delete info;
 
        } break;
-       case OVGcreateEGLImage: {
+       case OVGcreateEGLImage: {imcount++;
                PictureInfo *info = (PictureInfo*) command.data;
                VGImage handle;
 
                handle=vgCreateImage(VG_sABGR_8888,info->width,info->height,VG_IMAGE_QUALITY_BETTER);
-               //Log::getInstance()->log("OSD", Log::DEBUG, "TVMedia OVGcreateEGLImage %d %d %x",info->width,info->height, handle);
+               Log::getInstance()->log("OSD", Log::DEBUG, "TVMedia OVGcreateEGLImage %d %d %x %d",info->width,info->height, handle,imcount);
 
                info->handle = handle;
                info->reference =  eglCreateImageKHR(egl_display, egl_context, EGL_VG_PARENT_IMAGE_KHR, (EGLClientBuffer)handle, NULL);
index ba7e4df5cc0ad036c1a95c97790b70f1b4855722..1bfe1bd0b4664f6dba462f719b9f9748b425c9ad 100644 (file)
Binary files a/other/defposter.png and b/other/defposter.png differ
index c5acde39d5649218db32f849fbc08fe6578b6309..83321cef14ed1de8b4da206d3a26dc0f44ed70b4 100644 (file)
@@ -1803,6 +1803,7 @@ int VideoOMX::clearEventsForComponent(OMX_HANDLETYPE handle)
 void VideoOMX::checkForStalledBuffers()
 {
        //Log::getInstance()->log("Video", Log::DEBUG, "Check stalled");
+       clock_mutex.Lock();
        omx_event_mutex.Lock();
        list<VPE_OMX_EVENT>::iterator itty=omx_events.begin();
        while (itty!=omx_events.end()) {
@@ -1816,7 +1817,7 @@ void VideoOMX::checkForStalledBuffers()
                        stall_conf.nVersion.nVersion=OMX_VERSION;
                        stall_conf.nPortIndex=omx_codec_output_port;
                        stall_conf.nDelay=200000;
-                       clock_mutex.Lock();
+
                        error=OMX_GetConfig(omx_vid_dec,OMX_IndexConfigBufferStall,&stall_conf);
                        if (error!=OMX_ErrorNone){
                                        Log::getInstance()->log("Video", Log::DEBUG, "Get OMX_IndexConfigBufferStall failed %x", error);
@@ -1824,7 +1825,6 @@ void VideoOMX::checkForStalledBuffers()
                                        omx_event_mutex.Unlock();
                                        return ;
                                }
-                       clock_mutex.Unlock();
                        if (stall_conf.bStalled==OMX_TRUE) {
                                omx_vid_stalled=true;
                                Log::getInstance()->log("Video", Log::DEBUG, "Video decoder stalled! %d", stall_conf.nDelay);
@@ -1838,6 +1838,7 @@ void VideoOMX::checkForStalledBuffers()
                itty++;
        }
        omx_event_mutex.Unlock();
+       clock_mutex.Unlock();
 }