OSDN Git Service

Added code in all the omx components to profile decoders
authorGarret Pick <pickgr@pv.com>
Mon, 31 Aug 2009 18:39:16 +0000 (11:39 -0700)
committerGarret Pick <pickgr@pv.com>
Mon, 31 Aug 2009 18:39:16 +0000 (11:39 -0700)
21 files changed:
codecs_v2/omx/omx_aac/include/aac_dec.h
codecs_v2/omx/omx_aac/src/aac_decode_frame.cpp
codecs_v2/omx/omx_aac/src/omx_aac_component.cpp
codecs_v2/omx/omx_amr/include/amr_dec.h
codecs_v2/omx/omx_amr/src/amr_decode_frame.cpp
codecs_v2/omx/omx_amr/src/omx_amr_component.cpp
codecs_v2/omx/omx_baseclass/include/pv_omxcomponent.h
codecs_v2/omx/omx_baseclass/src/pv_omxcomponent.cpp
codecs_v2/omx/omx_common/include/pv_omxdefs.h
codecs_v2/omx/omx_h264/include/avc_dec.h
codecs_v2/omx/omx_h264/src/avc_dec.cpp
codecs_v2/omx/omx_h264/src/omx_avc_component.cpp
codecs_v2/omx/omx_m4v/include/mpeg4_dec.h
codecs_v2/omx/omx_m4v/src/mpeg4_dec.cpp
codecs_v2/omx/omx_m4v/src/omx_mpeg4_component.cpp
codecs_v2/omx/omx_mp3/include/mp3_dec.h
codecs_v2/omx/omx_mp3/src/mp3_dec.cpp
codecs_v2/omx/omx_mp3/src/omx_mp3_component.cpp
engines/2way/src/pv_2way_sdkinfo.h
engines/author/src/pv_author_sdkinfo.h
engines/player/src/pv_player_sdkinfo.h

index 0dc7c4c..7338495 100644 (file)
 #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
@@ -59,6 +64,11 @@ class OmxAacDecoder
         OMX_S32 iAacInitFlag;
         OMX_S32 iInputUsedLength;
 
+#if PROFILING_ON
+        OMX_U32 iTotalTicks;
+        OMX_U32 iNumOutputSamples;
+#endif
+
     private:
 
         Int RetrieveDecodedStreamType();
index 443f341..c776c9a 100644 (file)
 
 #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
 }
 
 
@@ -121,7 +130,17 @@ Int OmxAacDecoder::AacDecodeFrames(OMX_S16* aOutputBuffer,
     //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;
@@ -152,11 +171,20 @@ Int OmxAacDecoder::AacDecodeFrames(OMX_S16* aOutputBuffer,
     }
 
     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)
         {
@@ -206,6 +234,10 @@ Int OmxAacDecoder::AacDecodeFrames(OMX_S16* aOutputBuffer,
             *aResizeFlag = OMX_TRUE;
         }
 
+#if PROFILING_ON
+        iNumOutputSamples += *aSamplesPerFrame;
+#endif
+
         return Status;
 
     }
index b352e4a..0895d09 100644 (file)
@@ -836,6 +836,16 @@ OMX_ERRORTYPE OpenmaxAacAO::ComponentDeInit()
         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;
index cf5d586..82ecaa0 100644 (file)
@@ -38,7 +38,9 @@
 #include "decoder_amr_wb.h"
 #endif
 
-
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
 
 class OmxAmrDecoder
 {
@@ -61,6 +63,11 @@ 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);
index 71a68fb..826256f 100644 (file)
@@ -25,6 +25,9 @@
 #include "cnst.h"
 #include "d_homing.h"
 
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
 
 //Compressed audio formats
 #define PV_AMR_IETF                 0
@@ -120,6 +123,11 @@ OmxAmrDecoder::OmxAmrDecoder()
     /* Initialize decoder homing flags */
     iDecHomingFlag = 0;
     iDecHomingFlagOld = 1;
