diff options
author | ywan171 <yi.a.wang@intel.com> | 2014-07-24 10:11:07 +0800 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-29 21:37:37 -0700 |
commit | 3f7ceee13aa17ae32d4263aed2ce67eb9a37c58b (patch) | |
tree | 8c0270a6938f4c4818ad1cad5f6194c381d394ce | |
parent | 59642e7640703b5c0df95dd4111121e95b8f3161 (diff) | |
download | wrs_omxil_core-3f7ceee13aa17ae32d4263aed2ce67eb9a37c58b.tar.gz |
remove the warning in wrs_corelollipop-dev
BZ: 209178
remove the warning in wrs_core
Signed-off-by: ywan171 <yi.a.wang@intel.com>
Change-Id: I5655dcc283325cf7da5e0b088887e63cd24fb056
Signed-off-by: ywan171 <yi.a.wang@intel.com>
Reviewed-on: https://android.intel.com/220500
Reviewed-by: Fourdan, Olivier <olivier.fourdan@intel.com>
Tested-by: Fourdan, Olivier <olivier.fourdan@intel.com>
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | base/inc/cmodule.h | 4 | ||||
-rw-r--r-- | base/inc/componentbase.h | 10 | ||||
-rw-r--r-- | base/src/Android.mk | 4 | ||||
-rw-r--r-- | base/src/cmodule.cpp | 4 | ||||
-rw-r--r-- | base/src/componentbase.cpp | 114 | ||||
-rw-r--r-- | base/src/portbase.cpp | 112 | ||||
-rw-r--r-- | core/src/Android.mk | 1 | ||||
-rw-r--r-- | core/src/pv_omx_interface.cpp | 1 | ||||
-rw-r--r-- | core/src/wrs_omxcore.cpp | 18 | ||||
-rw-r--r-- | utils/src/Android.mk | 1 | ||||
-rw-r--r-- | utils/src/audio_parser.c | 7 |
12 files changed, 123 insertions, 154 deletions
@@ -47,4 +47,5 @@ COMPONENT_SUPPORT_OPENCORE := false # utility -include $(WRS_OMXIL_CORE_ROOT)/utils/src/Android.mk +LOCAL_CFLAGS += -Werror endif diff --git a/base/inc/cmodule.h b/base/inc/cmodule.h index 7fa6275..439ca62 100644 --- a/base/inc/cmodule.h +++ b/base/inc/cmodule.h @@ -59,10 +59,10 @@ class CModule { * accessor */ /* library name */ - const OMX_STRING GetLibraryName(void); + OMX_STRING GetLibraryName(void); /* component name and roles */ - const OMX_STRING GetComponentName(void); + OMX_STRING GetComponentName(void); OMX_ERRORTYPE GetComponentRoles(OMX_U32 *nr_roles, OMX_U8 **roles); bool QueryHavingThisRole(const OMX_STRING role); diff --git a/base/inc/componentbase.h b/base/inc/componentbase.h index 3619640..3310f68 100644 --- a/base/inc/componentbase.h +++ b/base/inc/componentbase.h @@ -87,10 +87,10 @@ public: */ /* name */ void SetName(const OMX_STRING name); - const OMX_STRING GetName(void); + OMX_STRING GetName(void); /* working role */ - const OMX_STRING GetWorkingRole(void); + OMX_STRING GetWorkingRole(void); /* cmodule */ void SetCModule(CModule *cmodule); @@ -361,12 +361,10 @@ private: /* called in Work() after ProcessorProcess() */ void PostProcessBuffers(OMX_BUFFERHEADERTYPE ***buffers, const buffer_retain_t *retain); - void SourcePostProcessBuffers(OMX_BUFFERHEADERTYPE ***buffers, - const buffer_retain_t *retain); + void SourcePostProcessBuffers(OMX_BUFFERHEADERTYPE ***buffers); void FilterPostProcessBuffers(OMX_BUFFERHEADERTYPE ***buffers, const buffer_retain_t *retain); - void SinkPostProcessBuffers(OMX_BUFFERHEADERTYPE ***buffers, - const buffer_retain_t *retain); + void SinkPostProcessBuffers(); /* processor callbacks */ /* TransState */ diff --git a/base/src/Android.mk b/base/src/Android.mk index 564a7a8..3e4e8e7 100644 --- a/base/src/Android.mk +++ b/base/src/Android.mk @@ -21,6 +21,7 @@ LOCAL_CPPFLAGS := LOCAL_LDFLAGS := +LOCAL_CFLAGS += -Werror ifeq ($(strip $(COMPONENT_SUPPORT_BUFFER_SHARING)), true) LOCAL_CFLAGS += -DCOMPONENT_SUPPORT_BUFFER_SHARING endif @@ -28,7 +29,6 @@ ifeq ($(strip $(COMPONENT_SUPPORT_OPENCORE)), true) LOCAL_CFLAGS += -DCOMPONENT_SUPPORT_OPENCORE endif - LOCAL_C_INCLUDES := \ $(WRS_OMXIL_CORE_ROOT)/utils/inc \ $(WRS_OMXIL_CORE_ROOT)/base/inc \ @@ -50,5 +50,5 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \ libdl \ liblog - +LOCAL_CFLAGS += -Werror include $(BUILD_SHARED_LIBRARY) diff --git a/base/src/cmodule.cpp b/base/src/cmodule.cpp index 23e4718..4ddd920 100644 --- a/base/src/cmodule.cpp +++ b/base/src/cmodule.cpp @@ -118,12 +118,12 @@ OMX_U32 CModule::Unload(void) /* * accessor */ -const OMX_STRING CModule::GetLibraryName(void) +OMX_STRING CModule::GetLibraryName(void) { return lname; } -const OMX_STRING CModule::GetComponentName(void) +OMX_STRING CModule::GetComponentName(void) { return cname; } diff --git a/base/src/componentbase.cpp b/base/src/componentbase.cpp index 902952d..10db2c8 100644 --- a/base/src/componentbase.cpp +++ b/base/src/componentbase.cpp @@ -32,7 +32,7 @@ #include <HardwareAPI.h> //#define LOG_NDEBUG 0 - +#undef LOG_TAG #define LOG_TAG "componentbase" #include <log.h> @@ -179,7 +179,7 @@ void ComponentBase::SetName(const OMX_STRING name) this->name[OMX_MAX_STRINGNAME_SIZE-1] = '\0'; } -const OMX_STRING ComponentBase::GetName(void) +OMX_STRING ComponentBase::GetName(void) { return name; } @@ -630,46 +630,46 @@ OMX_ERRORTYPE ComponentBase::CBaseSetParameter( } break; } - case OMX_IndexExtPrepareForAdaptivePlayback: { - android::PrepareForAdaptivePlaybackParams* p = - (android::PrepareForAdaptivePlaybackParams *)pComponentParameterStructure; - - ret = CheckTypeHeader(p, sizeof(*p)); - if (ret != OMX_ErrorNone) - return ret; + default: + if (nIndex == (OMX_INDEXTYPE)OMX_IndexExtPrepareForAdaptivePlayback) { + android::PrepareForAdaptivePlaybackParams* p = + (android::PrepareForAdaptivePlaybackParams *)pComponentParameterStructure; - if (p->nPortIndex != 1) - return OMX_ErrorBadPortIndex; + ret = CheckTypeHeader(p, sizeof(*p)); + if (ret != OMX_ErrorNone) + return ret; - if (!(working_role != NULL && !strncmp((char*)working_role, "video_decoder", 13))) - return OMX_ErrorBadParameter; + if (p->nPortIndex != 1) + return OMX_ErrorBadPortIndex; - if (p->nMaxFrameWidth > kMaxAdaptiveStreamingWidth - || p->nMaxFrameHeight > kMaxAdaptiveStreamingHeight) { - LOGE("resolution %d x %d exceed max driver support %d x %d\n",p->nMaxFrameWidth, p->nMaxFrameHeight, - kMaxAdaptiveStreamingWidth, kMaxAdaptiveStreamingHeight); - return OMX_ErrorBadParameter; - } - mEnableAdaptivePlayback = p->bEnable; - if (mEnableAdaptivePlayback != OMX_TRUE) - return OMX_ErrorBadParameter; + if (!(working_role != NULL && !strncmp((char*)working_role, "video_decoder", 13))) + return OMX_ErrorBadParameter; - mMaxFrameWidth = p->nMaxFrameWidth; - mMaxFrameHeight = p->nMaxFrameHeight; - /* update output port definition */ - OMX_PARAM_PORTDEFINITIONTYPE paramPortDefinitionOutput; - if (nr_ports > p->nPortIndex && ports[p->nPortIndex]) { - memcpy(¶mPortDefinitionOutput,ports[p->nPortIndex]->GetPortDefinition(), - sizeof(paramPortDefinitionOutput)); - paramPortDefinitionOutput.format.video.nFrameWidth = mMaxFrameWidth; - paramPortDefinitionOutput.format.video.nFrameHeight = mMaxFrameHeight; - ports[p->nPortIndex]->SetPortDefinition(¶mPortDefinitionOutput, true); + if (p->nMaxFrameWidth > kMaxAdaptiveStreamingWidth + || p->nMaxFrameHeight > kMaxAdaptiveStreamingHeight) { + LOGE("resolution %d x %d exceed max driver support %d x %d\n",p->nMaxFrameWidth, p->nMaxFrameHeight, + kMaxAdaptiveStreamingWidth, kMaxAdaptiveStreamingHeight); + return OMX_ErrorBadParameter; + } + mEnableAdaptivePlayback = p->bEnable; + if (mEnableAdaptivePlayback != OMX_TRUE) + return OMX_ErrorBadParameter; + + mMaxFrameWidth = p->nMaxFrameWidth; + mMaxFrameHeight = p->nMaxFrameHeight; + /* update output port definition */ + OMX_PARAM_PORTDEFINITIONTYPE paramPortDefinitionOutput; + if (nr_ports > p->nPortIndex && ports[p->nPortIndex]) { + memcpy(¶mPortDefinitionOutput,ports[p->nPortIndex]->GetPortDefinition(), + sizeof(paramPortDefinitionOutput)); + paramPortDefinitionOutput.format.video.nFrameWidth = mMaxFrameWidth; + paramPortDefinitionOutput.format.video.nFrameHeight = mMaxFrameHeight; + ports[p->nPortIndex]->SetPortDefinition(¶mPortDefinitionOutput, true); + } + } else { + ret = ComponentSetParameter(nIndex, pComponentParameterStructure); } break; - } - - default: - ret = ComponentSetParameter(nIndex, pComponentParameterStructure); } /* switch */ return ret; @@ -1606,12 +1606,11 @@ out: inline OMX_ERRORTYPE ComponentBase::TransStateToInvalid(OMX_STATETYPE current) { OMX_ERRORTYPE ret = OMX_ErrorInvalidState; - + LOGV("transit to invalid state from %d state",current); /* * Todo * graceful escape */ - return ret; } @@ -1687,7 +1686,7 @@ void ComponentBase::FlushPort(OMX_U32 port_index, bool notify) to_index = port_index; } - LOGV("%s:%s: flush ports (from index %lu to %lu)\n", + LOGV("%s:%s: flush ports (from index %u to %u)\n", GetName(), GetWorkingRole(), from_index, to_index); for (i = from_index; i <= to_index; i++) { @@ -1721,7 +1720,7 @@ void ComponentBase::TransStatePort(OMX_U32 port_index, OMX_U8 state) to_index = port_index; } - LOGV("%s:%s: transit ports state to %s (from index %lu to %lu)\n", + LOGV("%s:%s: transit ports state to %s (from index %u to %u)\n", GetName(), GetWorkingRole(), GetPortStateName(state), from_index, to_index); @@ -1985,8 +1984,7 @@ bool ComponentBase::IsAllBufferAvailable(void) } inline void ComponentBase::SourcePostProcessBuffers( - OMX_BUFFERHEADERTYPE ***buffers, - const buffer_retain_t *retain) + OMX_BUFFERHEADERTYPE ***buffers) { OMX_U32 i; @@ -2083,9 +2081,7 @@ inline void ComponentBase::FilterPostProcessBuffers( } } -inline void ComponentBase::SinkPostProcessBuffers( - OMX_BUFFERHEADERTYPE ***buffers, - const buffer_retain_t *retain) +inline void ComponentBase::SinkPostProcessBuffers() { return; } @@ -2095,11 +2091,11 @@ void ComponentBase::PostProcessBuffers(OMX_BUFFERHEADERTYPE ***buffers, { if (cvariant == CVARIANT_SOURCE) - SourcePostProcessBuffers(buffers, retain); + SourcePostProcessBuffers(buffers); else if (cvariant == CVARIANT_FILTER) FilterPostProcessBuffers(buffers, retain); else if (cvariant == CVARIANT_SINK) { - SinkPostProcessBuffers(buffers, retain); + SinkPostProcessBuffers(); } else { LOGE("%s(): fatal error unknown component variant (%d)\n", @@ -2143,37 +2139,35 @@ OMX_ERRORTYPE ComponentBase::ProcessorResume(void) return OMX_ErrorNone; } -OMX_ERRORTYPE ComponentBase::ProcessorFlush(OMX_U32 port_index) +OMX_ERRORTYPE ComponentBase::ProcessorFlush(OMX_U32) { return OMX_ErrorNone; } - -OMX_ERRORTYPE ComponentBase::ProcessorPreFillBuffer(OMX_BUFFERHEADERTYPE* buffer) +OMX_ERRORTYPE ComponentBase::ProcessorPreFillBuffer(OMX_BUFFERHEADERTYPE*) { return OMX_ErrorNone; } -OMX_ERRORTYPE ComponentBase::ProcessorPreEmptyBuffer(OMX_BUFFERHEADERTYPE* buffer) +OMX_ERRORTYPE ComponentBase::ProcessorPreEmptyBuffer(OMX_BUFFERHEADERTYPE*) { return OMX_ErrorNone; } - -OMX_ERRORTYPE ComponentBase::ProcessorProcess(OMX_BUFFERHEADERTYPE **pBuffers, - buffer_retain_t *retain, - OMX_U32 nr_buffers) +OMX_ERRORTYPE ComponentBase::ProcessorProcess(OMX_BUFFERHEADERTYPE **, + buffer_retain_t *, + OMX_U32) { LOGE("ProcessorProcess not be implemented"); return OMX_ErrorNotImplemented; } -OMX_ERRORTYPE ComponentBase::ProcessorProcess(OMX_BUFFERHEADERTYPE ***pBuffers, - buffer_retain_t *retain, - OMX_U32 nr_buffers) +OMX_ERRORTYPE ComponentBase::ProcessorProcess(OMX_BUFFERHEADERTYPE ***, + buffer_retain_t *, + OMX_U32) { LOGE("ProcessorProcess not be implemented"); return OMX_ErrorNotImplemented; } -OMX_ERRORTYPE ComponentBase::ProcessorPreFreeBuffer(OMX_U32 nPortIndex, OMX_BUFFERHEADERTYPE* pBuffer) +OMX_ERRORTYPE ComponentBase::ProcessorPreFreeBuffer(OMX_U32, OMX_BUFFERHEADERTYPE*) { return OMX_ErrorNone; @@ -2181,7 +2175,7 @@ OMX_ERRORTYPE ComponentBase::ProcessorPreFreeBuffer(OMX_U32 nPortIndex, OMX_BUFF /* end of processor callbacks */ /* helper for derived class */ -const OMX_STRING ComponentBase::GetWorkingRole(void) +OMX_STRING ComponentBase::GetWorkingRole(void) { return &working_role[0]; } diff --git a/base/src/portbase.cpp b/base/src/portbase.cpp index 55a2494..e939960 100644 --- a/base/src/portbase.cpp +++ b/base/src/portbase.cpp @@ -24,7 +24,6 @@ #include <portbase.h> #include <componentbase.h> -#include <OMX_VideoExt.h> //#define LOG_NDEBUG 0 #define LOG_TAG "portbase" @@ -261,7 +260,7 @@ OMX_ERRORTYPE PortBase::SetPortDefinition( format->eCompressionFormat = pformat->eCompressionFormat; format->eColorFormat = pformat->eColorFormat; format->pNativeWindow = pformat->pNativeWindow; - OMX_U32 nFrameSize = getFrameBufSize(format->eColorFormat,format->nFrameWidth,format->nFrameHeight); + OMX_S32 nFrameSize = getFrameBufSize(format->eColorFormat,format->nFrameWidth,format->nFrameHeight); if(nFrameSize!=-1) temp.nBufferSize = nFrameSize; if (overwrite_readonly) { @@ -329,14 +328,14 @@ OMX_ERRORTYPE PortBase::UseBuffer(OMX_BUFFERHEADERTYPE **ppBufferHdr, OMX_BUFFERHEADERTYPE *buffer_hdr; struct list *entry; - LOGV("%s(): %s:%s:PortIndex %lu: enter, nSizeBytes=%lu\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u: enter, nSizeBytes=%u\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, nSizeBytes); pthread_mutex_lock(&hdrs_lock); if (portdefinition.bPopulated == OMX_TRUE) { pthread_mutex_unlock(&hdrs_lock); - LOGV("%s(): %s:%s:PortIndex %lu: exit done, already populated\n", + LOGV("%s(): %s:%s:PortIndex %u: exit done, already populated\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorNone; @@ -345,7 +344,7 @@ OMX_ERRORTYPE PortBase::UseBuffer(OMX_BUFFERHEADERTYPE **ppBufferHdr, buffer_hdr = (OMX_BUFFERHEADERTYPE *)calloc(1, sizeof(*buffer_hdr)); if (!buffer_hdr) { pthread_mutex_unlock(&hdrs_lock); - LOGE("%s(): %s:%s:PortIndex %lu: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u: exit failure, " "connot allocate buffer header\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorInsufficientResources; @@ -355,7 +354,7 @@ OMX_ERRORTYPE PortBase::UseBuffer(OMX_BUFFERHEADERTYPE **ppBufferHdr, if (!entry) { free(buffer_hdr); pthread_mutex_unlock(&hdrs_lock); - LOGE("%s(): %s:%s:PortIndex %lu: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u: exit failure, " "cannot allocate list entry\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorInsufficientResources; @@ -379,7 +378,7 @@ OMX_ERRORTYPE PortBase::UseBuffer(OMX_BUFFERHEADERTYPE **ppBufferHdr, buffer_hdrs = __list_add_tail(buffer_hdrs, entry); nr_buffer_hdrs++; - LOGV("%s(): %s:%s:PortIndex %lu: a buffer allocated (%p:%lu/%lu)\n", + LOGV("%s(): %s:%s:PortIndex %u: a buffer allocated (%p:%u/%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, buffer_hdr, nr_buffer_hdrs, portdefinition.nBufferCountActual); @@ -388,7 +387,7 @@ OMX_ERRORTYPE PortBase::UseBuffer(OMX_BUFFERHEADERTYPE **ppBufferHdr, portdefinition.bPopulated = OMX_TRUE; buffer_hdrs_completion = true; pthread_cond_signal(&hdrs_wait); - LOGV("%s(): %s:%s:PortIndex %lu: allocate all buffers (%lu)\n", + LOGV("%s(): %s:%s:PortIndex %u: allocate all buffers (%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, portdefinition.nBufferCountActual); } @@ -397,7 +396,7 @@ OMX_ERRORTYPE PortBase::UseBuffer(OMX_BUFFERHEADERTYPE **ppBufferHdr, pthread_mutex_unlock(&hdrs_lock); - LOGV("%s(): %s:%s:PortIndex %lu: exit done\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u: exit done\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorNone; } @@ -410,13 +409,13 @@ OMX_ERRORTYPE PortBase:: AllocateBuffer(OMX_BUFFERHEADERTYPE **ppBuffer, OMX_BUFFERHEADERTYPE *buffer_hdr; struct list *entry; - LOGV("%s(): %s:%s:PortIndex %lu: enter, nSizeBytes=%lu\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u: enter, nSizeBytes=%u\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, nSizeBytes); pthread_mutex_lock(&hdrs_lock); if (portdefinition.bPopulated == OMX_TRUE) { pthread_mutex_unlock(&hdrs_lock); - LOGV("%s(): %s:%s:PortIndex %lu: exit done, already populated\n", + LOGV("%s(): %s:%s:PortIndex %u: exit done, already populated\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorNone; @@ -433,7 +432,7 @@ OMX_ERRORTYPE PortBase:: AllocateBuffer(OMX_BUFFERHEADERTYPE **ppBuffer, if (!buffer_hdr) { pthread_mutex_unlock(&hdrs_lock); - LOGE("%s(): %s:%s:PortIndex %lu: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u: exit failure, " "connot allocate buffer header\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorInsufficientResources; @@ -443,7 +442,7 @@ OMX_ERRORTYPE PortBase:: AllocateBuffer(OMX_BUFFERHEADERTYPE **ppBuffer, if (!entry) { free(buffer_hdr); pthread_mutex_unlock(&hdrs_lock); - LOGE("%s(): %s:%s:PortIndex %lu: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u: exit failure, " "connot allocate list entry\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorInsufficientResources; @@ -478,7 +477,7 @@ OMX_ERRORTYPE PortBase:: AllocateBuffer(OMX_BUFFERHEADERTYPE **ppBuffer, buffer_hdrs = __list_add_tail(buffer_hdrs, entry); nr_buffer_hdrs++; - LOGV("%s(): %s:%s:PortIndex %lu: a buffer allocated (%p:%lu/%lu)\n", + LOGV("%s(): %s:%s:PortIndex %u: a buffer allocated (%p:%u/%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, buffer_hdr, nr_buffer_hdrs, portdefinition.nBufferCountActual); @@ -487,7 +486,7 @@ OMX_ERRORTYPE PortBase:: AllocateBuffer(OMX_BUFFERHEADERTYPE **ppBuffer, portdefinition.bPopulated = OMX_TRUE; buffer_hdrs_completion = true; pthread_cond_signal(&hdrs_wait); - LOGV("%s(): %s:%s:PortIndex %lu: allocate all buffers (%lu)\n", + LOGV("%s(): %s:%s:PortIndex %u: allocate all buffers (%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, portdefinition.nBufferCountActual); } @@ -496,7 +495,7 @@ OMX_ERRORTYPE PortBase:: AllocateBuffer(OMX_BUFFERHEADERTYPE **ppBuffer, pthread_mutex_unlock(&hdrs_lock); - LOGV("%s(): %s:%s:PortIndex %lu: exit done\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u: exit done\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorNone; } @@ -507,7 +506,7 @@ OMX_ERRORTYPE PortBase::FreeBuffer(OMX_U32 nPortIndex, struct list *entry; OMX_ERRORTYPE ret; - LOGV("%s(): %s:%s:PortIndex %lu:pBuffer %p: enter\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u:pBuffer %p: enter\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, pBuffer); pthread_mutex_lock(&hdrs_lock); @@ -515,7 +514,7 @@ OMX_ERRORTYPE PortBase::FreeBuffer(OMX_U32 nPortIndex, if (!entry) { pthread_mutex_unlock(&hdrs_lock); - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure, " "cannot find list entry for pBuffer\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, pBuffer); return OMX_ErrorBadParameter; @@ -523,7 +522,7 @@ OMX_ERRORTYPE PortBase::FreeBuffer(OMX_U32 nPortIndex, if (entry->data != pBuffer) { pthread_mutex_unlock(&hdrs_lock); - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure," + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure," "mismatch list entry\n" , __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, pBuffer); return OMX_ErrorBadParameter; @@ -532,7 +531,7 @@ OMX_ERRORTYPE PortBase::FreeBuffer(OMX_U32 nPortIndex, ret = ComponentBase::CheckTypeHeader(pBuffer, sizeof(*pBuffer)); if (ret != OMX_ErrorNone) { pthread_mutex_unlock(&hdrs_lock); - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure," + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure," "invalid type header\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, pBuffer); return ret; @@ -541,7 +540,7 @@ OMX_ERRORTYPE PortBase::FreeBuffer(OMX_U32 nPortIndex, buffer_hdrs = __list_delete(buffer_hdrs, entry); nr_buffer_hdrs--; - LOGV("%s(): %s:%s:PortIndex %lu:pBuffer %p: free a buffer (%lu/%lu)\n", + LOGV("%s(): %s:%s:PortIndex %u:pBuffer %p: free a buffer (%u/%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, pBuffer, nr_buffer_hdrs, portdefinition.nBufferCountActual); if (custom_mem_free) { @@ -554,14 +553,14 @@ OMX_ERRORTYPE PortBase::FreeBuffer(OMX_U32 nPortIndex, if (!nr_buffer_hdrs) { buffer_hdrs_completion = true; pthread_cond_signal(&hdrs_wait); - LOGV("%s(): %s:%s:PortIndex %lu: free all allocated buffers (%lu)\n", + LOGV("%s(): %s:%s:PortIndex %u: free all allocated buffers (%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex, portdefinition.nBufferCountActual); } pthread_mutex_unlock(&hdrs_lock); - LOGV("%s(): %s:%s:PortIndex %lu: exit done\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u: exit done\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), nPortIndex); return OMX_ErrorNone; } @@ -570,11 +569,11 @@ void PortBase::WaitPortBufferCompletion(void) { pthread_mutex_lock(&hdrs_lock); if (!buffer_hdrs_completion) { - LOGV("%s(): %s:%s:PortIndex %lu: wait for buffer header completion\n", + LOGV("%s(): %s:%s:PortIndex %u: wait for buffer header completion\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex); pthread_cond_wait(&hdrs_wait, &hdrs_lock); - LOGV("%s(): %s:%s:PortIndex %lu: wokeup (buffer header completion)\n", + LOGV("%s(): %s:%s:PortIndex %u: wokeup (buffer header completion)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex); } @@ -588,7 +587,7 @@ OMX_ERRORTYPE PortBase::WaitPortBufferCompletionTimeout(int64_t milliseconds) OMX_ERRORTYPE ret = OMX_ErrorNone; pthread_mutex_lock(&hdrs_lock); if (!buffer_hdrs_completion) { - LOGV("%s(): %s:%s:PortIndex %lu: wait for buffer header completion\n", + LOGV("%s(): %s:%s:PortIndex %u: wait for buffer header completion\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex); struct timespec tv; @@ -598,7 +597,7 @@ OMX_ERRORTYPE PortBase::WaitPortBufferCompletionTimeout(int64_t milliseconds) rc = pthread_cond_timedwait(&hdrs_wait, &hdrs_lock, &tv); } if (rc == ETIMEDOUT) { - LOGE("%s(): %s:%s:PortIndex %lu: wokeup (buffer header timeout)\n", + LOGE("%s(): %s:%s:PortIndex %u: wokeup (buffer header timeout)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex); ret = OMX_ErrorTimeout; @@ -612,11 +611,9 @@ OMX_ERRORTYPE PortBase::WaitPortBufferCompletionTimeout(int64_t milliseconds) OMX_ERRORTYPE PortBase::PushThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer) { int ret; - - LOGV_IF(pBuffer != NULL, "%s(): %s:%s:PortIndex %lu:pBuffer %p:\n", + LOGV_IF(pBuffer != NULL, "%s(): %s:%s:PortIndex %u:pBuffer %p:\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), - portdefinition.nPortIndex, pBuffer); - + portdefinition.nPortIndex, pBuffer); pthread_mutex_lock(&bufferq_lock); ret = queue_push_tail(&bufferq, pBuffer); pthread_mutex_unlock(&bufferq_lock); @@ -634,11 +631,9 @@ OMX_BUFFERHEADERTYPE *PortBase::PopBuffer(void) pthread_mutex_lock(&bufferq_lock); buffer = (OMX_BUFFERHEADERTYPE *)queue_pop_head(&bufferq); pthread_mutex_unlock(&bufferq_lock); - - LOGV_IF((buffer != NULL || RetainedBufferQueueLength() > 0), "%s(): %s:%s:PortIndex %lu:pBuffer %p:\n", + LOGV_IF((buffer != NULL || RetainedBufferQueueLength() > 0), "%s(): %s:%s:PortIndex %u:pBuffer %p:\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, buffer); - return buffer; } @@ -673,12 +668,12 @@ OMX_ERRORTYPE PortBase::ReturnThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer) OMX_BUFFERHEADERTYPE *); OMX_ERRORTYPE ret; - LOGV("%s(): %s:%s:PortIndex %lu:pBuffer %p: enter\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u:pBuffer %p: enter\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer); if (!pBuffer) { - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure, " "invalid buffer pointer\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer); @@ -694,7 +689,7 @@ OMX_ERRORTYPE PortBase::ReturnThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer) bufferdone_callback = callbacks->FillBufferDone; } else { - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure, " "invalid direction (%d)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer, @@ -703,15 +698,15 @@ OMX_ERRORTYPE PortBase::ReturnThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer) } if (port_index != portdefinition.nPortIndex) { - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure, " - "invalid port index (%lu)\n", __FUNCTION__, + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure, " + "invalid port index (%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer, port_index); return OMX_ErrorBadParameter; } if (pBuffer->nFlags & OMX_BUFFERFLAG_EOS) { - LOGV("%s(): %s:%s:PortIndex %lu:pBuffer %p: " + LOGV("%s(): %s:%s:PortIndex %u:pBuffer %p: " "Report OMX_EventBufferFlag (OMX_BUFFERFLAG_EOS)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer); @@ -722,7 +717,7 @@ OMX_ERRORTYPE PortBase::ReturnThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer) } if (pBuffer->hMarkTargetComponent == owner) { - LOGV("%s(): %s:%s:PortIndex %lu:pBuffer %p: " + LOGV("%s(): %s:%s:PortIndex %u:pBuffer %p: " "Report OMX_EventMark\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer); @@ -735,7 +730,7 @@ OMX_ERRORTYPE PortBase::ReturnThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer) ret = bufferdone_callback(owner, appdata, pBuffer); - LOGV("%s(): %s:%s:PortIndex %lu: exit done, " + LOGV("%s(): %s:%s:PortIndex %u: exit done, " "callback returned (0x%08x)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, ret); @@ -778,7 +773,7 @@ OMX_ERRORTYPE PortBase::RetainThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer, { int ret; - LOGV("%s(): %s:%s:PortIndex %lu:pBuffer %p: enter, %s\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u:pBuffer %p: enter, %s\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer, (accumulate == true) ? "accumulate" : "getagain"); @@ -788,7 +783,7 @@ OMX_ERRORTYPE PortBase::RetainThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer, if (cbase->GetWorkingRole() == NULL || (strncmp((char*)cbase->GetWorkingRole(), "video_encoder", 13) != 0)) { /* do not accumulate a buffer set EOS flag if not video encoder*/ if (pBuffer->nFlags & OMX_BUFFERFLAG_EOS) { - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure, " "cannot accumulate EOS buffer\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer); @@ -802,9 +797,9 @@ OMX_ERRORTYPE PortBase::RetainThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer, ret = queue_push_tail(&retainedbufferq, pBuffer); else { ret = OMX_ErrorInsufficientResources; - LOGE("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit failure, " + LOGE("%s(): %s:%s:PortIndex %u:pBuffer %p: exit failure, " "retained bufferq length (%d) exceeds port's actual count " - "(%lu)\n", __FUNCTION__, + "(%u)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer, queue_length(&retainedbufferq), @@ -825,7 +820,7 @@ OMX_ERRORTYPE PortBase::RetainThisBuffer(OMX_BUFFERHEADERTYPE *pBuffer, if (ret) return OMX_ErrorInsufficientResources; - LOGV("%s(): %s:%s:PortIndex %lu:pBuffer %p: exit done\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u:pBuffer %p: exit done\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, pBuffer); return OMX_ErrorNone; @@ -843,14 +838,14 @@ void PortBase::ReturnAllRetainedBuffers(void) buffer = (OMX_BUFFERHEADERTYPE *)queue_pop_head(&retainedbufferq); if (buffer) { - LOGV("%s(): %s:%s:PortIndex %lu: returns a retained buffer " + LOGV("%s(): %s:%s:PortIndex %u: returns a retained buffer " "(%p:%d/%d)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, buffer, i++, queue_length(&retainedbufferq)); ret = ReturnThisBuffer(buffer); if (ret != OMX_ErrorNone) - LOGE("%s(): %s:%s:PortIndex %lu: failed (ret : 0x%x08x)\n", + LOGE("%s(): %s:%s:PortIndex %u: failed (ret : 0x%x08x)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, ret); @@ -858,9 +853,8 @@ void PortBase::ReturnAllRetainedBuffers(void) } while (buffer); pthread_mutex_unlock(&retainedbufferq_lock); - LOGV_IF(i != 0, - "%s(): %s:%s:PortIndex %lu: returned all retained buffers (%d)\n", + "%s(): %s:%s:PortIndex %u: returned all retained buffers (%d)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, i); } @@ -876,14 +870,14 @@ void PortBase::ReturnOneRetainedBuffer(void) buffer = (OMX_BUFFERHEADERTYPE *)queue_pop_head(&retainedbufferq); if (buffer) { - LOGV("%s(): %s:%s:PortIndex %lu: returns a retained buffer " + LOGV("%s(): %s:%s:PortIndex %u: returns a retained buffer " "(%p:%d/%d)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, buffer, i++, queue_length(&retainedbufferq)); ret = ReturnThisBuffer(buffer); if (ret != OMX_ErrorNone) - LOGE("%s(): %s:%s:PortIndex %lu: failed (ret : 0x%x08x)\n", + LOGE("%s(): %s:%s:PortIndex %u: failed (ret : 0x%x08x)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, ret); @@ -899,7 +893,7 @@ OMX_ERRORTYPE PortBase::FlushPort(void) { OMX_BUFFERHEADERTYPE *buffer; - LOGV("%s(): %s:%s:PortIndex %lu: enter\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u: enter\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex); @@ -908,7 +902,7 @@ OMX_ERRORTYPE PortBase::FlushPort(void) while ((buffer = PopBuffer())) ReturnThisBuffer(buffer); - LOGV("%s(): %s:%s:PortIndex %lu: exit\n", __FUNCTION__, + LOGV("%s(): %s:%s:PortIndex %u: exit\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex); @@ -1001,7 +995,7 @@ OMX_ERRORTYPE PortBase::TransState(OMX_U8 transition) OMX_U8 current; OMX_ERRORTYPE ret = OMX_ErrorNone; - LOGV("%s(): %s:%s:PortIndex %lu: enter, transition from %s to %s\n", + LOGV("%s(): %s:%s:PortIndex %u: enter, transition from %s to %s\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, GetPortStateName(state), GetPortStateName(transition)); @@ -1012,7 +1006,7 @@ OMX_ERRORTYPE PortBase::TransState(OMX_U8 transition) if (current == transition) { ret = OMX_ErrorSameState; - LOGE("%s(): %s:%s:PortIndex %lu: exit failure, same state (%s)\n", + LOGE("%s(): %s:%s:PortIndex %u: exit failure, same state (%s)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, GetPortStateName(current)); @@ -1046,7 +1040,7 @@ OMX_ERRORTYPE PortBase::TransState(OMX_U8 transition) } else { ret = OMX_ErrorBadParameter; - LOGE("%s(): %s:%s:PortIndex %lu: exit failure, invalid transition " + LOGE("%s(): %s:%s:PortIndex %u: exit failure, invalid transition " "(%s)\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, GetPortStateName(transition)); @@ -1055,7 +1049,7 @@ OMX_ERRORTYPE PortBase::TransState(OMX_U8 transition) state = transition; - LOGV("%s(): %s:%s:PortIndex %lu: transition from %s to %s complete\n", + LOGV("%s(): %s:%s:PortIndex %u: transition from %s to %s complete\n", __FUNCTION__, cbase->GetName(), cbase->GetWorkingRole(), portdefinition.nPortIndex, GetPortStateName(current), GetPortStateName(state)); diff --git a/core/src/Android.mk b/core/src/Android.mk index 9bbddfe..6dc2f33 100644 --- a/core/src/Android.mk +++ b/core/src/Android.mk @@ -26,4 +26,5 @@ LOCAL_C_INCLUDES := \ $(TOP)/frameworks/native/include/media/openmax \ $(PV_INCLUDES) +LOCAL_CFLAGS += -Werror include $(BUILD_SHARED_LIBRARY) diff --git a/core/src/pv_omx_interface.cpp b/core/src/pv_omx_interface.cpp index 3e1b928..0db0dc3 100644 --- a/core/src/pv_omx_interface.cpp +++ b/core/src/pv_omx_interface.cpp @@ -65,7 +65,6 @@ class PVOMXInterface : public OMXInterface pOMX_FreeHandle = OMX_FreeHandle; pOMX_GetComponentsOfRole = OMX_GetComponentsOfRole; pOMX_GetRolesOfComponent = OMX_GetRolesOfComponent; - pOMX_SetupTunnel = OMX_SetupTunnel; pOMX_GetContentPipe = OMX_GetContentPipe; pOMXConfigParser = Intel_OMXConfigParser; }; diff --git a/core/src/wrs_omxcore.cpp b/core/src/wrs_omxcore.cpp index cbf7a8b..412b7d4 100644 --- a/core/src/wrs_omxcore.cpp +++ b/core/src/wrs_omxcore.cpp @@ -186,7 +186,7 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( strncpy(cComponentName, cname, nNameLength); - LOGV("%s(): found %luth component %s", __FUNCTION__, nIndex, cname); + LOGV("%s(): found %u th component %s", __FUNCTION__, nIndex, cname); return OMX_ErrorNone; } @@ -307,22 +307,6 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( return OMX_ErrorNone; } -OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( - OMX_IN OMX_HANDLETYPE hOutput, - OMX_IN OMX_U32 nPortOutput, - OMX_IN OMX_HANDLETYPE hInput, - OMX_IN OMX_U32 nPortInput) -{ - return OMX_ErrorNotImplemented; -} - -OMX_API OMX_ERRORTYPE OMX_GetContentPipe( - OMX_OUT OMX_HANDLETYPE *hPipe, - OMX_IN OMX_STRING szURI) -{ - return OMX_ErrorNotImplemented; -} - OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( OMX_IN OMX_STRING role, OMX_INOUT OMX_U32 *pNumComps, diff --git a/utils/src/Android.mk b/utils/src/Android.mk index 8d6a86d..72885da 100644 --- a/utils/src/Android.mk +++ b/utils/src/Android.mk @@ -22,5 +22,6 @@ LOCAL_SHARED_LIBRARIES := LOCAL_C_INCLUDES := \ $(WRS_OMXIL_CORE_ROOT)/utils/inc +LOCAL_CFLAGS += -Werror include $(BUILD_STATIC_LIBRARY) diff --git a/utils/src/audio_parser.c b/utils/src/audio_parser.c index f8fc8bd..564a7b2 100644 --- a/utils/src/audio_parser.c +++ b/utils/src/audio_parser.c @@ -326,9 +326,7 @@ static inline int mp3_calculate_frame_length(int bitrate, int samplingrate, * FIXME * - It's hard coded for version 1, layer 3 */ -static inline int mp3_calculate_frame_duration(int version, - int layer, - int frequency) +static inline int mp3_calculate_frame_duration(int frequency) { return 1152 * 1000 / frequency; } @@ -400,8 +398,7 @@ int mp3_header_parse(const unsigned char *buffer, *mode_extension = header.mode_extension; *frame_length = mp3_calculate_frame_length(*bitrate, *frequency, *layer, header.padding_bit); - *frame_duration = mp3_calculate_frame_duration(*version, *layer, - *frequency); + *frame_duration = mp3_calculate_frame_duration(*frequency); LOGV("mp3 frame header\n"); LOGV(" sync: 0x%x\n", header.sync); |