diff options
author | Pannag Sanketi <psanketi@google.com> | 2011-07-14 14:37:47 -0700 |
---|---|---|
committer | Pannag Sanketi <psanketi@google.com> | 2011-07-22 19:33:55 -0700 |
commit | b1f8c266e47554bc45632f021c9e409399e907e7 (patch) | |
tree | 5d0633fe15e687d9946195352fa106e4f3fe3ce5 /include/media | |
parent | 897e27bc75886e44d2f9f09155127f401c4173ea (diff) | |
download | frameworks_base-b1f8c266e47554bc45632f021c9e409399e907e7.zip frameworks_base-b1f8c266e47554bc45632f021c9e409399e907e7.tar.gz frameworks_base-b1f8c266e47554bc45632f021c9e409399e907e7.tar.bz2 |
Adding Metadata mode to SurfaceMediaSource
SurfaceMediaSource operates in metadata mode only, i.e. just the
metadata is stored in videobuffers. SurfaceMediaSource passes the Gralloc
buffer handle along with a 4 byte 'type' (indicating that the metadata
is of type GrallocSource) to the encoder as opposed to the
GrallocBuffer itself.
Related to bug id: 4529323
Change-Id: I83aebc0dd10f317658cdf70be5802dfc35a1e72d
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/stagefright/MetadataBufferType.h | 10 | ||||
-rw-r--r-- | include/media/stagefright/SurfaceMediaSource.h | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/include/media/stagefright/MetadataBufferType.h b/include/media/stagefright/MetadataBufferType.h index 52a3257..4eaf8ac 100644 --- a/include/media/stagefright/MetadataBufferType.h +++ b/include/media/stagefright/MetadataBufferType.h @@ -69,6 +69,16 @@ typedef enum { * kMetadataBufferTypeGrallocSource is used to indicate that * the payload of the metadata buffers can be interpreted as * a buffer_handle_t. + * So in this case,the metadata that the encoder receives + * will have a byte stream that consists of two parts: + * 1. First, there is an integer indicating that it is a GRAlloc + * source (kMetadataBufferTypeGrallocSource) + * 2. This is followed by the buffer_handle_t that is a handle to the + * GRalloc buffer. The encoder needs to interpret this GRalloc handle + * and encode the frames. + * -------------------------------------------------------------- + * | kMetadataBufferTypeGrallocSource | sizeof(buffer_handle_t) | + * -------------------------------------------------------------- */ kMetadataBufferTypeGrallocSource = 1, diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h index d772701..4c1358a 100644 --- a/include/media/stagefright/SurfaceMediaSource.h +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -63,6 +63,10 @@ public: MediaBuffer **buffer, const ReadOptions *options = NULL); virtual sp<MetaData> getFormat(); + // Pass the metadata over to the buffer, call when you have the lock + void passMetadataBufferLocked(MediaBuffer **buffer); + bool checkBufferMatchesSlot(int slot, MediaBuffer *buffer); + // Get / Set the frame rate used for encoding. Default fps = 30 status_t setFrameRate(int32_t fps) ; int32_t getFrameRate( ) const; @@ -152,7 +156,7 @@ public: status_t setBufferCountServer(int bufferCount); // getTimestamp retrieves the timestamp associated with the image - // set by the most recent call to updateFrameInfoLocked(). + // set by the most recent call to read() // // The timestamp is in nanoseconds, and is monotonically increasing. Its // other semantics (zero point, etc) are source-dependent and should be |