diff options
author | Andreas Huber <andih@google.com> | 2009-12-16 09:30:55 -0800 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2009-12-17 09:28:15 -0800 |
commit | 134ee6a324c35f39e3576172e4eae4c6de6eb9dc (patch) | |
tree | c402e0b47b926a0ed1bfee9fa2ef16822a19dd45 /media/libstagefright/OMXCodec.cpp | |
parent | 8ae1d0bdcef22f2bdd8d283e0e615f3ba6c3f4cd (diff) | |
download | frameworks_av-134ee6a324c35f39e3576172e4eae4c6de6eb9dc.zip frameworks_av-134ee6a324c35f39e3576172e4eae4c6de6eb9dc.tar.gz frameworks_av-134ee6a324c35f39e3576172e4eae4c6de6eb9dc.tar.bz2 |
Squashed commit of the following:
commit 144b1c40e9cf08a584c50e1bef7ba3f287e81a4f
Author: Andreas Huber <andih@google.com>
Date: Wed Dec 16 09:28:23 2009 -0800
This H264 file shows a certain problem even better.
commit 3245f1f3b7471975aeeb824a756c987abd610f55
Author: Andreas Huber <andih@google.com>
Date: Wed Dec 16 09:20:08 2009 -0800
Using only the QA testfiles now.
commit 074817eb3816c5dd70858a3594e3b92d799d873b
Author: Andreas Huber <andih@google.com>
Date: Tue Dec 15 16:17:39 2009 -0800
Yay, roles are back again now that the API is in place.
commit 6d847e4932cc38301ae27cb7283b7f1553a95457
Author: Andreas Huber <andih@google.com>
Date: Tue Dec 15 13:01:20 2009 -0800
Added commandline option for specifying the random seed for reproducable tests.
commit 62ab37b26336eaa67e49791c41c996acb6acee3f
Author: Andreas Huber <andih@google.com>
Date: Mon Dec 14 10:53:27 2009 -0800
When issuing a seek it is important that only the first MediaSource::read call has the seek option.
commit e77c46644b2fb6862bafa3569f7d304252074f1e
Author: Andreas Huber <andih@google.com>
Date: Mon Dec 7 16:39:07 2009 -0800
Make sure the tests are actually built, sp<OMXCodec> becomes sp<MediaSource>
commit 6df56915bd55a9445b3c6f953d3cc251d81579b8
Author: Andreas Huber <andih@google.com>
Date: Thu Dec 3 14:25:36 2009 -0800
Temporarily disable support for querying the roles of OMX components.
commit 31bb26930df9e3658dea684cedb4b0f1a06a4a88
Author: Andreas Huber <andih@google.com>
Date: Tue Dec 1 13:36:52 2009 -0800
Disregard EOS events, slightly change the way the EOS flag on output buffers is handled.
commit 4c382fbc9aebee8197d5988d04378062809e7c48
Author: Andreas Huber <andih@google.com>
Date: Tue Dec 1 09:37:24 2009 -0800
New random seek test for the codec tests. Fixed "sticky" end-of-output-buffers flag behaviour in OMXCodec.
commit c762eac3e44309592b61a168d66e091cf609fa03
Author: Andreas Huber <andih@google.com>
Date: Tue Nov 3 14:13:43 2009 -0800
Fix a typo.
commit 50540a59b65c7d476b0193c7494cd75895e6ca6d
Author: Andreas Huber <andih@google.com>
Date: Tue Nov 3 09:48:35 2009 -0800
Some more fine tuning of the unit tests, make MPEG4Extractor less verbose.
commit 1157a7e52a0636706caa235abe16d2ff8a0b8140
Author: Andreas Huber <andih@google.com>
Date: Wed Oct 28 12:01:01 2009 -0700
Changes to the IOMX::listNodes API, this now returns the component's roles as well, unit tests now test all components in all supported roles by default.
commit 30fbf2d8c6cb927689f7ba75eb550a81e9df488a
Author: Andreas Huber <andih@google.com>
Date: Mon Oct 26 09:45:26 2009 -0700
Initial check-in of unit tests for OMX components.
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rw-r--r-- | media/libstagefright/OMXCodec.cpp | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index 99c39f8..47bbda3 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -425,14 +425,9 @@ sp<MediaSource> OMXCodec::Create( esds.getCodecSpecificInfo( &codec_specific_data, &codec_specific_data_size); - printf("found codec-specific data of size %d\n", - codec_specific_data_size); - codec->addCodecSpecificData( codec_specific_data, codec_specific_data_size); } else if (meta->findData(kKeyAVCC, &type, &data, &size)) { - printf("found avcc of size %d\n", size); - // Parse the AVCDecoderConfigurationRecord const uint8_t *ptr = (const uint8_t *)data; @@ -1223,7 +1218,7 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { portIndex == kPortIndexInput ? "input" : "output"); } - dumpPortStatus(portIndex); + // dumpPortStatus(portIndex); return OK; } @@ -1273,7 +1268,6 @@ void OMXCodec::on_message(const omx_message &msg) { CHECK_EQ(mPortStatus[kPortIndexInput], ENABLED); drainInputBuffer(&buffers->editItemAt(i)); } - break; } @@ -1282,12 +1276,10 @@ void OMXCodec::on_message(const omx_message &msg) { IOMX::buffer_id buffer = msg.u.extended_buffer_data.buffer; OMX_U32 flags = msg.u.extended_buffer_data.flags; - CODEC_LOGV("FILL_BUFFER_DONE(buffer: %p, size: %ld, flags: 0x%08lx)", + CODEC_LOGV("FILL_BUFFER_DONE(buffer: %p, size: %ld, flags: 0x%08lx, timestamp: %lld us (%.2f secs))", buffer, msg.u.extended_buffer_data.range_length, - flags); - - CODEC_LOGV("FILL_BUFFER_DONE(timestamp: %lld us (%.2f secs))", + flags, msg.u.extended_buffer_data.timestamp, msg.u.extended_buffer_data.timestamp / 1E6); @@ -1315,11 +1307,13 @@ void OMXCodec::on_message(const omx_message &msg) { CHECK_EQ(err, OK); buffers->removeAt(i); +#if 0 } else if (mPortStatus[kPortIndexOutput] == ENABLED && (flags & OMX_BUFFERFLAG_EOS)) { CODEC_LOGV("No more output data."); mNoMoreOutputData = true; mBufferFilled.signal(); +#endif } else if (mPortStatus[kPortIndexOutput] != SHUTTING_DOWN) { CHECK_EQ(mPortStatus[kPortIndexOutput], ENABLED); @@ -1351,6 +1345,11 @@ void OMXCodec::on_message(const omx_message &msg) { mFilledBuffers.push_back(i); mBufferFilled.signal(); + + if (msg.u.extended_buffer_data.flags & OMX_BUFFERFLAG_EOS) { + CODEC_LOGV("No more output data."); + mNoMoreOutputData = true; + } } break; @@ -1374,7 +1373,7 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { case OMX_EventError: { - LOGE("ERROR(%ld, %ld)", data1, data2); + LOGE("ERROR(0x%08lx, %ld)", data1, data2); setState(ERROR); break; @@ -1386,6 +1385,7 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { break; } +#if 0 case OMX_EventBufferFlag: { CODEC_LOGV("EVENT_BUFFER_FLAG(%ld)", data1); @@ -1395,6 +1395,7 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) { } break; } +#endif default: { @@ -1565,13 +1566,6 @@ void OMXCodec::onCmdComplete(OMX_COMMANDTYPE cmd, OMX_U32 data) { CODEC_LOGV("Finished flushing both ports, now continuing from" " seek-time."); - // Clear this flag in case the decoder sent us either - // the EVENT_BUFFER_FLAG(1) or an output buffer with - // the EOS flag set _while_ flushing. Since we're going - // to submit "fresh" input data now, this flag no longer - // applies to our future. - mNoMoreOutputData = false; - drainInputBuffers(); fillOutputBuffers(); } @@ -1832,6 +1826,8 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) { memcpy(info->mMem->pointer(), specific->mData, specific->mSize); } + mNoMoreOutputData = false; + status_t err = mOMX->emptyBuffer( mNode, info->mBuffer, 0, size, OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_CODECCONFIG, @@ -1849,7 +1845,9 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) { if (mSeekTimeUs >= 0) { MediaSource::ReadOptions options; options.setSeekTo(mSeekTimeUs); + mSeekTimeUs = -1; + mBufferFilled.signal(); err = mSource->read(&srcBuffer, &options); } else { @@ -1866,6 +1864,8 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) { mSignalledEOS = true; } else { + mNoMoreOutputData = false; + srcLength = srcBuffer->range_length(); if (info->mMem->size() < srcLength) { @@ -1878,10 +1878,10 @@ void OMXCodec::drainInputBuffer(BufferInfo *info) { srcLength); if (srcBuffer->meta_data()->findInt64(kKeyTime, ×tampUs)) { - CODEC_LOGV("Calling emptyBuffer on buffer %p (length %d)", - info->mBuffer, srcLength); - CODEC_LOGV("Calling emptyBuffer with timestamp %lld us (%.2f secs)", - timestampUs, timestampUs / 1E6); + CODEC_LOGV("Calling emptyBuffer on buffer %p (length %d), " + "timestamp %lld us (%.2f secs)", + info->mBuffer, srcLength, + timestampUs, timestampUs / 1E6); } } @@ -2298,7 +2298,6 @@ status_t OMXCodec::read( CODEC_LOGV("seeking to %lld us (%.2f secs)", seekTimeUs, seekTimeUs / 1E6); mSignalledEOS = false; - mNoMoreOutputData = false; CHECK(seekTimeUs >= 0); mSeekTimeUs = seekTimeUs; @@ -2317,6 +2316,10 @@ status_t OMXCodec::read( if (emulateOutputFlushCompletion) { onCmdComplete(OMX_CommandFlush, kPortIndexOutput); } + + while (mSeekTimeUs >= 0) { + mBufferFilled.wait(mLock); + } } while (mState != ERROR && !mNoMoreOutputData && mFilledBuffers.empty()) { |