diff options
author | James Dong <jdong@google.com> | 2010-10-20 17:38:41 -0700 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-10-21 14:06:17 -0700 |
commit | 387e38dd87ae9c04ef79ebe06ea798762916ff5c (patch) | |
tree | 225fb403082a511eb43ad1d4c799bc2689ffbbe3 /media/libstagefright/omx | |
parent | cf8918874dc446f34bbc2a93a6b20235c30a7645 (diff) | |
download | frameworks_base-387e38dd87ae9c04ef79ebe06ea798762916ff5c.zip frameworks_base-387e38dd87ae9c04ef79ebe06ea798762916ff5c.tar.gz frameworks_base-387e38dd87ae9c04ef79ebe06ea798762916ff5c.tar.bz2 |
OMX extension to support storing meta data in video input buffers during recording
bug - 3042125
Change-Id: I7543809fa4ff61d48da35eec6c2bd5eaa7e8cead
Diffstat (limited to 'media/libstagefright/omx')
-rw-r--r-- | media/libstagefright/omx/OMX.cpp | 5 | ||||
-rw-r--r-- | media/libstagefright/omx/OMXNodeInstance.cpp | 31 |
2 files changed, 36 insertions, 0 deletions
diff --git a/media/libstagefright/omx/OMX.cpp b/media/libstagefright/omx/OMX.cpp index d89f54b..f9f638f 100644 --- a/media/libstagefright/omx/OMX.cpp +++ b/media/libstagefright/omx/OMX.cpp @@ -294,6 +294,11 @@ status_t OMX::enableGraphicBuffers( return findInstance(node)->enableGraphicBuffers(port_index, enable); } +status_t OMX::storeMetaDataInBuffers( + node_id node, OMX_U32 port_index, OMX_BOOL enable) { + return findInstance(node)->storeMetaDataInBuffers(port_index, enable); +} + status_t OMX::useBuffer( node_id node, OMX_U32 port_index, const sp<IMemory> ¶ms, buffer_id *buffer) { diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp index ba4d765..9b6d441 100644 --- a/media/libstagefright/omx/OMXNodeInstance.cpp +++ b/media/libstagefright/omx/OMXNodeInstance.cpp @@ -284,6 +284,37 @@ status_t OMXNodeInstance::enableGraphicBuffers( return OK; } +status_t OMXNodeInstance::storeMetaDataInBuffers( + OMX_U32 portIndex, + OMX_BOOL enable) { + Mutex::Autolock autolock(mLock); + + OMX_INDEXTYPE index; + OMX_STRING name = const_cast<OMX_STRING>( + "OMX.google.android.index.storeMetaDataInBuffers"); + + OMX_ERRORTYPE err = OMX_GetExtensionIndex(mHandle, name, &index); + if (err != OMX_ErrorNone) { + LOGE("OMX_GetExtensionIndex %s failed", name); + return StatusFromOMXError(err); + } + + StoreMetaDataInBuffersParams params; + memset(¶ms, 0, sizeof(params)); + params.nSize = sizeof(params); + + // Version: 1.0.0.0 + params.nVersion.s.nVersionMajor = 1; + + params.nPortIndex = portIndex; + params.bStoreMetaData = enable; + if ((err = OMX_SetParameter(mHandle, index, ¶ms)) != OMX_ErrorNone) { + LOGE("OMX_SetParameter() failed for StoreMetaDataInBuffers: 0x%08x", err); + return UNKNOWN_ERROR; + } + return err; +} + status_t OMXNodeInstance::useBuffer( OMX_U32 portIndex, const sp<IMemory> ¶ms, OMX::buffer_id *buffer) { |