#include "pvmp4audiodecoder_api.h"
#endif
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
+
+
#define AACDEC_PCM_FRAME_SAMPLE_SIZE 1024 // 1024 samples
class OmxAacDecoder
OMX_S32 iAacInitFlag;
OMX_S32 iInputUsedLength;
+#if PROFILING_ON
+ OMX_U32 iTotalTicks;
+ OMX_U32 iNumOutputSamples;
+#endif
+
private:
Int RetrieveDecodedStreamType();
#include "aac_dec.h"
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
+
OmxAacDecoder::OmxAacDecoder()
{
iAacInitFlag = 0;
iInputUsedLength = 0;
+
+#if PROFILING_ON
+ iTotalTicks = 0;
+ iNumOutputSamples = 0;
+#endif
}
//Decode the config buffer
if (0 == iAacInitFlag)
{
+
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
Status = PVMP4AudioDecoderConfig(&iExt, ipMem);
+
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+#endif
+
if (MP4AUDEC_SUCCESS == Status)
{
iAacInitFlag = 1;
}
iExt.inputBufferUsedLength = 0;
+
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
Status = PVMP4AudioDecodeFrame(&iExt, ipMem);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+#endif
+
if (MP4AUDEC_SUCCESS == Status || SUCCESS == Status)
{
-
*aInBufSize -= iExt.inputBufferUsedLength;
if (0 == *aInBufSize)
{
*aResizeFlag = OMX_TRUE;
}
+#if PROFILING_ON
+ iNumOutputSamples += *aSamplesPerFrame;
+#endif
+
return Status;
}
iCodecReady = OMX_FALSE;
}
+#if PROFILING_ON
+ if (0 != ipAacDec->iNumOutputSamples)
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"));
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxAacAO - Total Decoding Time (ms) = %d", OsclTickCount::TicksToMsec(ipAacDec->iTotalTicks)));
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxAacAO - Total Number of Output PCM Samples = %d", ipAacDec->iNumOutputSamples));
+ }
+#endif
+
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_NOTICE, (0, "OpenmaxAacAO : ComponentDeInit OUT"));
return OMX_ErrorNone;
#include "decoder_amr_wb.h"
#endif
-
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
class OmxAmrDecoder
{
OMX_S32 iAmrInitFlag;
+#if PROFILING_ON
+ OMX_U32 iTotalTicks;
+ OMX_U32 iNumOutputSamples;
+#endif
+
private:
Frame_Type_3GPP GetFrameTypeLength(OMX_U8* &ptr, OMX_S32 *pLength);
#include "cnst.h"
#include "d_homing.h"
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
//Compressed audio formats
#define PV_AMR_IETF 0
/* Initialize decoder homing flags */
iDecHomingFlag = 0;
iDecHomingFlagOld = 1;
+
+#if PROFILING_ON
+ iTotalTicks = 0;
+ iNumOutputSamples = 0;
+#endif
}
/* Decoder Initialization function */
iCodecExternals->pInputBuffer = (uint8*) pSpeechBits;
iCodecExternals->pOutputBuffer = (int16*) aOutputBuffer;
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
ByteOffset = iAudioAmrDecoder->ExecuteL(iCodecExternals);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+ if (PV_GSMAMR_DECODE_STATUS_ERR != ByteOffset)
+ {
+ iNumOutputSamples += (iOutputFrameSize >> 1);
+ }
+#endif
+
if (PV_GSMAMR_DECODE_STATUS_ERR == ByteOffset)
{
*aInBufSize = 0;
iCodecExternals->pInputBuffer = (uint8*) pSpeechBits;
iCodecExternals->pOutputBuffer = (int16*) aOutputBuffer;
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
ByteOffset = iAudioAmrDecoder->ExecuteL(iCodecExternals);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+#endif
if (PV_GSMAMR_DECODE_STATUS_ERR == ByteOffset)
{
Status = OMX_FALSE;
if (ByteOffset <= (OMX_S32)*aInBufSize)
{
+
+#if PROFILING_ON
+ iNumOutputSamples += (iOutputFrameSize >> 1);
+#endif
*aInBufSize -= ByteOffset;
*aInBuffer += ByteOffset;
*aOutputLength = iOutputFrameSize;
iCodecExternals->pInputBuffer = (uint8*) & FrameType;
iCodecExternals->pOutputBuffer = (int16*) aOutputBuffer;
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
ByteOffset = iAudioAmrDecoder->ExecuteL(iCodecExternals);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+ if (PV_GSMAMR_DECODE_STATUS_ERR != ByteOffset)
+ {
+ iNumOutputSamples += (iOutputFrameSize >> 1);
+ }
+#endif
+
if (PV_GSMAMR_DECODE_STATUS_ERR == ByteOffset)
{
Status = OMX_FALSE;
iCodecReady = OMX_FALSE;
}
+#if PROFILING_ON
+ if (0 != ipAmrDec->iNumOutputSamples)
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"));
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxAmrAO - Total Decoding Time (ms) = %d", OsclTickCount::TicksToMsec(ipAmrDec->iTotalTicks)));
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxAmrAO - Total Number of Output PCM Samples = %d", ipAmrDec->iNumOutputSamples));
+ }
+#endif
+
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_NOTICE, (0, "OpenmaxAmrAO : ComponentDeInit OUT"));
return OMX_ErrorNone;
}
pOutBuffer = &ipOutputBuffer->pBuffer[ipOutputBuffer->nFilledLen];
+
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
oscl_memset(pOutBuffer, 0, iOutputFrameLength);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ ipAmrDec->iTotalTicks += (EndTime - StartTime);
+ ipAmrDec->iNumOutputSamples += (iOutputFrameLength >> 1);
+#endif
+
ipOutputBuffer->nFilledLen += iOutputFrameLength;
ipOutputBuffer->nOffset = 0;
iCurrentTimestamp += OMX_AMR_DEC_FRAME_INTERVAL;
#include "pv_omxcore.h"
#endif
+#if PROFILING_ON
+#ifndef OSCL_TICKCOUNT_H_INCLUDED
+#include "oscl_tickcount.h"
+#endif
+#endif
+
#define OMX_PORT_INPUTPORT_INDEX OMX_DirInput
#define OMX_PORT_OUTPUTPORT_INDEX OMX_DirOutput
PVLogger* iLogger;
+#if PROFILING_ON
+ PVLogger* iDiagnosticsLogger;
+#endif
+
OSCL_IMPORT_REF void Run();
OMX_CALLBACKTYPE* ipCallbacks;
iLogger = PVLogger::GetLoggerObject("OmxComponentBase");
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_NOTICE, (0, "OmxComponentBase : constructed"));
+#if PROFILING_ON
+ iDiagnosticsLogger = PVLogger::GetLoggerObject("pvplayerprofiling.omxcomponent");
+#endif
+
//Flag to call BufferMgmtFunction in the Run() when the component state is executing
iBufferExecuteFlag = OMX_FALSE;
ipAppPriv = NULL;
// 1 - Multithreaded, 0 - AO
#define PROXY_INTERFACE 1
+#define PROFILING_ON 0
+
+#if PROFILING_ON
+
+#if PROXY_INTERFACE
+#undef PROXY_INTERFACE
+#endif
+
+#endif
+
#if (PROXY_INTERFACE) && (PVLOGGER_INST_LEVEL>0)
// Logging in pv omx components that run in separate threads can only be done by sending a log into
#include "oscl_mem.h"
#endif
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
#define AVC_DEC_TIMESTAMP_ARRAY_SIZE 17
FrameSize = 0;
iAvcActiveFlag = OMX_FALSE;
oscl_memset(DisplayTimestampArray, 0, sizeof(OMX_TICKS)*AVC_DEC_TIMESTAMP_ARRAY_SIZE);
+
+#if PROFILING_ON
+ iTotalTicks = 0;
+#endif
};
~AvcDecoder_OMX() { };
OMX_BOOL iAvcActiveFlag;
OMX_BOOL iSkipToIDR;
+#if PROFILING_ON
+ OMX_U32 iTotalTicks;
+#endif
OMX_ERRORTYPE AvcDecInit_OMX();
#include "avc_dec.h"
#include "avcdec_int.h"
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
/*************************************/
/* functions needed for video engine */
if (AVC_NALTYPE_SPS == (AVCNalUnitType)NalType)
{
- if (PVAVCDecSeqParamSet(&(AvcHandle), pNalBuffer, NalSize) != AVCDEC_SUCCESS)
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
+ Status = PVAVCDecSeqParamSet(&(AvcHandle), pNalBuffer, NalSize);
+
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+#endif
+
+ if (Status != AVCDEC_SUCCESS)
{
return OMX_FALSE;
}
else if (AVC_NALTYPE_PPS == (AVCNalUnitType) NalType)
{
- if (PVAVCDecPicParamSet(&(AvcHandle), pNalBuffer, NalSize) != AVCDEC_SUCCESS)
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
+ Status = PVAVCDecPicParamSet(&(AvcHandle), pNalBuffer, NalSize);
+
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+#endif
+
+ if (Status != AVCDEC_SUCCESS)
{
return OMX_FALSE;
}
}
}
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
+ Status = PVAVCDecodeSlice(&(AvcHandle), pNalBuffer, NalSize);
+
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+#endif
- if ((Status = PVAVCDecodeSlice(&(AvcHandle), pNalBuffer, NalSize)) == AVCDEC_PICTURE_OUTPUT_READY)
+ if (Status == AVCDEC_PICTURE_OUTPUT_READY)
{
FlushOutput_OMX(aOutBuffer, aOutputLength, aOutTimestamp, OldWidth, OldHeight);
#include "omx_proxy_interface.h"
#endif
+
// Use default DLL entry point
#ifndef OSCL_DLL_H_INCLUDED
#include "oscl_dll.h"
iCodecReady = OMX_FALSE;
}
+#if PROFILING_ON
+ if (0 != iFrameCount)
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"));
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxAvcAO - Total Decoding Time (ms) = %d", OsclTickCount::TicksToMsec(ipAvcDec->iTotalTicks)));
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxAvcAO - Total Number of Decoded Frames = %d", iFrameCount));
+ }
+#endif
+
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_NOTICE, (0, "OpenmaxAvcAO : ComponentDeInit OUT"));
return Status;
#include "mp4dec_lib.h"
#endif
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
+
class Mpeg4Decoder_OMX
{
public:
OMX_BOOL Mpeg4InitCompleteFlag;
+#if PROFILING_ON
+ OMX_U32 iTotalTicks;
+#endif
+
private:
MP4DecodingMode CodecMode;
VideoDecControls VideoCtrl;
#include "oscl_mem.h"
#include "omx_mpeg4_component.h"
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
#define MAX_LAYERS 1
#define PVH263DEFAULTHEIGHT 288
H263_START_CODE1[1] = 0x00;
H263_START_CODE1[2] = 0x80;
+#if PROFILING_ON
+ iTotalTicks = 0;
+#endif
+
}
return OMX_TRUE;
}
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
Status = (OMX_BOOL) PVDecodeVideoFrame(&VideoCtrl, aInputBuf,
&TimeStamp,
(int32*)aInBufSize,
&UseExtTimestamp,
(OMX_U8*) pFrame0);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+#endif
+
if (Status == PV_TRUE)
{
-
#ifdef _DEBUG
//printf("Frame number %d\n", ++FrameCount);
#endif
#include "oscl_dll.h"
#endif
+
OSCL_DLL_ENTRY_POINT_DEFAULT()
static const uint32 mask[33] =
iCodecReady = OMX_FALSE;
}
+#if PROFILING_ON
+ if (0 != iFrameCount)
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"));
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxMpeg4AO - Total Decoding Time (ms) = %d", OsclTickCount::TicksToMsec(ipMpegDecoderObject->iTotalTicks)));
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxMpeg4AO - Total Number of Decoded Frames = %d", iFrameCount));
+ }
+#endif
+
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_NOTICE, (0, "OpenmaxMpeg4AO : ComponentDeInit OUT"));
return Status;
#include "pvmp3_decoder.h"
#endif
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
class Mp3Decoder
{
OMX_S32 iInputUsedLength;
OMX_S32 iInitFlag;
+#if PROFILING_ON
+ OMX_U32 iTotalTicks;
+ OMX_U32 iNumOutputSamples;
+#endif
+
private:
CPvMP3_Decoder* iAudioMp3Decoder;
#include "mp3_dec.h"
#include "pvmp3decoder_api.h"
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
+
Mp3Decoder::Mp3Decoder()
{
iMP3DecExt = NULL;
iAudioMp3Decoder = NULL;
iInputUsedLength = 0;
iInitFlag = 0;
+
+#if PROFILING_ON
+ iTotalTicks = 0;
+ iNumOutputSamples = 0;
+#endif
+
}
OMX_BOOL Mp3Decoder::Mp3DecInit(OMX_AUDIO_CONFIG_EQUALIZERTYPE* aEqualizerType)
*/
iMP3DecExt->outputFrameSize = (*aOutputLength); /* in int16 samples */
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
+
Status = iAudioMp3Decoder->ExecuteL(iMP3DecExt);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ iTotalTicks += (EndTime - StartTime);
+ if (MP3DEC_SUCCESS == Status)
+ {
+ iNumOutputSamples += iMP3DecExt->outputFrameSize;
+ }
+#endif
+
if (MP3DEC_SUCCESS == Status)
{
*aInBufSize -= iMP3DecExt->inputBufferUsedLength;
#include "omx_proxy_interface.h"
#endif
+
// Use default DLL entry point
#ifndef OSCL_DLL_H_INCLUDED
#include "oscl_dll.h"
iCodecReady = OMX_FALSE;
}
+#if PROFILING_ON
+ if (0 != ipMp3Dec->iNumOutputSamples)
+ {
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"));
+
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxMp3AO - Total Decoding Time (ms) = %d", OsclTickCount::TicksToMsec(ipMp3Dec->iTotalTicks)));
+ PVLOGGER_LOGMSG(PVLOGMSG_INST_PROF, iDiagnosticsLogger, PVLOGMSG_INFO, (0, "OpenmaxMp3AO - Total Number of Output PCM Samples = %d", ipMp3Dec->iNumOutputSamples));
+ }
+#endif
+
PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG, iLogger, PVLOGMSG_NOTICE, (0, "OpenmaxMp3AO : ComponentDeInit OUT"));
return OMX_ErrorNone;
pOutBuffer = &ipOutputBuffer->pBuffer[ipOutputBuffer->nFilledLen];
+#if PROFILING_ON
+ OMX_U32 StartTime = OsclTickCount::TickCount();
+#endif
oscl_memset(pOutBuffer, 0, iOutputFrameLength);
+#if PROFILING_ON
+ OMX_U32 EndTime = OsclTickCount::TickCount();
+ ipMp3Dec->iTotalTicks += (EndTime - StartTime);
+ ipMp3Dec->iNumOutputSamples += (iOutputFrameLength >> 1);
+#endif
+
ipOutputBuffer->nFilledLen += iOutputFrameLength;
ipOutputBuffer->nOffset = 0;
iCurrentFrameTS.UpdateTimestamp(iSamplesPerFrame);
// This header file is automatically generated at build-time
// *** OFFICIAL RELEASE INFO -- Will not auto update
-#define PV2WAY_ENGINE_SDKINFO_LABEL "909226"
+#define PV2WAY_ENGINE_SDKINFO_LABEL "909392"
#define PV2WAY_ENGINE_SDKINFO_DATE 0x20090812
#endif //PV_2WAY_SDKINFO_H_INCLUDED
// This header file is automatically generated at build-time
// *** OFFICIAL RELEASE INFO -- Will not auto update
-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "909226"
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "909392"
#define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20090812
#endif //PV_AUTHOR_SDKINFO_H_INCLUDED
// This header file is automatically generated at build-time
// *** OFFICIAL RELEASE INFO -- Will not auto update
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "909226"
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "909392"
#define PVPLAYER_ENGINE_SDKINFO_DATE 0x20090812
#endif //PV_PLAYER_SDKINFO_H_INCLUDED