From 675b15adf245c7af9d8bdd3ba885bfc4687370f0 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 3 Feb 2017 19:20:01 +0000 Subject: [PATCH] More compiler warning fixes --- audioomx.cc | 88 +++++++++++++++++++++++++++------------------------- audioomx.h | 2 ++ imageomx.cc | 26 +++++++++++----- imageomx.h | 3 ++ log.cc | 2 +- osdopenvg.cc | 35 +++++++++++++-------- videoomx.cc | 58 ++++++++++++++++++---------------- videoomx.h | 8 +++-- 8 files changed, 128 insertions(+), 94 deletions(-) diff --git a/audioomx.cc b/audioomx.cc index d0d8e24..048ffb0 100644 --- a/audioomx.cc +++ b/audioomx.cc @@ -73,6 +73,7 @@ AudioOMX::AudioOMX() mp3sameheader=0; mp3sameheadercount=0; + strcpy(L_VPE_OMX_AUDIO_REND, VPE_OMX_AUDIO_REND); } AudioOMX::~AudioOMX() @@ -946,7 +947,7 @@ int AudioOMX::AllocateCodecsOMX() } video->LockClock(); - error = OMX_GetHandle(&omx_aud_rend, VPE_OMX_AUDIO_REND, NULL, &callbacks); + error = OMX_GetHandle(&omx_aud_rend, L_VPE_OMX_AUDIO_REND, NULL, &callbacks); if (error != OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, "Init OMX audio rend failed %x", error); @@ -1218,7 +1219,7 @@ int AudioOMX::DestroyInputBufsOMX() //call with clock mutex locked cur_input_buf_omx=NULL; input_bufs_omx_mutex.Lock(); - for (int i=0; i< input_bufs_omx_all.size();i++) { + for (UINT i=0; i< input_bufs_omx_all.size();i++) { error=OMX_FreeBuffer(omx_aud_rend/*dec*/,omx_rend_input_port/*codec*/,input_bufs_omx_all[i]); if (error!=OMX_ErrorNone){ Log::getInstance()->log("Audio", Log::DEBUG, "Use OMX_FreeBuffer failed %x", error); @@ -1231,11 +1232,12 @@ int AudioOMX::DestroyInputBufsOMX() //call with clock mutex locked input_bufs_omx_free.clear(); input_bufs_omx_mutex.Unlock(); + return 1; } int AudioOMX::DestroyInputBufsOMXwhilePlaying() //call with clock mutex locked { - OMX_ERRORTYPE error; + //OMX_ERRORTYPE error; cur_input_buf_omx=NULL; input_bufs_omx_mutex.Lock(); @@ -1276,7 +1278,7 @@ int AudioOMX::DeAllocateCodecsOMX() Log::getInstance()->log("Audio", Log::DEBUG, "deallocatecodecsomx mark 1"); if (cur_input_buf_omx) { cur_input_buf_omx->nFlags|=OMX_BUFFERFLAG_EOS; - OMX_ERRORTYPE error=video->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/,cur_input_buf_omx); + error=video->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/,cur_input_buf_omx); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, "OMX_EmptyThisBuffer 6 failed %x", error); } @@ -1380,19 +1382,19 @@ int AudioOMX::DeAllocateCodecsOMX() - error=OMX_SetupTunnel(omx_aud_rend,omx_rend_input_port,NULL,NULL); + error=OMX_SetupTunnel(omx_aud_rend,omx_rend_input_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_clock,omx_clock_output_port,NULL,NULL); + error=OMX_SetupTunnel(omx_clock,omx_clock_output_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_aud_rend,omx_rend_clock_port,NULL,NULL); + error=OMX_SetupTunnel(omx_aud_rend,omx_rend_clock_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); @@ -1592,12 +1594,12 @@ int AudioOMX::test() unsigned int AudioOMX::AdvanceMpAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize) { if (size<=2) return size; // silly; - unsigned int test=0; + unsigned int atest=0; *framesize=0; //inspired by libav parsing code - while (test+1 reserved + while (atest+1 reserved //sanity check inspired by libav @@ -1612,18 +1614,18 @@ unsigned int AudioOMX::AdvanceMpAudioSync(const UCHAR *data,unsigned int size,un 48, 56, 64, 80, 96, 112, 128, 144, 160 } } }; int lsf=0; int mpeg2=0; - int layer=4-((data[test+1]&0x06)>>1); - if (layer==4) {test++;continue;} //sanity check + int layer=4-((data[atest+1]&0x06)>>1); + if (layer==4) {atest++;continue;} //sanity check - int bitrate_index=(data[test+2]&0xf0)>>4; - if (bitrate_index==0x0f || bitrate_index==0x0) {test++;continue;} //sanity check + int bitrate_index=(data[atest+2]&0xf0)>>4; + if (bitrate_index==0x0f || bitrate_index==0x0) {atest++;continue;} //sanity check - int samplerate_index=(data[test+2]&0x0C)>>2; - if (samplerate_index==0x03) {test++;continue;} //sanity check + int samplerate_index=(data[atest+2]&0x0C)>>2; + if (samplerate_index==0x03) {atest++;continue;} //sanity check - int padding=(data[test+2]&2)>>1; - if (0x10 & data[test+1]) { - lsf=((data[test+1]) &0x8)?0:1; + int padding=(data[atest+2]&2)>>1; + if (0x10 & data[atest+1]) { + lsf=((data[atest+1]) &0x8)?0:1; mpeg2=0; } else { lsf=1; @@ -1642,7 +1644,7 @@ unsigned int AudioOMX::AdvanceMpAudioSync(const UCHAR *data,unsigned int size,un frame_size=(temp_frame_size*144000)/(sample_rate<log("Audio", Log::DEBUG, "FRAME: %d %d %d %d %d %d %d",lsf,layer,bitrate_index,sample_rate,padding,temp_frame_size, frame_size); - //Log::getInstance()->log("Audio", Log::DEBUG, "FRAME DIAG: %x %x %x %d",data[test],data[test+1],data[test+2],mp3sameheadercount); + //Log::getInstance()->log("Audio", Log::DEBUG, "FRAME DIAG: %x %x %x %d",data[atest],data[atest+1],data[atest+2],mp3sameheadercount); if (mp3sameheadercount>4) { *framesize=frame_size; - return test; // probably FrameSync + return atest; // probably FrameSync } //skip it if the header changes too frequently } - test++; + atest++; } return size; } @@ -1672,19 +1674,19 @@ unsigned int AudioOMX::AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,u 160, 160, 192, 192, 224, 224, 256, 256, 320, 320, 384, 384, 448, 448, 512, 512, 640, 640, 768, 768, 896, 896, 1024, 1024, 1152, 1152, 1280, 1280, }; - unsigned int test=0; + unsigned int atest=0; *framesize=20000; //if we do not find a start code do not decompress - while (test+4>6; unsigned char frmsize=(code &0x3f); if (fscod!=0) Log::getInstance()->log("Audio", Log::DEBUG, "warning we only support 48 KHz sampling rate"); *framesize=frm_size_tab[frmsize]*2; - return test; // probably FrameSync + return atest; // probably FrameSync } - test++; + atest++; } return size; } @@ -1692,16 +1694,16 @@ unsigned int AudioOMX::AdvanceAc3AudioSync(const UCHAR *data,unsigned int size,u unsigned int AudioOMX::AdvanceAacLatmAudioSync(const UCHAR *data,unsigned int size,unsigned int *framesize) { if (size<=4) return size; // silly; - unsigned int test=0; + unsigned int atest=0; *framesize=20000; //if we do not find a start code do not decompress - while (test+4InIframemode()) { samplepos = 0; MILLISLEEP(10); @@ -1802,7 +1804,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, firstsynched = false; decompress_buffer_filled=0; if (cur_input_buf_omx) { - OMX_ERRORTYPE error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, + error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, cur_input_buf_omx); if (error != OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, @@ -1822,7 +1824,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, decompress_buffer_filled=0; if (cur_input_buf_omx) { - OMX_ERRORTYPE error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, + error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, cur_input_buf_omx); if (error != OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, @@ -1857,7 +1859,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, if (packet.synched) { if (cur_input_buf_omx) { //cur_input_buf_omx->nFlags |= OMX_BUFFERFLAG_ENDOFFRAME; - OMX_ERRORTYPE error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, + error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, cur_input_buf_omx); if (error != OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, @@ -1960,7 +1962,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, } break; }; - if (adv!=haveToCopy) { + if (adv != (int)haveToCopy) { lsync=false; haveToCopy-=adv; *samplepos+=adv; @@ -2111,7 +2113,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, // Log::getInstance()->log("Audio", Log::DEBUG,"libav out"); int save_size=incoming_paket_libav.size; - if (gotframesize<=incoming_paket_libav.size) { + if ((int)gotframesize <= incoming_paket_libav.size) { if (gotframesize>0) incoming_paket_libav.size=gotframesize; len = avcodec_decode_audio4(current_context, decode_frame_libav, &gotta, &incoming_paket_libav); @@ -2184,7 +2186,7 @@ UINT AudioOMX::DeliverMediaPacket(MediaPacket packet, const UCHAR* buffer, // I doubt that this will ever happen // Log::getInstance()->log("Audio", Log::DEBUG, // "P 2 Time code %lld pts %lld", lastreftimeOMX, packet.pts); - OMX_ERRORTYPE error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, + error = vw->ProtOMXEmptyThisBuffer(omx_aud_rend/*dec*/, cur_input_buf_omx); if (error != OMX_ErrorNone) { Log::getInstance()->log("Audio", Log::DEBUG, diff --git a/audioomx.h b/audioomx.h index 6c16d64..5a3b18d 100644 --- a/audioomx.h +++ b/audioomx.h @@ -199,6 +199,8 @@ class AudioOMX : public Audio int InitDecoderLibAV(); void DeinitDecoderLibAV(); + char L_VPE_OMX_AUDIO_REND[128]; + }; #endif diff --git a/imageomx.cc b/imageomx.cc index 8c288fe..501542b 100644 --- a/imageomx.cc +++ b/imageomx.cc @@ -38,6 +38,9 @@ ImageOMX::ImageOMX(OsdVector::PictureReader * treader):OsdVector::PictureDecoder buf_head_egl=NULL; curformat = Unsupported; + + strcpy(L_VPE_OMX_IMAGE_DECODER, VPE_OMX_IMAGE_DECODER); + strcpy(L_VPE_OMX_EGL_REND, VPE_OMX_EGL_REND); } ImageOMX::~ImageOMX() @@ -139,7 +142,7 @@ int ImageOMX::AllocateCodecsOMX(unsigned char * buffer, unsigned int length) video->LockClock(); - error = OMX_GetHandle(&omx_imag_decode, VPE_OMX_IMAGE_DECODER, NULL, &callbacks); + error = OMX_GetHandle(&omx_imag_decode, L_VPE_OMX_IMAGE_DECODER, NULL, &callbacks); if (error != OMX_ErrorNone) { Log::getInstance()->log("Image", Log::DEBUG, "Init OMX Image decoder failed %x", error); @@ -175,6 +178,9 @@ int ImageOMX::AllocateCodecsOMX(unsigned char * buffer, unsigned int length) break; case PNG: ft_type.eCompressionFormat=OMX_IMAGE_CodingPNG; break; + + case Unsupported: + ; } @@ -262,7 +268,7 @@ unsigned char* ImageOMX::decodePicture(LoadIndex index, unsigned char * buffer, VideoOMX *video=(VideoOMX*)Video::getInstance(); - if (!pictcreat) return false; + if (!pictcreat) return NULL; int oldcancelstate; int oldcanceltype; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldcancelstate); @@ -272,7 +278,7 @@ unsigned char* ImageOMX::decodePicture(LoadIndex index, unsigned char * buffer, DeAllocateCodecsOMX(); pthread_setcancelstate(oldcancelstate, NULL); pthread_setcanceltype(oldcanceltype, NULL); - return false; + return NULL; } bool ret=intDecodePicture(index, buffer, length, pictcreat, video); DeAllocateCodecsOMX(); @@ -382,6 +388,9 @@ bool ImageOMX::intDecodePicture(LoadIndex index, unsigned char * buffer, unsigne port_def_type.format.image.nFrameHeight+=-(port_def_type.format.image.nFrameHeight%32); // The OpenMax png part is broken for the last slice // so we cut the broken part, not nice but works break; + + case Unsupported: + ; } @@ -400,7 +409,7 @@ bool ImageOMX::intDecodePicture(LoadIndex index, unsigned char * buffer, unsigne // Log::getInstance()->log("Image", Log::DEBUG, // "decodePicture 5 6"); - error=OMX_GetHandle(&omx_egl_render,VPE_OMX_EGL_REND,NULL,&callbacks); + error=OMX_GetHandle(&omx_egl_render,L_VPE_OMX_EGL_REND,NULL,&callbacks); if (error!=OMX_ErrorNone){ Log::getInstance()->log("Image", Log::DEBUG, "Init OMX EGL renderer failed %x", error); @@ -707,7 +716,7 @@ int ImageOMX::DestroyInputBufsOMX() //call with clock mutex locked OMX_ERRORTYPE error; input_bufs_omx_mutex.Lock(); - for (int i=0; i< input_bufs_omx_all.size();i++) { + for (UINT i=0; i< input_bufs_omx_all.size();i++) { Log::getInstance()->log("Image", Log::DEBUG, "OMX_FreeBuffer mark"); //if (input_bufs_omx_all[i]->pBuffer) free(input_bufs_omx_all[i]->pBuffer); input_bufs_omx_all[i]->pBuffer=NULL; @@ -723,11 +732,12 @@ int ImageOMX::DestroyInputBufsOMX() //call with clock mutex locked input_bufs_omx_free.clear(); input_bufs_omx_mutex.Unlock(); + return 1; } int ImageOMX::DestroyInputBufsOMXwhilePlaying() //call with clock mutex locked { - OMX_ERRORTYPE error; + //OMX_ERRORTYPE error; input_bufs_omx_mutex.Lock(); while (input_bufs_omx_all.size()>0) { @@ -877,13 +887,13 @@ int ImageOMX::DeAllocateCodecsOMX() } - error=OMX_SetupTunnel(omx_imag_decode,omx_image_output_port,NULL,NULL); + error=OMX_SetupTunnel(omx_imag_decode,omx_image_output_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Image", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_egl_render,omx_egl_input_port,NULL,NULL); + error=OMX_SetupTunnel(omx_egl_render,omx_egl_input_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Image", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); diff --git a/imageomx.h b/imageomx.h index 1b48ede..352856f 100644 --- a/imageomx.h +++ b/imageomx.h @@ -107,6 +107,9 @@ class ImageOMX : public OsdVector::PictureDecoder int initted; + char L_VPE_OMX_IMAGE_DECODER[128]; + char L_VPE_OMX_EGL_REND[128]; + protected: OsdVector::PictureInfo pictInf; bool pictInfValid; diff --git a/log.cc b/log.cc index c67ea9d..f1e8085 100644 --- a/log.cc +++ b/log.cc @@ -131,7 +131,7 @@ int Log::log(const char *fromModule, int level,const char* message, ...) if (level == DEBUG) strcpy(levelString, "[debug] "); #ifndef WIN32 - spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %d %s - ", levelString, getpid(), fromModule); + spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %lu %s - ", levelString, pthread_self(), fromModule); #else spaceLeft -= SNPRINTF(&buffer[150-spaceLeft], spaceLeft, "%s %s - ", levelString, fromModule); #endif diff --git a/osdopenvg.cc b/osdopenvg.cc index f417674..c41db17 100644 --- a/osdopenvg.cc +++ b/osdopenvg.cc @@ -58,7 +58,7 @@ OsdOpenVG::OsdOpenVG() mode=0; aspect_correction=1.; - bcm_backres=NULL; + bcm_backres = 0; freetype_inited=false; wait_id=1; @@ -123,7 +123,7 @@ int OsdOpenVG::init(void* device) { if (initted) return 0; reader.init(); - Video* video = Video::getInstance(); + //Video* video = Video::getInstance(); //window=*((HWND*)device); // May be this device specific part should go to a device specific child class @@ -195,10 +195,10 @@ int OsdOpenVG::init(void* device) return 0; } Log::getInstance()->log("OSD", Log::NOTICE, "Displaysize is %d x %d ",display_width, display_height); - VC_RECT_T dst_rect ={0,0,display_width,display_height}; + VC_RECT_T dst_rect = {0, 0, (int32_t)display_width, (int32_t)display_height}; VC_RECT_T src_rect={0,0,BACKBUFFER_WIDTH <<16,BACKBUFFER_HEIGHT<<16}; VC_RECT_T src_rect_bg={0,0,16<<16,16<<16}; - VC_RECT_T src_rect_im={0,0,16,16}; +// VC_RECT_T src_rect_im={0,0,16,16}; uint32_t back_image_ptr; bcm_backres=vc_dispmanx_resource_create(VC_IMAGE_RGBX32,16,16,&back_image_ptr); @@ -462,12 +462,12 @@ void OsdOpenVG::purgeAllReferences() } monobitmaps.clear(); - /*map::iterator jitty=jpegs.begin(); + / *map::iterator jitty=jpegs.begin(); while (jitty!=jpegs.end()) { vgDestroyImage((VGImage)(*jitty).second); jitty++; } - jpegs.clear();* + jpegs.clear();* / map::iterator titty=tvmedias.begin(); while (titty!=tvmedias.end()) { @@ -545,7 +545,7 @@ int OsdOpenVG::shutdown() vc_dispmanx_element_remove(bcm_update,bcm_background); vc_dispmanx_update_submit_sync(bcm_update); vc_dispmanx_resource_delete(bcm_backres); - bcm_backres=NULL; + bcm_backres = 0; vc_dispmanx_display_close(bcm_display); @@ -572,7 +572,7 @@ void OsdOpenVG::threadMethod() while (true) { ts=1; - unsigned int waittime=1; + //unsigned int waittime=1; if (initted) { @@ -798,8 +798,8 @@ int OsdOpenVG::loadFont(bool newfont) const char *tags=ot.tags; const short* cont=ot.contours; short n_cont=ot.n_contours; - short n_point=ot.n_points; - short last_cont=0; + //short n_point=ot.n_points; + //short last_cont=0; for (short point=0;n_cont!=0;cont++,n_cont--) { short next_cont=*cont+1; bool first=true; @@ -855,8 +855,8 @@ int OsdOpenVG::loadFont(bool newfont) } vgAppendPathData(path,segments.size(),&segments[0],&coord[0]); - int n=0; /* for (int m=0;mlog("OSD", Log::DEBUG, "Draw Paint %d %x %x",handle,command.param1,rgba); } break; case DrawStyle::GradientLinear: { @@ -1338,7 +1342,12 @@ unsigned int OsdOpenVG::handleTask(OpenVGCommand& command) } break; + case OVGimageUploadLine: + {} + } + + return 0; } bool OsdOpenVG::processTasks() diff --git a/videoomx.cc b/videoomx.cc index b96b830..57e6511 100644 --- a/videoomx.cc +++ b/videoomx.cc @@ -68,6 +68,12 @@ VideoOMX::VideoOMX() { signalon=false; outputinterlaced=0; + strcpy(L_VPE_OMX_CLOCK, VPE_OMX_CLOCK); + strcpy(L_VPE_OMX_H264_DECODER, VPE_OMX_H264_DECODER); + strcpy(L_VPE_OMX_MPEG2_DECODER, VPE_OMX_MPEG2_DECODER); + strcpy(L_VPE_OMX_VIDEO_SCHED, VPE_OMX_VIDEO_SCHED); + strcpy(L_VPE_OMX_VIDEO_REND, VPE_OMX_VIDEO_REND); + strcpy(L_VPE_OMX_VIDEO_DEINTERLACE, VPE_OMX_VIDEO_DEINTERLACE); } VideoOMX::~VideoOMX() @@ -404,7 +410,7 @@ void VideoOMX::selectVideoMode(int interlaced) HDMI_RES_GROUP_T pref_group; TV_SUPPORTED_MODE_T *mymode=NULL; TV_SUPPORTED_MODE_T *mymode_second_best=NULL; - bool got_optimum=false; + // bool got_optimum=false; uint32_t pref_mode; HDMI_RES_GROUP_T group=HDMI_RES_GROUP_CEA; int all_my_modes=vc_tv_hdmi_get_supported_modes(HDMI_RES_GROUP_CEA, @@ -445,7 +451,7 @@ void VideoOMX::selectVideoMode(int interlaced) curmode->height==native_height && curmode->frame_rate==target_fps) { if(curmode->scan_mode==interlaced) { - got_optimum=true; + //got_optimum=true; mymode=curmode; Log::getInstance()->log("Video", Log::NOTICE, "Found optimum mode %dx%d %d Hz i: %d", mymode->width,mymode->height,mymode->frame_rate,mymode->scan_mode); @@ -830,7 +836,7 @@ int VideoOMX::initClock() omx_events.clear(); omx_event_mutex.Unlock(); - error=OMX_GetHandle(&omx_clock,VPE_OMX_CLOCK,NULL,&callbacks); + error=OMX_GetHandle(&omx_clock,L_VPE_OMX_CLOCK,NULL,&callbacks); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "Init OMX clock failed %x", error); @@ -1085,9 +1091,9 @@ int VideoOMX::AllocateCodecsOMX() clock_mutex.Lock(); if (h264) { - error=OMX_GetHandle(&omx_vid_dec,VPE_OMX_H264_DECODER,NULL,&callbacks); + error=OMX_GetHandle(&omx_vid_dec,L_VPE_OMX_H264_DECODER,NULL,&callbacks); } else { - error=OMX_GetHandle(&omx_vid_dec,VPE_OMX_MPEG2_DECODER,NULL,&callbacks); + error=OMX_GetHandle(&omx_vid_dec,L_VPE_OMX_MPEG2_DECODER,NULL,&callbacks); } if (error!=OMX_ErrorNone){ @@ -1137,7 +1143,7 @@ int VideoOMX::AllocateCodecsOMX() } if (dodeint) { - error = OMX_GetHandle(&omx_vid_deint, VPE_OMX_VIDEO_DEINTERLACE, NULL, + error = OMX_GetHandle(&omx_vid_deint, L_VPE_OMX_VIDEO_DEINTERLACE, NULL, &callbacks); if (error != OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, @@ -1172,7 +1178,7 @@ int VideoOMX::AllocateCodecsOMX() } - error=OMX_GetHandle(&omx_vid_sched,VPE_OMX_VIDEO_SCHED,NULL,&callbacks); + error=OMX_GetHandle(&omx_vid_sched,L_VPE_OMX_VIDEO_SCHED,NULL,&callbacks); if (error!=OMX_ErrorNone){ Log::getInstance()->log("Video", Log::DEBUG, "Init OMX video scheduler failed %x", error); clock_mutex.Unlock(); @@ -1213,7 +1219,7 @@ int VideoOMX::AllocateCodecsOMX() } - error=OMX_GetHandle(&omx_vid_rend,VPE_OMX_VIDEO_REND,NULL,&callbacks); + error=OMX_GetHandle(&omx_vid_rend,L_VPE_OMX_VIDEO_REND,NULL,&callbacks); if (error!=OMX_ErrorNone){ Log::getInstance()->log("Video", Log::DEBUG, "Init OMX video rend failed %x", error); clock_mutex.Unlock(); @@ -1598,7 +1604,7 @@ int VideoOMX::AllocateCodecsOMX() int VideoOMX::idleClock() { - OMX_ERRORTYPE error; + //OMX_ERRORTYPE error; OMX_STATETYPE temp_state; clock_mutex.Lock(); OMX_GetState(omx_clock,&temp_state); @@ -1960,7 +1966,7 @@ int VideoOMX::DestroyInputBufsOMX() //need s to be called with locked mutex cur_input_buf_omx=NULL; input_bufs_omx_mutex.Lock(); - for (int i=0; i< input_bufs_omx_all.size();i++) { + for (UINT i=0; i< input_bufs_omx_all.size();i++) { // free(input_bufs_omx_all[i]->pBuffer); // input_bufs_omx_all[i]->pBuffer=NULL; error=OMX_FreeBuffer(omx_vid_dec,omx_codec_input_port,input_bufs_omx_all[i]); @@ -1975,6 +1981,7 @@ int VideoOMX::DestroyInputBufsOMX() //need s to be called with locked mutex input_bufs_omx_free.clear(); input_bufs_omx_mutex.Unlock(); + return 1; } @@ -2070,8 +2077,6 @@ int VideoOMX::FlushRenderingPipe() "flush cmd shed 12 failed"); } - - } @@ -2106,6 +2111,8 @@ int VideoOMX::FlushRenderingPipe() Log::getInstance()->log("Video", Log::DEBUG, "flush cmd shed rend failed"); } + + return 1; } @@ -2117,7 +2124,7 @@ int VideoOMX::DeAllocateCodecsOMX() if (cur_input_buf_omx) { cur_input_buf_omx->nFlags|=OMX_BUFFERFLAG_EOS; - OMX_ERRORTYPE error=ProtOMXEmptyThisBuffer(omx_vid_dec,cur_input_buf_omx); + error=ProtOMXEmptyThisBuffer(omx_vid_dec,cur_input_buf_omx); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_EmptyThisBuffer failed %x", error); } @@ -2249,52 +2256,52 @@ int VideoOMX::DeAllocateCodecsOMX() - error=OMX_SetupTunnel(omx_vid_dec,omx_codec_output_port,NULL,NULL); + error=OMX_SetupTunnel(omx_vid_dec,omx_codec_output_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } if (dodeint) { - error=OMX_SetupTunnel(omx_vid_deint,omx_deint_input_port,NULL,NULL); + error=OMX_SetupTunnel(omx_vid_deint,omx_deint_input_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_vid_deint,omx_deint_output_port,NULL,NULL); + error=OMX_SetupTunnel(omx_vid_deint,omx_deint_output_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } } - error=OMX_SetupTunnel(omx_vid_sched,omx_shed_input_port,NULL,NULL); + error=OMX_SetupTunnel(omx_vid_sched,omx_shed_input_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_vid_sched,omx_shed_output_port,NULL,NULL); + error=OMX_SetupTunnel(omx_vid_sched,omx_shed_output_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_vid_rend,omx_rend_input_port,NULL,NULL); + error=OMX_SetupTunnel(omx_vid_rend,omx_rend_input_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_clock,omx_clock_output_port,NULL,NULL); + error=OMX_SetupTunnel(omx_clock,omx_clock_output_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); } - error=OMX_SetupTunnel(omx_vid_sched,omx_shed_clock_port,NULL,NULL); + error=OMX_SetupTunnel(omx_vid_sched,omx_shed_clock_port,NULL,0); if (error!=OMX_ErrorNone) { Log::getInstance()->log("Video", Log::DEBUG, "OMX_Setup tunnel teardown failed %x", error); @@ -2851,7 +2858,7 @@ void VideoOMX::PrepareMediaSample(const MediaPacketList& mplist,UINT samplepos) UINT VideoOMX::DeliverMediaSample(UCHAR* buffer, UINT *samplepos) { int consumed=0; - while (consumedlog("Video", Log::DEBUG, "DeliverMediaPacketOMX time %lld",packet.presentation_time); - - OMX_ERRORTYPE error; - /*First Check, if we have an video sample*/ if (iframemode) { //samplepos=0; @@ -3054,7 +3058,7 @@ bool VideoOMX::displayIFrame(const UCHAR* buffer, UINT length) { if (!iframemode) EnterIframePlayback(); - int haveToCopy = length; + //int haveToCopy = length; if (!cur_input_buf_omx) { input_bufs_omx_mutex.Lock(); @@ -3082,7 +3086,7 @@ bool VideoOMX::displayIFrame(const UCHAR* buffer, UINT length) { } //Now we strip the pes header pattern = (buffer[0] << 16) | (buffer[1] << 8) | (buffer[2]); - while (read_pos + 7 <= length) { + while ((read_pos + 7) <= (int)length) { pattern = ((pattern << 8) & 0xFFFFFFFF) | buffer[read_pos + 3]; if (pattern < 0x000001E0 || pattern > 0x000001EF) { read_pos++; diff --git a/videoomx.h b/videoomx.h index 69fd5ee..121ce2f 100644 --- a/videoomx.h +++ b/videoomx.h @@ -311,8 +311,12 @@ class VideoOMX : public Video vector mediapackets; - - + char L_VPE_OMX_CLOCK[128]; + char L_VPE_OMX_H264_DECODER[128]; + char L_VPE_OMX_MPEG2_DECODER[128]; + char L_VPE_OMX_VIDEO_SCHED[128]; + char L_VPE_OMX_VIDEO_REND[128]; + char L_VPE_OMX_VIDEO_DEINTERLACE[128]; }; -- 2.39.5