Loading media/libstagefright/codecs/avcdec/SoftAVCDec.cpp +10 −11 Original line number Diff line number Diff line Loading @@ -27,11 +27,10 @@ #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/MediaDefs.h> #include <OMX_VideoExt.h> #include <inttypes.h> namespace android { #define PRINT_TIME ALOGV #define componentName "video_decoder.avc" #define codingType OMX_VIDEO_CodingAVC #define CODEC_MIME_TYPE MEDIA_MIMETYPE_VIDEO_AVC Loading Loading @@ -78,7 +77,7 @@ SoftAVC::SoftAVC( 1 /* numMinInputBuffers */, kNumBuffers, INPUT_BUF_SIZE, 1 /* numMinOutputBuffers */, kNumBuffers, CODEC_MIME_TYPE); GETTIME(&mTimeStart, NULL); mTimeStart = mTimeEnd = systemTime(); // If input dump is enabled, then open create an empty file GENERATE_FILE_NAMES(); Loading Loading @@ -173,8 +172,7 @@ status_t SoftAVC::resetPlugin() { memset(mTimeStampsValid, 0, sizeof(mTimeStampsValid)); /* Initialize both start and end times */ gettimeofday(&mTimeStart, NULL); gettimeofday(&mTimeEnd, NULL); mTimeStart = mTimeEnd = systemTime(); return OK; } Loading Loading @@ -558,7 +556,7 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { { ivd_video_decode_ip_t s_dec_ip; ivd_video_decode_op_t s_dec_op; WORD32 timeDelay, timeTaken; nsecs_t timeDelay, timeTaken; size_t sizeY, sizeUV; if (!setDecodeArgs(&s_dec_ip, &s_dec_op, inHeader, outHeader, timeStampIx)) { Loading @@ -570,10 +568,10 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { // If input dump is enabled, then write to file DUMP_TO_FILE(mInFile, s_dec_ip.pv_stream_buffer, s_dec_ip.u4_num_Bytes, mInputOffset); GETTIME(&mTimeStart, NULL); mTimeStart = systemTime(); /* Compute time elapsed between end of previous decode() * to start of current decode() */ TIME_DIFF(mTimeEnd, mTimeStart, timeDelay); timeDelay = mTimeStart - mTimeEnd; IV_API_CALL_STATUS_T status; status = ivdec_api_function(mCodecCtx, (void *)&s_dec_ip, (void *)&s_dec_op); Loading Loading @@ -601,11 +599,12 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { getVUIParams(); GETTIME(&mTimeEnd, NULL); mTimeEnd = systemTime(); /* Compute time taken for decode() */ TIME_DIFF(mTimeStart, mTimeEnd, timeTaken); timeTaken = mTimeEnd - mTimeStart; PRINT_TIME("timeTaken=%6d delay=%6d numBytes=%6d", timeTaken, timeDelay, ALOGV("timeTaken=%6lldus delay=%6lldus numBytes=%6d", (long long) (timeTaken / 1000ll), (long long) (timeDelay / 1000ll), s_dec_op.u4_num_bytes_consumed); if (s_dec_op.u4_frame_decoded_flag && !mFlushNeeded) { mFlushNeeded = true; Loading media/libstagefright/codecs/avcdec/SoftAVCDec.h +4 −13 Original line number Diff line number Diff line Loading @@ -41,14 +41,6 @@ namespace android { /** Used to remove warnings about unused parameters */ #define UNUSED(x) ((void)(x)) /** Get time */ #define GETTIME(a, b) gettimeofday(a, b); /** Compute difference between start and end */ #define TIME_DIFF(start, end, diff) \ diff = (((end).tv_sec - (start).tv_sec) * 1000000) + \ ((end).tv_usec - (start).tv_usec); struct SoftAVC : public SoftVideoDecoderOMXComponent { SoftAVC(const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component); Loading @@ -70,8 +62,8 @@ private: size_t mNumCores; // Number of cores to be uesd by the codec struct timeval mTimeStart; // Time at the start of decode() struct timeval mTimeEnd; // Time at the end of decode() nsecs_t mTimeStart; // Time at the start of decode() nsecs_t mTimeEnd; // Time at the end of decode() // Internal buffer to be used to flush out the buffers from decoder uint8_t *mFlushOutBuffer; Loading Loading @@ -129,10 +121,9 @@ private: #define INPUT_DUMP_EXT "h264" #define GENERATE_FILE_NAMES() { \ GETTIME(&mTimeStart, NULL); \ strcpy(mInFile, ""); \ sprintf(mInFile, "%s_%ld.%ld.%s", INPUT_DUMP_PATH, \ mTimeStart.tv_sec, mTimeStart.tv_usec, \ sprintf(mInFile, "%s_%lld.%s", INPUT_DUMP_PATH, \ (long long) mTimeStart, \ INPUT_DUMP_EXT); \ } Loading Loading
media/libstagefright/codecs/avcdec/SoftAVCDec.cpp +10 −11 Original line number Diff line number Diff line Loading @@ -27,11 +27,10 @@ #include <media/stagefright/foundation/ADebug.h> #include <media/stagefright/MediaDefs.h> #include <OMX_VideoExt.h> #include <inttypes.h> namespace android { #define PRINT_TIME ALOGV #define componentName "video_decoder.avc" #define codingType OMX_VIDEO_CodingAVC #define CODEC_MIME_TYPE MEDIA_MIMETYPE_VIDEO_AVC Loading Loading @@ -78,7 +77,7 @@ SoftAVC::SoftAVC( 1 /* numMinInputBuffers */, kNumBuffers, INPUT_BUF_SIZE, 1 /* numMinOutputBuffers */, kNumBuffers, CODEC_MIME_TYPE); GETTIME(&mTimeStart, NULL); mTimeStart = mTimeEnd = systemTime(); // If input dump is enabled, then open create an empty file GENERATE_FILE_NAMES(); Loading Loading @@ -173,8 +172,7 @@ status_t SoftAVC::resetPlugin() { memset(mTimeStampsValid, 0, sizeof(mTimeStampsValid)); /* Initialize both start and end times */ gettimeofday(&mTimeStart, NULL); gettimeofday(&mTimeEnd, NULL); mTimeStart = mTimeEnd = systemTime(); return OK; } Loading Loading @@ -558,7 +556,7 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { { ivd_video_decode_ip_t s_dec_ip; ivd_video_decode_op_t s_dec_op; WORD32 timeDelay, timeTaken; nsecs_t timeDelay, timeTaken; size_t sizeY, sizeUV; if (!setDecodeArgs(&s_dec_ip, &s_dec_op, inHeader, outHeader, timeStampIx)) { Loading @@ -570,10 +568,10 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { // If input dump is enabled, then write to file DUMP_TO_FILE(mInFile, s_dec_ip.pv_stream_buffer, s_dec_ip.u4_num_Bytes, mInputOffset); GETTIME(&mTimeStart, NULL); mTimeStart = systemTime(); /* Compute time elapsed between end of previous decode() * to start of current decode() */ TIME_DIFF(mTimeEnd, mTimeStart, timeDelay); timeDelay = mTimeStart - mTimeEnd; IV_API_CALL_STATUS_T status; status = ivdec_api_function(mCodecCtx, (void *)&s_dec_ip, (void *)&s_dec_op); Loading Loading @@ -601,11 +599,12 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { getVUIParams(); GETTIME(&mTimeEnd, NULL); mTimeEnd = systemTime(); /* Compute time taken for decode() */ TIME_DIFF(mTimeStart, mTimeEnd, timeTaken); timeTaken = mTimeEnd - mTimeStart; PRINT_TIME("timeTaken=%6d delay=%6d numBytes=%6d", timeTaken, timeDelay, ALOGV("timeTaken=%6lldus delay=%6lldus numBytes=%6d", (long long) (timeTaken / 1000ll), (long long) (timeDelay / 1000ll), s_dec_op.u4_num_bytes_consumed); if (s_dec_op.u4_frame_decoded_flag && !mFlushNeeded) { mFlushNeeded = true; Loading
media/libstagefright/codecs/avcdec/SoftAVCDec.h +4 −13 Original line number Diff line number Diff line Loading @@ -41,14 +41,6 @@ namespace android { /** Used to remove warnings about unused parameters */ #define UNUSED(x) ((void)(x)) /** Get time */ #define GETTIME(a, b) gettimeofday(a, b); /** Compute difference between start and end */ #define TIME_DIFF(start, end, diff) \ diff = (((end).tv_sec - (start).tv_sec) * 1000000) + \ ((end).tv_usec - (start).tv_usec); struct SoftAVC : public SoftVideoDecoderOMXComponent { SoftAVC(const char *name, const OMX_CALLBACKTYPE *callbacks, OMX_PTR appData, OMX_COMPONENTTYPE **component); Loading @@ -70,8 +62,8 @@ private: size_t mNumCores; // Number of cores to be uesd by the codec struct timeval mTimeStart; // Time at the start of decode() struct timeval mTimeEnd; // Time at the end of decode() nsecs_t mTimeStart; // Time at the start of decode() nsecs_t mTimeEnd; // Time at the end of decode() // Internal buffer to be used to flush out the buffers from decoder uint8_t *mFlushOutBuffer; Loading Loading @@ -129,10 +121,9 @@ private: #define INPUT_DUMP_EXT "h264" #define GENERATE_FILE_NAMES() { \ GETTIME(&mTimeStart, NULL); \ strcpy(mInFile, ""); \ sprintf(mInFile, "%s_%ld.%ld.%s", INPUT_DUMP_PATH, \ mTimeStart.tv_sec, mTimeStart.tv_usec, \ sprintf(mInFile, "%s_%lld.%s", INPUT_DUMP_PATH, \ (long long) mTimeStart, \ INPUT_DUMP_EXT); \ } Loading