From 9522a2b2be76d0f9c9d0e5adbad0bce9e78a7993 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sun, 19 Oct 2014 19:19:04 +0200 Subject: [PATCH] Fix deadlock between imageomx and videoomx, contains ugly debug code to be removed before release --- osdopenvg.cc | 18 +++++++++--------- other/defposter.png | Bin 1586 -> 1330 bytes videoomx.cc | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) 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 ba7e4df5cc0ad036c1a95c97790b70f1b4855722..1bfe1bd0b4664f6dba462f719b9f9748b425c9ad 100644 GIT binary patch delta 1301 zcmV+w1?u{;46+K485#xv003%0j9~x(00v@9M??Vs0RI60puMM)ks%m=2XskIMF-vr z6A&!|KK`$q000EPNklTM0=NwXfN`*kc1zf65?QXX_yxqxP`+5pkOuh{qH*ZvtnB{s-{!aN#jJ18hVdoHv24q1-a?>(F)&c#!kiY3G1% z0oMxAO#%Kmy$M{79QZA(Ym8u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A$6*!Q*&?6oMB~Qd_75OTka|c+GVMe``=ib=l$FG6V)9u& z*M}Pp*aHCTnqbD`D}bu5JijT}zM%kKPtCAD;&1j{hyuI-N#Pp@d;qHl2?A;X^p@)& zpakfxr;`DwC!j0-Q2+*YXyfYUR`hwArrH$s((CKC5nnd?vT}6{b+qCO;Cln$D2uk$ znJr7Jle2_>H-F3L`YXLpQGhzx?7AIy7w>=m>|DSnOB*;a&P~yh0000WV@Og>004R= z004l4008;_004mL004C`008P>0026e000+nl3&F}000EJNklR4MT?bvvn55NmEesj%B%!0lK?c|;9h8dHf0egg5!3PQsQaH_Jrd(X&i+t z6nqn-fs!%S8wX#{D8)+T^ecdFPdcZ73%Gy_xPO2PxPS||faj34Hx&`@QB1jEszJsS zJ?^k947`o8KuMOhyl5EwB)=(S#e5W|$BQ(xcJ-Vy4BkMO#y7^pe7r>Sm?Gm2tgEp^ zMil`UZ~+%^0T=N2)M4Rvjqh-&8zZO3EuQyh=k|pB8+?$&^o9woa(|N(Jj1^>imYM2rHQL{s>4op@w1(>_5!c- zrJZ`bmsUQrGm#kJW!~o>8#5q}{T!e#?nI)K2}RacvLR;pPr1%s*5o|j!+;`d(`*g{ z*R6?rj9+4J_piCi=d8R)<;5H4`ynSMqLzoL^UCHXPj5%uT0b!>;Bno{Ml@I)4)f z!CRG|vW!y|6LuZ%MI5)AS*I*S2!9;MwG6w7GkLDq%wZmg&*#i^&P6=Vajn*0(Bt?r zc5*6SY!l$i*&ElCggIAnSi%=03>v4>)i@Nc$D6gX z*0gP-LL+NKGazdc3E8GZz<&i?zy(~u1zf-dT)=bd@q^lBA3F_Go#3)&*~bCDtR3|2 z>RG1AfwuCa@kHXRQdY|CSx2{1bofpuy|gKsW_G>p+}Ko1$9&rAmxkEO>F}hr`yh8uXrqViB>DPE%vevJ4m9x{ImuMsFbS3|vLtD0uwlog("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(); } -- 2.39.5