From: Marten Richter Date: Sun, 19 Oct 2014 17:19:04 +0000 (+0200) Subject: Fix deadlock between imageomx and videoomx, contains ugly debug code to be removed... X-Git-Tag: 0-5-0~50 X-Git-Url: https://git.vomp.tv/gitweb/?a=commitdiff_plain;h=9522a2b2be76d0f9c9d0e5adbad0bce9e78a7993;p=vompclient.git Fix deadlock between imageomx and videoomx, contains ugly debug code to be removed before release --- diff --git a/osdopenvg.cc b/osdopenvg.cc index de536d9..77f0b42 100644 --- a/osdopenvg.cc +++ b/osdopenvg.cc @@ -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); diff --git a/other/defposter.png b/other/defposter.png index ba7e4df..1bfe1bd 100644 Binary files a/other/defposter.png and b/other/defposter.png differ diff --git a/videoomx.cc b/videoomx.cc index c5acde3..83321ce 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -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::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(); }