summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2013-05-15 16:48:19 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-16 19:56:09 +0000
commit324143b1531328bc4e53c6cbd962c9a457d73707 (patch)
tree4b8748c83c157f87ebd2ec3d6ca52e13d5658ffe /media/libstagefright/omx
parentdd90e8b5a200829cae68fa1a95eb1e3ed09583cf (diff)
downloadframeworks_av-324143b1531328bc4e53c6cbd962c9a457d73707.zip
frameworks_av-324143b1531328bc4e53c6cbd962c9a457d73707.tar.gz
frameworks_av-324143b1531328bc4e53c6cbd962c9a457d73707.tar.bz2
Adjust timestamp scale
BufferQueue item timestamps are in nanoseconds, MediaCodec buffer timestamps are in microseconds. Adjust. Bug 8988357 Change-Id: Ib12824d7eea0316a14543c756e3a127c0866db6b
Diffstat (limited to 'media/libstagefright/omx')
-rw-r--r--media/libstagefright/omx/GraphicBufferSource.cpp6
-rw-r--r--media/libstagefright/omx/GraphicBufferSource.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/media/libstagefright/omx/GraphicBufferSource.cpp b/media/libstagefright/omx/GraphicBufferSource.cpp
index 3854e52..45a70e7 100644
--- a/media/libstagefright/omx/GraphicBufferSource.cpp
+++ b/media/libstagefright/omx/GraphicBufferSource.cpp
@@ -288,7 +288,7 @@ bool GraphicBufferSource::fillCodecBuffer_l() {
mBufferSlot[item.mBuf] = item.mGraphicBuffer;
}
- err = submitBuffer_l(mBufferSlot[item.mBuf], item.mTimestamp, cbi);
+ err = submitBuffer_l(mBufferSlot[item.mBuf], item.mTimestamp / 1000, cbi);
if (err != OK) {
ALOGV("submitBuffer_l failed, releasing bq buf %d", item.mBuf);
mBufferQueue->releaseBuffer(item.mBuf, EGL_NO_DISPLAY,
@@ -328,7 +328,7 @@ status_t GraphicBufferSource::signalEndOfInputStream() {
}
status_t GraphicBufferSource::submitBuffer_l(sp<GraphicBuffer>& graphicBuffer,
- int64_t timestamp, int cbi) {
+ int64_t timestampUsec, int cbi) {
ALOGV("submitBuffer_l cbi=%d", cbi);
CodecBuffer& codecBuffer(mCodecBuffers.editItemAt(cbi));
codecBuffer.mGraphicBuffer = graphicBuffer;
@@ -343,7 +343,7 @@ status_t GraphicBufferSource::submitBuffer_l(sp<GraphicBuffer>& graphicBuffer,
status_t err = mNodeInstance->emptyDirectBuffer(header, 0,
4 + sizeof(buffer_handle_t), OMX_BUFFERFLAG_ENDOFFRAME,
- timestamp);
+ timestampUsec);
if (err != OK) {
ALOGW("WARNING: emptyDirectBuffer failed: 0x%x", err);
codecBuffer.mGraphicBuffer = NULL;
diff --git a/media/libstagefright/omx/GraphicBufferSource.h b/media/libstagefright/omx/GraphicBufferSource.h
index 7f1f22e..562d342 100644
--- a/media/libstagefright/omx/GraphicBufferSource.h
+++ b/media/libstagefright/omx/GraphicBufferSource.h
@@ -131,7 +131,7 @@ private:
// Marks the mCodecBuffers entry as in-use, copies the GraphicBuffer
// reference into the codec buffer, and submits the data to the codec.
status_t submitBuffer_l(sp<GraphicBuffer>& graphicBuffer,
- int64_t timestamp, int cbi);
+ int64_t timestampUsec, int cbi);
// Submits an empty buffer, with the EOS flag set. Returns without
// doing anything if we don't have a codec buffer available.