mm-audio: omx: add 64 bit support
-Changes to support omx encoders on 64 bit platform
Change-Id: I05749f619efaf66e107b1438635a38f92a11b523
diff --git a/mm-audio/aenc-evrc/Android.mk b/mm-audio/aenc-evrc/Android.mk
index 649f860..09c9ebd 100644
--- a/mm-audio/aenc-evrc/Android.mk
+++ b/mm-audio/aenc-evrc/Android.mk
@@ -1,5 +1,4 @@
-ifeq ($(TARGET_ARCH),arm)
-
+ifneq ($(filter arm aarch64 arm64, $(TARGET_ARCH)),)
AENC_EVRC_PATH:= $(call my-dir)
@@ -27,5 +26,8 @@
ifeq ($(call is-board-platform,msm8916),true)
include $(AENC_EVRC_PATH)/qdsp6/Android.mk
endif
+ifeq ($(call is-board-platform,msm8994),true)
+include $(AENC_EVRC_PATH)/qdsp6/Android.mk
+endif
endif
diff --git a/mm-audio/aenc-evrc/qdsp6/Android.mk b/mm-audio/aenc-evrc/qdsp6/Android.mk
index d38d004..98d95b1 100644
--- a/mm-audio/aenc-evrc/qdsp6/Android.mk
+++ b/mm-audio/aenc-evrc/qdsp6/Android.mk
@@ -13,6 +13,7 @@
libOmxEvrcEnc-def += -D_ENABLE_QC_MSG_LOG_
libOmxEvrcEnc-def += -DVERBOSE
libOmxEvrcEnc-def += -D_DEBUG
+libOmxEvrcEnc-def += -Wconversion
ifeq ($(strip $(TARGET_USES_QCOM_MM_AUDIO)),true)
libOmxEvrcEnc-def += -DAUDIOV2
endif
diff --git a/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h b/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
index fa83230..09ffb2d 100644
--- a/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
+++ b/mm-audio/aenc-evrc/qdsp6/inc/omx_evrc_aenc.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010,2014 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -81,10 +81,10 @@
#define PrintFrameHdr(i,bufHdr) \
- DEBUG_PRINT("i=%d OMX bufHdr[%x]buf[%x]size[%d]TS[%lld]nFlags[0x%x]\n",\
+ DEBUG_PRINT("i=%d OMX bufHdr[%p]buf[%p]size[%d]TS[%lld]nFlags[0x%x]\n",\
i,\
- (unsigned) bufHdr, \
- (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer, \
+ bufHdr, \
+ ((OMX_BUFFERHEADERTYPE *)bufHdr)->pBuffer, \
(unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFilledLen,\
((OMX_BUFFERHEADERTYPE *)bufHdr)->nTimeStamp, \
(unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nFlags)
@@ -245,7 +245,7 @@
void * eglImage);
bool post_command(unsigned int p1, unsigned int p2,
- unsigned int id);
+ unsigned char id);
// Deferred callback identifiers
enum
@@ -304,9 +304,9 @@
struct omx_event
{
- unsigned param1;
- unsigned param2;
- unsigned id;
+ unsigned long param1;
+ unsigned long param2;
+ unsigned char id;
};
struct omx_cmd_queue
@@ -318,16 +318,16 @@
omx_cmd_queue();
~omx_cmd_queue();
- bool insert_entry(unsigned p1, unsigned p2, unsigned id);
- bool pop_entry(unsigned *p1,unsigned *p2, unsigned *id);
- bool get_msg_id(unsigned *id);
- bool get_msg_with_id(unsigned *p1,unsigned *p2, unsigned id);
+ bool insert_entry(unsigned long p1, unsigned long p2, unsigned char id);
+ bool pop_entry(unsigned long *p1,unsigned long *p2, unsigned char *id);
+ bool get_msg_id(unsigned char *id);
+ bool get_msg_with_id(unsigned *p1,unsigned *p2, unsigned char id);
};
typedef struct TIMESTAMP
{
- unsigned long LowPart;
- unsigned long HighPart;
+ unsigned int LowPart;
+ unsigned int HighPart;
}__attribute__((packed)) TIMESTAMP;
typedef struct metadata_input
@@ -351,7 +351,7 @@
{
OMX_U32 tot_in_buf_len;
OMX_U32 tot_out_buf_len;
- OMX_U32 tot_pb_time;
+ OMX_TICKS tot_pb_time;
OMX_U32 fbd_cnt;
OMX_U32 ftb_cnt;
OMX_U32 etb_cnt;
@@ -376,7 +376,7 @@
bool is_in_th_sleep;
bool is_out_th_sleep;
unsigned int m_flags; //encapsulate the waiting states.
- unsigned int nTimestamp;
+ OMX_TICKS nTimestamp;
unsigned int pcm_input; //tunnel or non-tunnel
unsigned int m_inp_act_buf_count; // Num of Input Buffers
unsigned int m_out_act_buf_count; // Numb of Output Buffers
@@ -508,11 +508,11 @@
bool search_output_bufhdr(OMX_BUFFERHEADERTYPE *buffer);
- bool post_input(unsigned int p1, unsigned int p2,
- unsigned int id);
+ bool post_input(unsigned long p1, unsigned long p2,
+ unsigned char id);
- bool post_output(unsigned int p1, unsigned int p2,
- unsigned int id);
+ bool post_output(unsigned long p1, unsigned long p2,
+ unsigned char id);
void process_events(omx_evrc_aenc *client_data);
diff --git a/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp b/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
index 073f1ac..d19320f 100644
--- a/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
+++ b/mm-audio/aenc-evrc/qdsp6/src/omx_evrc_aenc.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010, The Linux Foundation. All rights reserved.
+Copyright (c) 2010, 2014 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -57,9 +57,9 @@
}
// omx cmd queue insert
-bool omx_evrc_aenc::omx_cmd_queue::insert_entry(unsigned p1,
- unsigned p2,
- unsigned id)
+bool omx_evrc_aenc::omx_cmd_queue::insert_entry(unsigned long p1,
+ unsigned long p2,
+ unsigned char id)
{
bool ret = true;
if (m_size < OMX_CORE_CONTROL_CMDQ_SIZE)
@@ -81,8 +81,8 @@
return ret;
}
-bool omx_evrc_aenc::omx_cmd_queue::pop_entry(unsigned *p1,
- unsigned *p2, unsigned *id)
+bool omx_evrc_aenc::omx_cmd_queue::pop_entry(unsigned long *p1,
+ unsigned long *p2, unsigned char *id)
{
bool ret = true;
if (m_size > 0)
@@ -111,7 +111,7 @@
{
return(new omx_evrc_aenc);
}
-bool omx_evrc_aenc::omx_cmd_queue::get_msg_id(unsigned *id)
+bool omx_evrc_aenc::omx_cmd_queue::get_msg_id(unsigned char *id)
{
if(m_size > 0)
{
@@ -256,7 +256,10 @@
m_tmp_out_meta_buf(NULL),
m_flush_cnt(255),
m_comp_deinit(0),
+ m_volume(25),
m_app_data(NULL),
+ nNumInputBuf(0),
+ nNumOutputBuf(0),
m_drv_fd(-1),
bFlushinprogress(0),
is_in_th_sleep(false),
@@ -267,7 +270,7 @@
m_out_act_buf_count (OMX_CORE_NUM_OUTPUT_BUFFERS),
m_inp_current_buf_count(0),
m_out_current_buf_count(0),
- output_buffer_size(OMX_EVRC_OUTPUT_BUFFER_SIZE),
+ output_buffer_size((OMX_U32)OMX_EVRC_OUTPUT_BUFFER_SIZE),
input_buffer_size(OMX_CORE_INPUT_BUFFER_SIZE),
m_inp_bEnabled(OMX_TRUE),
m_out_bEnabled(OMX_TRUE),
@@ -277,10 +280,7 @@
m_state(OMX_StateInvalid),
m_ipc_to_in_th(NULL),
m_ipc_to_out_th(NULL),
- m_ipc_to_cmd_th(NULL),
- nNumOutputBuf(0),
- nNumInputBuf(0),
- m_volume(25)
+ m_ipc_to_cmd_th(NULL)
{
int cond_ret = 0;
memset(&m_cmp, 0, sizeof(m_cmp));
@@ -500,13 +500,13 @@
m_evrc_pb_stats.fbd_cnt++;
pthread_mutex_lock(&out_buf_count_lock);
nNumOutputBuf--;
- DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%lu fbd_cnt=%lu\n",\
+ DEBUG_PRINT("FBD CB:: nNumOutputBuf=%d out_buf_len=%u fbd_cnt=%u\n",\
nNumOutputBuf,
m_evrc_pb_stats.tot_out_buf_len,
m_evrc_pb_stats.fbd_cnt);
m_evrc_pb_stats.tot_out_buf_len += bufHdr->nFilledLen;
m_evrc_pb_stats.tot_pb_time = bufHdr->nTimeStamp;
- DEBUG_PRINT("FBD:in_buf_len=%lu out_buf_len=%lu\n",
+ DEBUG_PRINT("FBD:in_buf_len=%u out_buf_len=%u\n",
m_evrc_pb_stats.tot_in_buf_len,
m_evrc_pb_stats.tot_out_buf_len);
@@ -540,9 +540,9 @@
=============================================================================*/
void omx_evrc_aenc::process_out_port_msg(void *client_data, unsigned char id)
{
- unsigned p1; // Parameter - 1
- unsigned p2; // Parameter - 2
- unsigned ident;
+ unsigned long p1 = 0; // Parameter - 1
+ unsigned long p2 = 0; // Parameter - 2
+ unsigned char ident = 0;
unsigned qsize = 0; // qsize
unsigned tot_qsize = 0;
omx_evrc_aenc *pThis = (omx_evrc_aenc *) client_data;
@@ -744,9 +744,9 @@
=============================================================================*/
void omx_evrc_aenc::process_command_msg(void *client_data, unsigned char id)
{
- unsigned p1; // Parameter - 1
- unsigned p2; // Parameter - 2
- unsigned ident;
+ unsigned long p1 = 0; // Parameter - 1
+ unsigned long p2 = 0; // Parameter - 2
+ unsigned char ident = 0;
unsigned qsize = 0;
omx_evrc_aenc *pThis = (omx_evrc_aenc*)client_data;
pthread_mutex_lock(&pThis->m_commandlock);
@@ -818,15 +818,15 @@
pThis->m_cb.EventHandler(&pThis->m_cmp,
pThis->m_app_data,
OMX_EventError,
- p2,
- NULL,
- NULL );
+ (OMX_U32)p2,
+ 0,
+ 0 );
} else
{
pThis->m_cb.EventHandler(&pThis->m_cmp,
pThis->m_app_data,
OMX_EventCmdComplete,
- p1, p2, NULL );
+ (OMX_U32)p1, (OMX_U32)p2, NULL );
}
} else
{
@@ -874,9 +874,9 @@
=============================================================================*/
void omx_evrc_aenc::process_in_port_msg(void *client_data, unsigned char id)
{
- unsigned p1; // Parameter - 1
- unsigned p2; // Parameter - 2
- unsigned ident;
+ unsigned long p1 = 0; // Parameter - 1
+ unsigned long p2 = 0; // Parameter - 2
+ unsigned char ident = 0;
unsigned qsize = 0;
unsigned tot_qsize = 0;
omx_evrc_aenc *pThis = (omx_evrc_aenc *) client_data;
@@ -1054,7 +1054,7 @@
randomly assign the value right now. Query will result in
incorrect param */
memset(&m_evrc_param, 0, sizeof(m_evrc_param));
- m_evrc_param.nSize = sizeof(m_evrc_param);
+ m_evrc_param.nSize = (OMX_U32)sizeof(m_evrc_param);
m_evrc_param.nChannels = OMX_EVRC_DEFAULT_CH_CFG;
//Current DSP does not have config
m_evrc_param.eCDMARate = OMX_AUDIO_CDMARateFull;
@@ -1063,7 +1063,7 @@
m_volume = OMX_EVRC_DEFAULT_VOL; /* Close to unity gain */
memset(&m_evrc_pb_stats,0,sizeof(EVRC_PB_STATS));
memset(&m_pcm_param, 0, sizeof(m_pcm_param));
- m_pcm_param.nSize = sizeof(m_pcm_param);
+ m_pcm_param.nSize = (OMX_U32)sizeof(m_pcm_param);
m_pcm_param.nChannels = OMX_EVRC_DEFAULT_CH_CFG;
m_pcm_param.nSamplingRate = OMX_EVRC_DEFAULT_SF;
nTimestamp = 0;
@@ -1094,20 +1094,20 @@
if (!strcmp(role,"OMX.qcom.audio.encoder.evrc"))
{
pcm_input = 1;
- component_Role.nSize = sizeof(role);
+ component_Role.nSize = (OMX_U32)sizeof(role);
strlcpy((char *)component_Role.cRole,
(const char*)role, sizeof(component_Role.cRole));
DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
} else if (!strcmp(role,"OMX.qcom.audio.encoder.tunneled.evrc"))
{
pcm_input = 0;
- component_Role.nSize = sizeof(role);
+ component_Role.nSize = (OMX_U32)sizeof(role);
strlcpy((char *)component_Role.cRole,
(const char*)role, sizeof(component_Role.cRole));
DEBUG_PRINT("\ncomponent_init: Component %s LOADED \n", role);
} else
{
- component_Role.nSize = sizeof("\0");
+ component_Role.nSize = (OMX_U32)sizeof("\0");
strlcpy((char *)component_Role.cRole,
(const char*)"\0",sizeof(component_Role.cRole));
DEBUG_PRINT("\ncomponent_init: Component %s LOADED is invalid\n", role);
@@ -1253,7 +1253,7 @@
if(hComp == NULL)
{
- cmdData = NULL;
+ cmdData = cmdData;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
return OMX_ErrorBadParameter;
}
@@ -1267,7 +1267,7 @@
}
post_command((unsigned)cmd,(unsigned)param1,OMX_COMPONENT_GENERATE_COMMAND);
DEBUG_PRINT("Send Command : returns with OMX_ErrorNone \n");
- DEBUG_PRINT("send_command : recieved state before semwait= %lu\n",param1);
+ DEBUG_PRINT("send_command : recieved state before semwait= %u\n",param1);
sem_wait (&sem_States);
DEBUG_PRINT("send_command : recieved state after semwait\n");
return OMX_ErrorNone;
@@ -1297,7 +1297,7 @@
if(hComp == NULL)
{
- cmdData = NULL;
+ cmdData = cmdData;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
return OMX_ErrorBadParameter;
}
@@ -1462,7 +1462,7 @@
}
pcm_cfg.channel_count = m_pcm_param.nChannels;
pcm_cfg.sample_rate = m_pcm_param.nSamplingRate;
- DEBUG_PRINT("pcm config %lu %lu\n",m_pcm_param.nChannels,
+ DEBUG_PRINT("pcm config %u %u\n",m_pcm_param.nChannels,
m_pcm_param.nSamplingRate);
if (ioctl(m_drv_fd, AUDIO_SET_CONFIG, &pcm_cfg) == -1)
@@ -1725,7 +1725,7 @@
} else if (OMX_CommandFlush == cmd)
{
DEBUG_DETAIL("*************************\n");
- DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%lu\n",param1);
+ DEBUG_PRINT("SCP-->RXED FLUSH COMMAND port=%u\n",param1);
DEBUG_DETAIL("*************************\n");
bFlag = 0;
if ( param1 == OMX_CORE_INPUT_PORT_INDEX ||
@@ -1764,7 +1764,7 @@
if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
{
DEBUG_PRINT("SCP: execute_omx_flush in Disable in "\
- " param1=%lu m_state=%d \n",param1, m_state);
+ " param1=%u m_state=%d \n",param1, m_state);
execute_omx_flush(param1);
}
DEBUG_PRINT("send_command_proxy:OMX_CommandPortDisable:\
@@ -1796,7 +1796,7 @@
if (m_state == OMX_StatePause ||m_state == OMX_StateExecuting)
{
DEBUG_PRINT("SCP: execute_omx_flush in Disable out "\
- "param1=%lu m_state=%d \n",param1, m_state);
+ "param1=%u m_state=%d \n",param1, m_state);
execute_omx_flush(param1);
}
BITMASK_SET(&m_flags, OMX_COMPONENT_OUTPUT_DISABLE_PENDING);
@@ -1913,7 +1913,7 @@
{
bool bRet = true;
- DEBUG_PRINT("Execute_omx_flush Port[%lu]", param1);
+ DEBUG_PRINT("Execute_omx_flush Port[%u]", param1);
struct timespec abs_timeout;
abs_timeout.tv_sec = 1;
abs_timeout.tv_nsec = 0;
@@ -1963,7 +1963,7 @@
DEBUG_DETAIL("WAITING FOR FLUSH ACK's param1=%d",param1);
wait_for_event();
- DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%lu cmd_cmpl=%d",\
+ DEBUG_PRINT("RECIEVED BOTH FLUSH ACK's param1=%u cmd_cmpl=%d",\
param1,cmd_cmpl);
// If not going to idle state, Send FLUSH complete message
@@ -2077,7 +2077,7 @@
DEBUG_DETAIL("RECIEVED FLUSH ACK FOR O/P PORT param1=%d",param1);
} else
{
- DEBUG_PRINT("Invalid Port ID[%lu]",param1);
+ DEBUG_PRINT("Invalid Port ID[%u]",param1);
}
return bRet;
}
@@ -2105,9 +2105,9 @@
bool omx_evrc_aenc::execute_input_omx_flush()
{
OMX_BUFFERHEADERTYPE *omx_buf;
- unsigned p1; // Parameter - 1
- unsigned p2; // Parameter - 2
- unsigned ident;
+ unsigned long p1 = 0; // Parameter - 1
+ unsigned long p2 = 0; // Parameter - 2
+ unsigned char ident = 0;
unsigned qsize=0; // qsize
unsigned tot_qsize=0; // qsize
@@ -2185,9 +2185,9 @@
bool omx_evrc_aenc::execute_output_omx_flush()
{
OMX_BUFFERHEADERTYPE *omx_buf;
- unsigned p1; // Parameter - 1
- unsigned p2; // Parameter - 2
- unsigned ident;
+ unsigned long p1; // Parameter - 1
+ unsigned long p2; // Parameter - 2
+ unsigned char ident = 0;
unsigned qsize=0; // qsize
unsigned tot_qsize=0; // qsize
@@ -2268,9 +2268,9 @@
SIDE EFFECTS:
None
=============================================================================*/
-bool omx_evrc_aenc::post_input(unsigned int p1,
- unsigned int p2,
- unsigned int id)
+bool omx_evrc_aenc::post_input(unsigned long p1,
+ unsigned long p2,
+ unsigned char id)
{
bool bRet = false;
pthread_mutex_lock(&m_lock);
@@ -2331,7 +2331,7 @@
=============================================================================*/
bool omx_evrc_aenc::post_command(unsigned int p1,
unsigned int p2,
- unsigned int id)
+ unsigned char id)
{
bool bRet = false;
@@ -2378,9 +2378,9 @@
SIDE EFFECTS:
None
=============================================================================*/
-bool omx_evrc_aenc::post_output(unsigned int p1,
- unsigned int p2,
- unsigned int id)
+bool omx_evrc_aenc::post_output(unsigned long p1,
+ unsigned long p2,
+ unsigned char id)
{
bool bRet = false;
@@ -2444,7 +2444,7 @@
return OMX_ErrorBadParameter;
}
- switch (paramIndex)
+ switch ((int)paramIndex)
{
case OMX_IndexParamPortDefinition:
{
@@ -2452,11 +2452,11 @@
portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
DEBUG_PRINT("OMX_IndexParamPortDefinition " \
- "portDefn->nPortIndex = %lu\n",
+ "portDefn->nPortIndex = %u\n",
portDefn->nPortIndex);
portDefn->nVersion.nVersion = OMX_SPEC_VERSION;
- portDefn->nSize = sizeof(portDefn);
+ portDefn->nSize = (OMX_U32)sizeof(portDefn);
portDefn->eDomain = OMX_PortDomainAudio;
if (0 == portDefn->nPortIndex)
@@ -2498,7 +2498,7 @@
DEBUG_PRINT("OMX_IndexParamAudioInit\n");
portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
- portParamType->nSize = sizeof(portParamType);
+ portParamType->nSize = (OMX_U32)sizeof(portParamType);
portParamType->nPorts = 2;
portParamType->nStartPortNumber = 0;
break;
@@ -2510,7 +2510,7 @@
(OMX_AUDIO_PARAM_PORTFORMATTYPE *) paramData;
DEBUG_PRINT("OMX_IndexParamAudioPortFormat\n");
portFormatType->nVersion.nVersion = OMX_SPEC_VERSION;
- portFormatType->nSize = sizeof(portFormatType);
+ portFormatType->nSize = (OMX_U32)sizeof(portFormatType);
if (OMX_CORE_INPUT_PORT_INDEX == portFormatType->nPortIndex)
{
@@ -2520,7 +2520,7 @@
portFormatType->nPortIndex)
{
DEBUG_PRINT("get_parameter: OMX_IndexParamAudioFormat: "\
- "%lu\n", portFormatType->nIndex);
+ "%u\n", portFormatType->nIndex);
portFormatType->eEncoding = OMX_AUDIO_CodingEVRC;
} else
@@ -2554,7 +2554,7 @@
{
QOMX_AUDIO_STREAM_INFO_DATA *streaminfoparam =
(QOMX_AUDIO_STREAM_INFO_DATA *) paramData;
- streaminfoparam->sessionId = m_session_id;
+ streaminfoparam->sessionId = (OMX_U8)m_session_id;
break;
}
@@ -2567,9 +2567,9 @@
{
memcpy(pcmparam,&m_pcm_param,\
sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
- DEBUG_PRINT("get_parameter: Sampling rate %lu",\
+ DEBUG_PRINT("get_parameter: Sampling rate %u",\
pcmparam->nSamplingRate);
- DEBUG_PRINT("get_parameter: Number of channels %lu",\
+ DEBUG_PRINT("get_parameter: Number of channels %u",\
pcmparam->nChannels);
} else
{
@@ -2594,7 +2594,7 @@
(OMX_PORT_PARAM_TYPE *) paramData;
DEBUG_PRINT("get_parameter: OMX_IndexParamVideoInit\n");
portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
- portParamType->nSize = sizeof(portParamType);
+ portParamType->nSize = (OMX_U32)sizeof(portParamType);
portParamType->nPorts = 0;
portParamType->nStartPortNumber = 0;
break;
@@ -2604,7 +2604,7 @@
OMX_PRIORITYMGMTTYPE *priorityMgmtType =
(OMX_PRIORITYMGMTTYPE*)paramData;
DEBUG_PRINT("get_parameter: OMX_IndexParamPriorityMgmt\n");
- priorityMgmtType->nSize = sizeof(priorityMgmtType);
+ priorityMgmtType->nSize = (OMX_U32)sizeof(priorityMgmtType);
priorityMgmtType->nVersion.nVersion = OMX_SPEC_VERSION;
priorityMgmtType->nGroupID = m_priority_mgm.nGroupID;
priorityMgmtType->nGroupPriority =
@@ -2617,7 +2617,7 @@
(OMX_PORT_PARAM_TYPE *) paramData;
DEBUG_PRINT("get_parameter: OMX_IndexParamImageInit\n");
portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
- portParamType->nSize = sizeof(portParamType);
+ portParamType->nSize = (OMX_U32)sizeof(portParamType);
portParamType->nPorts = 0;
portParamType->nStartPortNumber = 0;
break;
@@ -2632,7 +2632,7 @@
DEBUG_PRINT("get_parameter: \
OMX_IndexParamCompBufferSupplier\n");
- bufferSupplierType->nSize = sizeof(bufferSupplierType);
+ bufferSupplierType->nSize = (OMX_U32)sizeof(bufferSupplierType);
bufferSupplierType->nVersion.nVersion = OMX_SPEC_VERSION;
if (OMX_CORE_INPUT_PORT_INDEX ==
bufferSupplierType->nPortIndex)
@@ -2661,7 +2661,7 @@
(OMX_PORT_PARAM_TYPE *) paramData;
DEBUG_PRINT("get_parameter: OMX_IndexParamOtherInit\n");
portParamType->nVersion.nVersion = OMX_SPEC_VERSION;
- portParamType->nSize = sizeof(portParamType);
+ portParamType->nSize = (OMX_U32)sizeof(portParamType);
portParamType->nPorts = 0;
portParamType->nStartPortNumber = 0;
break;
@@ -2759,7 +2759,7 @@
return OMX_ErrorIncorrectStateOperation;
}
DEBUG_PRINT("OMX_IndexParamPortDefinition portDefn->nPortIndex "
- "= %lu\n",portDefn->nPortIndex);
+ "= %u\n",portDefn->nPortIndex);
if (OMX_CORE_INPUT_PORT_INDEX == portDefn->nPortIndex)
{
if ( portDefn->nBufferCountActual >
@@ -2803,10 +2803,10 @@
}
OMX_PRIORITYMGMTTYPE *priorityMgmtype
= (OMX_PRIORITYMGMTTYPE*) paramData;
- DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %lu\n",
+ DEBUG_PRINT("set_parameter: OMX_IndexParamPriorityMgmt %u\n",
priorityMgmtype->nGroupID);
- DEBUG_PRINT("set_parameter: priorityMgmtype %lu\n",
+ DEBUG_PRINT("set_parameter: priorityMgmtype %u\n",
priorityMgmtype->nGroupPriority);
m_priority_mgm.nGroupID = priorityMgmtype->nGroupID;
@@ -2828,7 +2828,7 @@
portFormatType->nPortIndex)
{
DEBUG_PRINT("set_parameter: OMX_IndexParamAudioFormat:"\
- " %lu\n", portFormatType->nIndex);
+ " %u\n", portFormatType->nIndex);
portFormatType->eEncoding = OMX_AUDIO_CodingEVRC;
} else
{
@@ -2876,7 +2876,7 @@
{
memcpy(&m_pcm_param,pcmparam,\
sizeof(OMX_AUDIO_PARAM_PCMMODETYPE));
- DEBUG_PRINT("set_pcm_parameter: %lu %lu",\
+ DEBUG_PRINT("set_pcm_parameter: %u %u",\
m_pcm_param.nChannels,
m_pcm_param.nSamplingRate);
} else
@@ -2954,7 +2954,7 @@
if (OMX_CORE_INPUT_PORT_INDEX == volume->nPortIndex)
{
- volume->nSize = sizeof(volume);
+ volume->nSize = (OMX_U32)sizeof(volume);
volume->nVersion.nVersion = OMX_SPEC_VERSION;
volume->bLinear = OMX_TRUE;
volume->sVolume.nValue = m_volume;
@@ -2974,7 +2974,7 @@
if (OMX_CORE_INPUT_PORT_INDEX == mute->nPortIndex)
{
- mute->nSize = sizeof(mute);
+ mute->nSize = (OMX_U32)sizeof(mute);
mute->nVersion.nVersion = OMX_SPEC_VERSION;
mute->bMute = (BITMASK_PRESENT(&m_flags,
OMX_COMPONENT_MUTED)?OMX_TRUE:OMX_FALSE);
@@ -3182,8 +3182,8 @@
if((hComp == NULL) || (peerComponent == NULL) || (tunnelSetup == NULL))
{
- port = 0;
- peerPort = 0;
+ port = port;
+ peerPort = peerPort;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
return OMX_ErrorBadParameter;
}
@@ -3223,7 +3223,7 @@
if(hComp == NULL)
{
- port = 0;
+ port = port;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
free(buf_ptr);
return OMX_ErrorBadParameter;
@@ -3236,7 +3236,7 @@
bufHdr->pBuffer = (OMX_U8 *)((buf_ptr) + sizeof(META_IN)+
sizeof(OMX_BUFFERHEADERTYPE));
- bufHdr->nSize = sizeof(OMX_BUFFERHEADERTYPE);
+ bufHdr->nSize = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
bufHdr->nAllocLen = nBufSize;
bufHdr->pAppPrivate = appData;
@@ -3245,7 +3245,7 @@
m_inp_current_buf_count++;
DEBUG_PRINT("AIB:bufHdr %p bufHdr->pBuffer %p m_inp_buf_cnt=%u \
- bytes=%lu", bufHdr, bufHdr->pBuffer,
+ bytes=%u", bufHdr, bufHdr->pBuffer,
m_inp_current_buf_count, bytes);
} else
@@ -3277,7 +3277,7 @@
if(hComp == NULL)
{
- port = 0;
+ port = port;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
return OMX_ErrorBadParameter;
}
@@ -3293,7 +3293,7 @@
bufHdr->pBuffer = (OMX_U8 *)((buf_ptr) +
sizeof(OMX_BUFFERHEADERTYPE));
- bufHdr->nSize = sizeof(OMX_BUFFERHEADERTYPE);
+ bufHdr->nSize = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
bufHdr->nAllocLen = nBufSize;
bufHdr->pAppPrivate = appData;
@@ -3301,7 +3301,7 @@
m_output_buf_hdrs.insert(bufHdr, NULL);
m_out_current_buf_count++;
DEBUG_PRINT("AOB::bufHdr %p bufHdr->pBuffer %p m_out_buf_cnt=%d "\
- "bytes=%lu",bufHdr, bufHdr->pBuffer,\
+ "bytes=%u",bufHdr, bufHdr->pBuffer,\
m_out_current_buf_count, bytes);
} else
{
@@ -3515,7 +3515,7 @@
}
}
}
- DEBUG_PRINT("Use Buffer for port[%lu] eRet[%d]\n", port,eRet);
+ DEBUG_PRINT("Use Buffer for port[%u] eRet[%d]\n", port,eRet);
return eRet;
}
/*=============================================================================
@@ -3558,7 +3558,7 @@
if(hComp == NULL)
{
- port = 0;
+ port = port;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
return OMX_ErrorBadParameter;
}
@@ -3580,8 +3580,8 @@
bufHdr->pBuffer = (OMX_U8 *)(buffer);
DEBUG_PRINT("use_input_buffer:bufHdr %p bufHdr->pBuffer %p \
- bytes=%lu", bufHdr, bufHdr->pBuffer,bytes);
- bufHdr->nSize = sizeof(OMX_BUFFERHEADERTYPE);
+ bytes=%u", bufHdr, bufHdr->pBuffer,bytes);
+ bufHdr->nSize = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
bufHdr->nAllocLen = nBufSize;
input_buffer_size = nBufSize;
@@ -3643,7 +3643,7 @@
if(hComp == NULL)
{
- port = 0;
+ port = port;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
return OMX_ErrorBadParameter;
}
@@ -3669,8 +3669,8 @@
bufHdr->pBuffer = (OMX_U8 *)(buffer);
DEBUG_PRINT("use_output_buffer:bufHdr %p bufHdr->pBuffer %p \
- len=%lu\n", bufHdr, bufHdr->pBuffer,bytes);
- bufHdr->nSize = sizeof(OMX_BUFFERHEADERTYPE);
+ len=%u\n", bufHdr, bufHdr->pBuffer,bytes);
+ bufHdr->nSize = (OMX_U32)sizeof(OMX_BUFFERHEADERTYPE);
bufHdr->nVersion.nVersion = OMX_SPEC_VERSION;
bufHdr->nAllocLen = nBufSize;
output_buffer_size = nBufSize;
@@ -3769,7 +3769,7 @@
(m_out_bEnabled == OMX_FALSE &&
port == OMX_CORE_OUTPUT_PORT_INDEX))
{
- DEBUG_PRINT("Free Buffer while port %lu disabled\n", port);
+ DEBUG_PRINT("Free Buffer while port %u disabled\n", port);
} else if (m_state == OMX_StateExecuting || m_state == OMX_StatePause)
{
DEBUG_PRINT("Invalid state to free buffer,ports need to be disabled:\
@@ -3903,7 +3903,7 @@
{
OMX_ERRORTYPE eRet = OMX_ErrorNone;
- DEBUG_PRINT("ETB:Buf:%p Len %lu TS %lld numInBuf=%d\n", \
+ DEBUG_PRINT("ETB:Buf:%p Len %u TS %lld numInBuf=%d\n", \
buffer, buffer->nFilledLen, buffer->nTimeStamp, (nNumInputBuf));
if (m_state == OMX_StateInvalid)
{
@@ -3941,11 +3941,11 @@
{
if (search_input_bufhdr(buffer) == true)
{
- post_input((unsigned)hComp,
- (unsigned) buffer,OMX_COMPONENT_GENERATE_ETB);
+ post_input((unsigned long)hComp,
+ (unsigned long) buffer,OMX_COMPONENT_GENERATE_ETB);
} else
{
- DEBUG_PRINT_ERROR("Bad header %x \n", (int)buffer);
+ DEBUG_PRINT_ERROR("Bad header %p \n", buffer);
eRet = OMX_ErrorBadParameter;
}
}
@@ -3987,11 +3987,11 @@
data = m_tmp_meta_buf;
// copy the metadata info from the BufHdr and insert to payload
- meta_in.offsetVal = sizeof(META_IN);
+ meta_in.offsetVal = (OMX_U16)sizeof(META_IN);
meta_in.nTimeStamp.LowPart =
- ((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp)& 0xFFFFFFFF);
+ (unsigned int) ((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) & 0xFFFFFFFF);
meta_in.nTimeStamp.HighPart =
- (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
+ (unsigned int) (((((OMX_BUFFERHEADERTYPE*)buffer)->nTimeStamp) >> 32) & 0xFFFFFFFF);
meta_in.nFlags &= ~OMX_BUFFERFLAG_EOS;
if(buffer->nFlags & OMX_BUFFERFLAG_EOS)
{
@@ -4018,7 +4018,7 @@
/* Assume empty this buffer function has already checked
validity of buffer */
DEBUG_PRINT("Empty buffer %p to kernel driver\n", buffer);
- post_input((unsigned) & hComp,(unsigned) buffer,
+ post_input((unsigned long) & hComp,(unsigned long) buffer,
OMX_COMPONENT_GENERATE_BUFFER_DONE);
}
return OMX_ErrorNone;
@@ -4031,7 +4031,7 @@
{
OMX_STATETYPE state;
ENC_META_OUT *meta_out = NULL;
- int nReadbytes = 0;
+ ssize_t nReadbytes = 0;
pthread_mutex_lock(&m_state_lock);
get_state(&m_cmp, &state);
@@ -4061,8 +4061,9 @@
buffer->nTimeStamp = (((OMX_TICKS) meta_out->msw_ts << 32)+
meta_out->lsw_ts);
buffer->nFlags |= meta_out->nflags;
- buffer->nOffset = meta_out->offset_to_frame + sizeof(unsigned char);
- buffer->nFilledLen = nReadbytes - buffer->nOffset;
+ buffer->nOffset = (OMX_U32)(meta_out->offset_to_frame +
+ sizeof(unsigned char));
+ buffer->nFilledLen = (OMX_U32)(nReadbytes - buffer->nOffset);
nTimestamp = buffer->nTimeStamp;
DEBUG_PRINT("nflags %d frame_size %d offset_to_frame %d \
timestamp %lld\n", meta_out->nflags,
@@ -4096,7 +4097,7 @@
{
DEBUG_PRINT("FTBP:Post the FBD to event thread currstate=%d\n",\
state);
- post_output((unsigned) & hComp,(unsigned) buffer,
+ post_output((unsigned long) & hComp,(unsigned long) buffer,
OMX_COMPONENT_GENERATE_FRAME_DONE);
}
else
@@ -4161,8 +4162,8 @@
m_evrc_pb_stats.ftb_cnt++;
DEBUG_DETAIL("FTB:nNumOutputBuf is %d", nNumOutputBuf);
pthread_mutex_unlock(&out_buf_count_lock);
- post_output((unsigned)hComp,
- (unsigned) buffer,OMX_COMPONENT_GENERATE_FTB);
+ post_output((unsigned long)hComp,
+ (unsigned long) buffer,OMX_COMPONENT_GENERATE_FTB);
return eRet;
}
@@ -4245,11 +4246,11 @@
{
DEBUG_PRINT("Component-deinit being processed\n");
DEBUG_PRINT("********************************\n");
- DEBUG_PRINT("STATS: in-buf-len[%lu]out-buf-len[%lu] tot-pb-time[%ld]",\
+ DEBUG_PRINT("STATS: in-buf-len[%u]out-buf-len[%u] tot-pb-time[%lld]",\
m_evrc_pb_stats.tot_in_buf_len,
m_evrc_pb_stats.tot_out_buf_len,
m_evrc_pb_stats.tot_pb_time);
- DEBUG_PRINT("STATS: fbd-cnt[%lu]ftb-cnt[%lu]etb-cnt[%lu]ebd-cnt[%lu]",\
+ DEBUG_PRINT("STATS: fbd-cnt[%u]ftb-cnt[%u]etb-cnt[%u]ebd-cnt[%u]",\
m_evrc_pb_stats.fbd_cnt,m_evrc_pb_stats.ftb_cnt,
m_evrc_pb_stats.etb_cnt,
m_evrc_pb_stats.ebd_cnt);
@@ -4389,8 +4390,8 @@
if((hComp == NULL) || (appData == NULL) || (eglImage == NULL))
{
- bufferHdr = NULL;
- port = 0;
+ bufferHdr = bufferHdr;
+ port = port;
DEBUG_PRINT_ERROR("Returning OMX_ErrorBadParameter\n");
return OMX_ErrorBadParameter;
}
@@ -4424,8 +4425,8 @@
}
if (index == 0 && role)
{
- memcpy(role, cmp_role, sizeof(cmp_role));
- *(((char *) role) + sizeof(cmp_role)) = '\0';
+ memcpy(role, cmp_role, strlen(cmp_role));
+ *(((char *) role) + strlen(cmp_role) + 1) = '\0';
} else
{
eRet = OMX_ErrorNoMore;
diff --git a/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c b/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c
index e01759e..63d953b 100644
--- a/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c
+++ b/mm-audio/aenc-evrc/qdsp6/test/omx_evrc_enc_test.c
@@ -1,6 +1,6 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -85,9 +85,9 @@
uint32_t min_bitrate = 0;
uint32_t max_bitrate = 0;
uint32_t cdmarate = 0;
-uint32_t rectime = -1;
-uint32_t recpath = -1;
-uint32_t pcmplayback = 0;
+uint32_t rectime = 0;
+uint32_t recpath = 0;
+int32_t pcmplayback = 0;
uint32_t tunnel = 0;
uint32_t format = 1;
#define DEBUG_PRINT printf
@@ -217,14 +217,14 @@
{'v','r','a','t'},0, 0, 0,{'d','a','t','a'},0
};
-static unsigned totaldatalen = 0;
-static unsigned framecnt = 0;
+static int totaldatalen = 0;
+static int framecnt = 0;
/************************************************************************/
/* GLOBAL INIT */
/************************************************************************/
-int input_buf_cnt = 0;
-int output_buf_cnt = 0;
+unsigned int input_buf_cnt = 0;
+unsigned int output_buf_cnt = 0;
int used_ip_buf_cnt = 0;
volatile int event_is_done = 0;
volatile int ebd_event_is_done = 0;
@@ -265,7 +265,7 @@
static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *evrc_enc_handle,
OMX_BUFFERHEADERTYPE ***pBufHdrs,
OMX_U32 nPortIndex,
- long bufCntMin, long bufSize);
+ unsigned int bufCntMin, unsigned int bufSize);
static OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
@@ -325,7 +325,7 @@
static void create_qcp_header(int Datasize, int Frames)
{
- append_header.s_riff = Datasize + QCP_HEADER_SIZE - 8;
+ append_header.s_riff = (unsigned)(Datasize + (int)QCP_HEADER_SIZE - 8);
/* exclude riff id and size field */
append_header.data1 = 0xe689d48d;
append_header.data2 = 0x9076;
@@ -349,8 +349,8 @@
append_header.vr_bytes_per_pkt[3] = 0x0102;
append_header.s_vrat = 0x00000008;
append_header.v_rate = 0x00000001;
- append_header.size_in_pkts = Frames;
- append_header.s_data = Datasize;
+ append_header.size_in_pkts = (unsigned)Frames;
+ append_header.s_data = (unsigned)Datasize;
return;
}
@@ -368,7 +368,7 @@
(void)pEventData;
switch(eEvent) {
case OMX_EventCmdComplete:
- DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%lu data2=%lu\n",(OMX_EVENTTYPE)eEvent,
+ DEBUG_PRINT("\n OMX_EventCmdComplete event=%d data1=%u data2=%u\n",(OMX_EVENTTYPE)eEvent,
nData1,nData2);
event_complete();
break;
@@ -395,8 +395,8 @@
OMX_IN OMX_BUFFERHEADERTYPE* pBuffer)
{
size_t bytes_writen = 0;
- int total_bytes_writen = 0;
- unsigned int len = 0;
+ size_t total_bytes_writen = 0;
+ size_t len = 0;
struct enc_meta_out *meta = NULL;
OMX_U8 *src = pBuffer->pBuffer;
unsigned int num_of_frames = 1;
@@ -443,8 +443,8 @@
num_of_frames--;
total_bytes_writen += len;
}
- DEBUG_PRINT(" FillBufferDone size writen to file %d count %d\n",total_bytes_writen, framecnt);
- totaldatalen += total_bytes_writen ;
+ DEBUG_PRINT(" FillBufferDone size writen to file %zu count %d\n",total_bytes_writen, framecnt);
+ totaldatalen = totaldatalen + (int)total_bytes_writen;
framecnt++;
DEBUG_PRINT(" FBD calling FTB\n");
@@ -497,7 +497,7 @@
}
if((readBytes = Read_Buffer(pBuffer)) > 0) {
- pBuffer->nFilledLen = readBytes;
+ pBuffer->nFilledLen = (OMX_U32)readBytes;
used_ip_buf_cnt++;
OMX_EmptyThisBuffer(hComponent,pBuffer);
}
@@ -534,7 +534,7 @@
int main(int argc, char **argv)
{
- int bufCnt=0;
+ unsigned int bufCnt=0;
OMX_ERRORTYPE result;
struct sigaction sa;
@@ -556,12 +556,12 @@
if (argc >= 9) {
in_filename = argv[1];
out_filename = argv[2];
- tunnel = atoi(argv[3]);
- min_bitrate = atoi(argv[4]);
- max_bitrate = atoi(argv[5]);
- cdmarate = atoi(argv[6]);
- recpath = atoi(argv[7]); // No configuration support yet..
- rectime = atoi(argv[8]);
+ tunnel = (uint32_t)atoi(argv[3]);
+ min_bitrate = (uint32_t)atoi(argv[4]);
+ max_bitrate = (uint32_t)atoi(argv[5]);
+ cdmarate = (uint32_t)atoi(argv[6]);
+ recpath = (uint32_t)atoi(argv[7]); // No configuration support yet..
+ rectime = (uint32_t)atoi(argv[8]);
} else {
DEBUG_PRINT(" invalid format: \n");
@@ -733,7 +733,7 @@
/* Query for audio decoders*/
DEBUG_PRINT("Evrc_test: Before entering OMX_GetComponentOfRole");
OMX_GetComponentsOfRole(role, &total, 0);
- DEBUG_PRINT ("\nTotal components of role=%s :%lu", role, total);
+ DEBUG_PRINT ("\nTotal components of role=%s :%u", role, total);
omxresult = OMX_GetHandle((OMX_HANDLETYPE*)(&evrc_enc_handle),
@@ -758,8 +758,8 @@
}
else
{
- DEBUG_PRINT("\nportParam.nPorts:%lu\n", portParam.nPorts);
- DEBUG_PRINT("\nportParam.nStartPortNumber:%lu\n",
+ DEBUG_PRINT("\nportParam.nPorts:%u\n", portParam.nPorts);
+ DEBUG_PRINT("\nportParam.nStartPortNumber:%u\n",
portParam.nStartPortNumber);
}
@@ -773,12 +773,16 @@
int Play_Encoder()
{
- int i;
+ unsigned int i;
int Size=0;
DEBUG_PRINT("Inside %s \n", __FUNCTION__);
OMX_ERRORTYPE ret;
OMX_INDEXTYPE index;
+#ifdef __LP64__
+ DEBUG_PRINT("sizeof[%ld]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#else
DEBUG_PRINT("sizeof[%d]\n", sizeof(OMX_BUFFERHEADERTYPE));
+#endif
/* open the i/p and o/p files based on the video file format passed */
if(open_audio_file()) {
@@ -793,8 +797,8 @@
inputportFmt.nPortIndex = portParam.nStartPortNumber;
OMX_GetParameter(evrc_enc_handle,OMX_IndexParamPortDefinition,&inputportFmt);
- DEBUG_PRINT ("\nEnc Input Buffer Count %lu\n", inputportFmt.nBufferCountMin);
- DEBUG_PRINT ("\nEnc: Input Buffer Size %lu\n", inputportFmt.nBufferSize);
+ DEBUG_PRINT ("\nEnc Input Buffer Count %u\n", inputportFmt.nBufferCountMin);
+ DEBUG_PRINT ("\nEnc: Input Buffer Size %u\n", inputportFmt.nBufferSize);
if(OMX_DirInput != inputportFmt.eDir) {
DEBUG_PRINT ("\nEnc: Expect Input Port\n");
@@ -813,8 +817,8 @@
outputportFmt.nPortIndex = portParam.nStartPortNumber + 1;
OMX_GetParameter(evrc_enc_handle,OMX_IndexParamPortDefinition,&outputportFmt);
- DEBUG_PRINT ("\nEnc: Output Buffer Count %lu\n", outputportFmt.nBufferCountMin);
- DEBUG_PRINT ("\nEnc: Output Buffer Size %lu\n", outputportFmt.nBufferSize);
+ DEBUG_PRINT ("\nEnc: Output Buffer Count %u\n", outputportFmt.nBufferCountMin);
+ DEBUG_PRINT ("\nEnc: Output Buffer Size %u\n", outputportFmt.nBufferSize);
if(OMX_DirOutput != outputportFmt.eDir) {
DEBUG_PRINT ("\nEnc: Expect Output Port\n");
@@ -904,7 +908,7 @@
for(i=0; i < output_buf_cnt; i++) {
DEBUG_PRINT ("\nOMX_FillThisBuffer on output buf no.%d\n",i);
pOutputBufHdrs[i]->nOutputPortIndex = 1;
- pOutputBufHdrs[i]->nFlags &= ~OMX_BUFFERFLAG_EOS;
+ pOutputBufHdrs[i]->nFlags = pOutputBufHdrs[i]->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
ret = OMX_FillThisBuffer(evrc_enc_handle, pOutputBufHdrs[i]);
if (OMX_ErrorNone != ret) {
DEBUG_PRINT("OMX_FillThisBuffer failed with result %d\n", ret);
@@ -926,7 +930,7 @@
bInputEosReached = true;
pInputBufHdrs[i]->nFlags= OMX_BUFFERFLAG_EOS;
}
- pInputBufHdrs[i]->nFilledLen = Size;
+ pInputBufHdrs[i]->nFilledLen = (OMX_U32)Size;
pInputBufHdrs[i]->nInputPortIndex = 0;
used_ip_buf_cnt++;
ret = OMX_EmptyThisBuffer(evrc_enc_handle, pInputBufHdrs[i]);
@@ -964,11 +968,11 @@
static OMX_ERRORTYPE Allocate_Buffer ( OMX_COMPONENTTYPE *avc_enc_handle,
OMX_BUFFERHEADERTYPE ***pBufHdrs,
OMX_U32 nPortIndex,
- long bufCntMin, long bufSize)
+ unsigned int bufCntMin, unsigned int bufSize)
{
DEBUG_PRINT("Inside %s \n", __FUNCTION__);
OMX_ERRORTYPE error=OMX_ErrorNone;
- long bufCnt=0;
+ unsigned int bufCnt=0;
/* To remove warning for unused variable to keep prototype same */
(void)avc_enc_handle;
@@ -976,7 +980,7 @@
malloc(sizeof(OMX_BUFFERHEADERTYPE*)*bufCntMin);
for(bufCnt=0; bufCnt < bufCntMin; ++bufCnt) {
- DEBUG_PRINT("\n OMX_AllocateBuffer No %ld \n", bufCnt);
+ DEBUG_PRINT("\n OMX_AllocateBuffer No %d \n", bufCnt);
error = OMX_AllocateBuffer(evrc_enc_handle, &((*pBufHdrs)[bufCnt]),
nPortIndex, NULL, bufSize);
}
@@ -990,7 +994,7 @@
static int Read_Buffer (OMX_BUFFERHEADERTYPE *pBufHdr )
{
- int bytes_read=0;
+ size_t bytes_read=0;
pBufHdr->nFilledLen = 0;
@@ -998,11 +1002,11 @@
bytes_read = fread(pBufHdr->pBuffer, 1, pBufHdr->nAllocLen , inputBufferFile);
- pBufHdr->nFilledLen = bytes_read;
+ pBufHdr->nFilledLen = (OMX_U32)bytes_read;
// Time stamp logic
((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp = \
- (unsigned long) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
+ (OMX_TICKS) ((total_pcm_bytes * 1000)/(samplerate * channels *2));
DEBUG_PRINT ("\n--time stamp -- %ld\n", (unsigned long)((OMX_BUFFERHEADERTYPE *)pBufHdr)->nTimeStamp);
if(bytes_read == 0)
@@ -1012,12 +1016,12 @@
}
else
{
- pBufHdr->nFlags &= ~OMX_BUFFERFLAG_EOS;
+ pBufHdr->nFlags = pBufHdr->nFlags & (unsigned)~OMX_BUFFERFLAG_EOS;
- total_pcm_bytes += bytes_read;
+ total_pcm_bytes = (unsigned)(total_pcm_bytes + bytes_read);
}
- return bytes_read;;
+ return (int)bytes_read;;
}