summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2011-06-27 16:30:55 -0700
committerJames Dong <jdong@google.com>2011-06-28 17:35:02 -0700
commit32eea24fe93fd43e8078b1080db17304b27ed95a (patch)
treef39ec5198867e6c4e85601c7d58512afd1916505
parent0a932b40bdc8c427ff275426ee19960d8648021d (diff)
downloadframeworks_av-32eea24fe93fd43e8078b1080db17304b27ed95a.zip
frameworks_av-32eea24fe93fd43e8078b1080db17304b27ed95a.tar.gz
frameworks_av-32eea24fe93fd43e8078b1080db17304b27ed95a.tar.bz2
Add extended metadata buffer support by defining different types of metadata buffers
Change-Id: I6aa6b5da004c240c9986f6b9036950e234c8bd42
-rw-r--r--include/media/stagefright/MetadataBufferType.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/include/media/stagefright/MetadataBufferType.h b/include/media/stagefright/MetadataBufferType.h
new file mode 100644
index 0000000..275c19f
--- /dev/null
+++ b/include/media/stagefright/MetadataBufferType.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef METADATA_BUFFER_TYPE_H
+#define METADATA_BUFFER_TYPE_H
+
+namespace android {
+/*
+ * MetadataBufferType defines the type of the metadata buffers that
+ * can be passed to video encoder component for encoding, via Stagefright
+ * media recording framework. To see how to work with the metadata buffers
+ * in media recording framework, please consult HardwareAPI.h
+ *
+ * The creator of metadata buffers and video encoder share common knowledge
+ * on what is actually being stored in these metadata buffers, and
+ * how the information can be used by the video encoder component
+ * to locate the actual pixel data as the source input for video
+ * encoder, plus whatever other information that is necessary. Stagefright
+ * media recording framework does not need to know anything specific about the
+ * metadata buffers, except for receving each individual metadata buffer
+ * as the source input, making a copy of the metadata buffer, and passing the
+ * copy via OpenMAX API to the video encoder component.
+ *
+ * The creator of the metadata buffers must ensure that the first
+ * 4 bytes in every metadata buffer indicates its buffer type,
+ * and the rest of the metadata buffer contains the
+ * actual metadata information. When a video encoder component receives
+ * a metadata buffer, it uses the first 4 bytes in that buffer to find
+ * out the type of the metadata buffer, and takes action appropriate
+ * to that type of metadata buffers (for instance, locate the actual
+ * pixel data input and then encoding the input data to produce a
+ * compressed output buffer).
+ *
+ * The following shows the layout of a metadata buffer,
+ * where buffer type is a 4-byte field of MetadataBufferType,
+ * and the payload is the metadata information.
+ *
+ * --------------------------------------------------------------
+ * | buffer type | payload |
+ * --------------------------------------------------------------
+ *
+ */
+typedef enum {
+
+ /*
+ * kMetadataBufferTypeCameraSource is used to indicate that
+ * the source of the metadata buffer is the camera component.
+ */
+ kMetadataBufferTypeCameraSource = 0,
+
+ /*
+ * kMetadataBufferTypeGrallocSource is used to indicate that
+ * the payload of the metadata buffers can be interpreted as
+ * a buffer_handle_t.
+ */
+ kMetadataBufferTypeGrallocSource = 1,
+
+ // Add more here...
+
+} MetadataBufferType;
+
+} // namespace android
+
+#endif // METADATA_BUFFER_TYPE_H