summaryrefslogtreecommitdiffstats
path: root/include/media/IOMX.h
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-05-15 20:39:14 -0700
committerLajos Molnar <lajos@google.com>2015-06-01 20:24:26 -0700
commit054219874873b41f1c815552987c10465c34ba2b (patch)
treeb9aaf90692f68ed786880d7daf6ae4f2d2b6b9d7 /include/media/IOMX.h
parentcb18ec05b7097a63262b81afe1e866105d400f4a (diff)
downloadframeworks_av-054219874873b41f1c815552987c10465c34ba2b.zip
frameworks_av-054219874873b41f1c815552987c10465c34ba2b.tar.gz
frameworks_av-054219874873b41f1c815552987c10465c34ba2b.tar.bz2
stagefright: rework metadata buffer support
- Add fence to new metadata buffer mode structure, but don't use it yet, so that we don't have to add another mode soon. - Change GraphicBuffers to ANativeWindowBuffer in new metadata mode. This removes internal depencency from vendor codecs. - Extend new metadata mode from SW encoders to all codecs. - Fallback from new metadata mode to old mode (so Camera can always use the new mode even with legacy codecs) Related-bug: 19614055 Bug: 13222807 Change-Id: I405a21dd6ce8e99808f633bfeab8f14278eb7079
Diffstat (limited to 'include/media/IOMX.h')
-rw-r--r--include/media/IOMX.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/include/media/IOMX.h b/include/media/IOMX.h
index 46c363a..26cc73e 100644
--- a/include/media/IOMX.h
+++ b/include/media/IOMX.h
@@ -25,6 +25,8 @@
#include <utils/List.h>
#include <utils/String8.h>
+#include <media/hardware/MetadataBufferType.h>
+
#include <OMX_Core.h>
#include <OMX_Video.h>
@@ -81,8 +83,10 @@ public:
virtual status_t getState(
node_id node, OMX_STATETYPE* state) = 0;
+ // This will set *type to previous metadata buffer type on OMX error (not on binder error), and
+ // new metadata buffer type on success.
virtual status_t storeMetaDataInBuffers(
- node_id node, OMX_U32 port_index, OMX_BOOL enable) = 0;
+ node_id node, OMX_U32 port_index, OMX_BOOL enable, MetadataBufferType *type = NULL) = 0;
virtual status_t prepareForAdaptivePlayback(
node_id node, OMX_U32 portIndex, OMX_BOOL enable,
@@ -111,17 +115,23 @@ public:
node_id node, OMX_U32 port_index,
const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer) = 0;
+ // This will set *type to resulting metadata buffer type on OMX error (not on binder error) as
+ // well as on success.
virtual status_t createInputSurface(
node_id node, OMX_U32 port_index,
- sp<IGraphicBufferProducer> *bufferProducer) = 0;
+ sp<IGraphicBufferProducer> *bufferProducer,
+ MetadataBufferType *type = NULL) = 0;
virtual status_t createPersistentInputSurface(
sp<IGraphicBufferProducer> *bufferProducer,
sp<IGraphicBufferConsumer> *bufferConsumer) = 0;
+ // This will set *type to resulting metadata buffer type on OMX error (not on binder error) as
+ // well as on success.
virtual status_t setInputSurface(
node_id node, OMX_U32 port_index,
- const sp<IGraphicBufferConsumer> &bufferConsumer) = 0;
+ const sp<IGraphicBufferConsumer> &bufferConsumer,
+ MetadataBufferType *type) = 0;
virtual status_t signalEndOfInputStream(node_id node) = 0;
@@ -236,4 +246,15 @@ struct CodecProfileLevel {
} // namespace android
+inline static const char *asString(android::MetadataBufferType i, const char *def = "??") {
+ using namespace android;
+ switch (i) {
+ case kMetadataBufferTypeCameraSource: return "CameraSource";
+ case kMetadataBufferTypeGrallocSource: return "GrallocSource";
+ case kMetadataBufferTypeANWBuffer: return "ANWBuffer";
+ case kMetadataBufferTypeInvalid: return "Invalid";
+ default: return def;
+ }
+}
+
#endif // ANDROID_IOMX_H_