From afdc53066fa1c5ec65af275db7b4a996e39597fa Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Fri, 25 May 2012 20:53:27 +0200 Subject: [PATCH] Adding Logging over mulitple lines for querying opengl --- log.cc | 12 ++++++++++++ log.h | 1 + osdopengl.cc | 20 ++++++++++++++++++-- videovpeogl.cc | 28 +++++++++++----------------- 4 files changed, 42 insertions(+), 19 deletions(-) mode change 100644 => 100755 log.cc mode change 100644 => 100755 log.h diff --git a/log.cc b/log.cc old mode 100644 new mode 100755 index 5ed65f6..2c39da1 --- a/log.cc +++ b/log.cc @@ -198,7 +198,19 @@ int Log::log(const char *fromModule, int level,const char* message, ...) } +void Log::logLongString(const char *fromModule, int level,const char *message) +{ + int string_size=strlen(message); + char buffer[100]; + const char * pointer=message; + for (int str_written=0; str_writtenlog("OSD", Log::NOTICE, "%s",query_str); + if (query_str) Log::getInstance()->logLongString("OSD", Log::NOTICE, query_str); else Log::getInstance()->log("OSD", Log::WARN, "Could not query display %x",eglGetError()); query_str=eglQueryString(egl_display,EGL_EXTENSIONS); - if (query_str) Log::getInstance()->log("OSD", Log::NOTICE, "%s",query_str); + if (query_str) Log::getInstance()->logLongString("OSD", Log::NOTICE, query_str); else Log::getInstance()->log("OSD", Log::WARN, "Could not query display %x",eglGetError()); const EGLint attributs[]={ @@ -185,6 +185,22 @@ int OsdOpenGL::init(void* device) } // Test stuff + query_str=(const char*)glGetString(GL_VERSION) ; + if (query_str) Log::getInstance()->logLongString("OSD", Log::NOTICE, query_str); + else Log::getInstance()->log("OSD", Log::WARN, "Could not query display %x",glGetError()); + + query_str=(const char*)glGetString(GL_VENDOR) ; + if (query_str) Log::getInstance()->logLongString("OSD", Log::NOTICE, query_str); + else Log::getInstance()->log("OSD", Log::WARN, "Could not query display %x",glGetError()); + + query_str=(const char*)glGetString(GL_RENDERER) ; + if (query_str) Log::getInstance()->logLongString("OSD", Log::NOTICE, query_str); + else Log::getInstance()->log("OSD", Log::WARN, "Could not query display %x",glGetError()); + + query_str=(const char*)glGetString(GL_EXTENSIONS) ; + if (query_str) Log::getInstance()->logLongString("OSD", Log::NOTICE, query_str); + else Log::getInstance()->log("OSD", Log::WARN, "Could not query display %x",glGetError()); + //Now we will create the Screen diff --git a/videovpeogl.cc b/videovpeogl.cc index 95bafb2..6c7bed4 100755 --- a/videovpeogl.cc +++ b/videovpeogl.cc @@ -462,15 +462,6 @@ int VideoVPEOGL::AllocateCodecsOMX() - - - - - - - - - OMX_VIDEO_PARAM_PORTFORMATTYPE ft_type; ft_type.nSize=sizeof(ft_type); ft_type.nVersion.nVersion=OMX_VERSION; @@ -482,6 +473,14 @@ int VideoVPEOGL::AllocateCodecsOMX() ft_type.eCompressionFormat=OMX_VIDEO_CodingMPEG2; } + Demuxer* demux=Demuxer::getInstance(); + + ft_type.xFramerate=demux->getFrameRate()*(1<<16); + error=OMX_SetParameter(omx_vid_dec,OMX_IndexParamVideoPortFormat,&ft_type); + if (error!=OMX_ErrorNone){ + Log::getInstance()->log("Video", Log::DEBUG, "Init OMX_IndexParamVideoPortFormat failed %x", error); + } + error=OMX_SendCommand(omx_vid_dec,OMX_CommandStateSet,OMX_StateIdle,0); if (error!=OMX_ErrorNone){ @@ -489,13 +488,7 @@ int VideoVPEOGL::AllocateCodecsOMX() return 0; } - Demuxer* demux=Demuxer::getInstance(); - ft_type.xFramerate=demux->getFrameRate()*(1<<16); - error=OMX_SetParameter(omx_vid_dec,OMX_IndexParamVideoPortFormat,&ft_type); - if (error!=OMX_ErrorNone){ - Log::getInstance()->log("Video", Log::DEBUG, "Init OMX_IndexParamVideoPortFormat failed %x", error); - } /* if (h264) { OMX_NALSTREAMFORMATTYPE nalu_type; @@ -518,7 +511,8 @@ int VideoVPEOGL::AllocateCodecsOMX() return 0; } - + //TODO activate this code +/* error=OMX_SetupTunnel(omx_vid_dec,omx_codec_output_port,omx_vid_sched,omx_shed_input_port); if (error!=OMX_ErrorNone){ Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel dec to sched failed %x", error); @@ -533,7 +527,7 @@ int VideoVPEOGL::AllocateCodecsOMX() Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel sched to rend failed %x", error); DeAllocateCodecsOMX(); return 0; - } + }*/ -- 2.39.5