+
+#if PROFILING_ON
+    iTotalTicks = 0;
+    iNumOutputSamples = 0;
+#endif
 }
 
 /* Decoder Initialization function */
@@ -335,8 +343,21 @@ OMX_BOOL OmxAmrDecoder::AmrDecodeFrame(OMX_S16* aOutputBuffer,
             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;
@@ -385,8 +406,16 @@ OMX_BOOL OmxAmrDecoder::AmrDecodeFrame(OMX_S16* aOutputBuffer,
             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;
@@ -394,6 +423,10 @@ OMX_BOOL OmxAmrDecoder::AmrDecodeFrame(OMX_S16* aOutputBuffer,
 
             if (ByteOffset <= (OMX_S32)*aInBufSize)
             {
+
+#if PROFILING_ON
+                iNumOutputSamples += (iOutputFrameSize >> 1);
+#endif
                 *aInBufSize -= ByteOffset;
                 *aInBuffer += ByteOffset;
                 *aOutputLength = iOutputFrameSize;
@@ -430,8 +463,21 @@ OMX_BOOL OmxAmrDecoder::AmrDecodeSilenceFrame(OMX_S16* aOutputBuffer,
     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;
index 7d7a35f..ebb430d 100644 (file)
@@ -944,6 +944,16 @@ OMX_ERRORTYPE OpenmaxAmrAO::ComponentDeInit()
         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;
@@ -1089,8 +1099,18 @@ void OpenmaxAmrAO::DoSilenceInsertion()
         }
 
         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;
index d010169..98cdba1 100644 (file)
 #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
@@ -452,6 +458,10 @@ class OmxComponentBase : public OsclActiveObject
 
         PVLogger* iLogger;
 
+#if PROFILING_ON
+        PVLogger* iDiagnosticsLogger;
+#endif
+
         OSCL_IMPORT_REF void Run();
 
         OMX_CALLBACKTYPE*   ipCallbacks;
index c40289d..4bcd537 100644 (file)
@@ -30,6 +30,10 @@ OmxComponentBase::OmxComponentBase() :
     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;
index 4e9c33d..af22801 100644 (file)
 // 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
index f2863a0..6c8fb21 100644 (file)
@@ -30,6 +30,9 @@
 #include "oscl_mem.h"
 #endif
 
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
 
 #define AVC_DEC_TIMESTAMP_ARRAY_SIZE 17
 
@@ -58,6 +61,10 @@ class AvcDecoder_OMX
             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() { };
@@ -73,6 +80,9 @@ class AvcDecoder_OMX
         OMX_BOOL        iAvcActiveFlag;
         OMX_BOOL        iSkipToIDR;
 
+#if PROFILING_ON
+        OMX_U32 iTotalTicks;
+#endif
 
         OMX_ERRORTYPE AvcDecInit_OMX();
 
index 99ee545..d25bf51 100644 (file)
@@ -19,6 +19,9 @@
 #include "avc_dec.h"
 #include "avcdec_int.h"
 
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
 
 /*************************************/
 /* functions needed for video engine */
@@ -240,7 +243,18 @@ OMX_BOOL AvcDecoder_OMX::AvcDecodeVideo_OMX(OMX_U8* aOutBuffer, OMX_U32* aOutput
 
     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;
         }
@@ -299,7 +313,18 @@ OMX_BOOL AvcDecoder_OMX::AvcDecodeVideo_OMX(OMX_U8* aOutBuffer, OMX_U32* aOutput
 
     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;
         }
@@ -323,8 +348,18 @@ OMX_BOOL AvcDecoder_OMX::AvcDecodeVideo_OMX(OMX_U8* aOutBuffer, OMX_U32* aOutput
             }
         }
 
+#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);
 
index 434f70f..c110cda 100644 (file)
@@ -24,6 +24,7 @@
 #include "omx_proxy_interface.h"
 #endif
 
+
 // Use default DLL entry point
 #ifndef OSCL_DLL_H_INCLUDED
 #include "oscl_dll.h"
@@ -1217,6 +1218,16 @@ OMX_ERRORTYPE OpenmaxAvcAO::ComponentDeInit()
         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;
index d021bd0..5ef3f5c 100644 (file)
 #include "mp4dec_lib.h"
 #endif
 
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
+
 class Mpeg4Decoder_OMX
 {
     public:
@@ -52,6 +56,10 @@ class Mpeg4Decoder_OMX
 
         OMX_BOOL Mpeg4InitCompleteFlag;
 
+#if PROFILING_ON
+        OMX_U32 iTotalTicks;
+#endif
+
     private:
         MP4DecodingMode CodecMode;
         VideoDecControls VideoCtrl;
index 62d5265..5d0c624 100644 (file)
@@ -23,6 +23,9 @@
 #include "oscl_mem.h"
 #include "omx_mpeg4_component.h"
 
+#if PROFILING_ON
+#include "oscl_tickcount.h"
+#endif
 
 #define MAX_LAYERS 1
 #define PVH263DEFAULTHEIGHT 288
@@ -58,6 +61,10 @@ Mpeg4Decoder_OMX::Mpeg4Decoder_OMX()
     H263_START_CODE1[1] = 0x00;
     H263_START_CODE1[2] = 0x80;
 
+#if PROFILING_ON
+    iTotalTicks = 0;
+#endif
+
 }
 
 
@@ -205,15 +212,23 @@ OMX_BOOL Mpeg4Decoder_OMX::Mp4DecodeVideo(OMX_U8* aOutBuffer, OMX_U32* aOutputLe
         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
index b8d2abc..3179fa2 100644 (file)
@@ -28,6 +28,7 @@
 #include "oscl_dll.h"
 #endif
 
+
 OSCL_DLL_ENTRY_POINT_DEFAULT()
 
 static const uint32 mask[33] =
@@ -1043,6 +1044,16 @@ OMX_ERRORTYPE OpenmaxMpeg4AO::ComponentDeInit()
         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;
index c9d9d69..dd46b18 100644 (file)
@@ -27,6 +27,9 @@
 #include "pvmp3_decoder.h"
 #endif
 
+#ifndef PV_OMXDEFS_H_INCLUDED
+#include "pv_omxdefs.h"
+#endif
 
 class Mp3Decoder
 {
@@ -51,6 +54,11 @@ class Mp3Decoder
         OMX_S32 iInputUsedLength;
         OMX_S32 iInitFlag;
 
+#if PROFILING_ON
+        OMX_U32 iTotalTicks;
+        OMX_U32 iNumOutputSamples;
+#endif
+
     private:
 
         CPvMP3_Decoder* iAudioMp3Decoder;
index d2f9926..2f20dc4 100644 (file)
 #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)
@@ -166,8 +176,21 @@ Int Mp3Decoder::Mp3DecodeAudio(OMX_S16* aOutBuff,
      */
     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;
index 01a2d39..c318053 100644 (file)
@@ -23,6 +23,7 @@
 #include "omx_proxy_interface.h"
 #endif
 
+
 // Use default DLL entry point
 #ifndef OSCL_DLL_H_INCLUDED
 #include "oscl_dll.h"
@@ -803,6 +804,16 @@ OMX_ERRORTYPE OpenmaxMp3AO::ComponentDeInit()
         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;
@@ -882,8 +893,17 @@ void OpenmaxMp3AO::DoSilenceInsertion()
 
 
         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);
index 44eca61..cc602af 100644 (file)
@@ -21,7 +21,7 @@
 // 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
index 9d88ea2..a9a63ee 100644 (file)
@@ -21,7 +21,7 @@
 // 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
index b155ac9..c0505d0 100644 (file)
@@ -21,7 +21,7 @@
 // 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