summaryrefslogtreecommitdiff
path: root/libstagefrighthw
diff options
context:
space:
mode:
authorPraveen Chavan <pchavan@codeaurora.org>2016-04-19 04:26:34 -0700
committerPraveen Chavan <pchavan@codeaurora.org>2016-04-20 17:50:56 -0700
commitf7dfb07236cf8014403879dd0fbec6939ace211b (patch)
tree3d56ca9d31a9fe9153c7cc1ecc70ed0f9dd82546 /libstagefrighthw
parent4aa9bda6ee7ce1e783fd03fd0b42b676d7e6ded3 (diff)
downloadmedia-f7dfb07236cf8014403879dd0fbec6939ace211b.tar.gz
mm-video-v4l2: venc: update metadata-type used for HAL1 based recording
Update metadata buffer type from kMetadataBufferTypeCameraSource to kMetadataBufferTypeNativeHandleSource as the latter is used by camera-HALv1 that resides in a separate process. Surface recording uses a different metadata as compared to legacy camera metadata (HAL1). Cast the gralloc-meta to appropriate struct to extract the handle Since buffer-size is not known conclusively at the allocation time of meta-handles, allow the least size to be allocated. But check the buffer size before accessing in ETB Bug: 26268807 Change-Id: I2cb40889517b4d740763bbde09e2fa4646b919e1
Diffstat (limited to 'libstagefrighthw')
-rw-r--r--libstagefrighthw/Android.mk4
-rw-r--r--libstagefrighthw/QComOMXMetadata.h10
2 files changed, 14 insertions, 0 deletions
diff --git a/libstagefrighthw/Android.mk b/libstagefrighthw/Android.mk
index 649ba8e3..2e6a94c1 100644
--- a/libstagefrighthw/Android.mk
+++ b/libstagefrighthw/Android.mk
@@ -34,6 +34,10 @@ ifeq ($(PLATFORM_SDK_VERSION), 18) #JB_MR2
LOCAL_CFLAGS += -DANDROID_JELLYBEAN_MR2=1
endif
+ifeq ($(TARGET_USES_MEDIA_EXTENSIONS),true)
+LOCAL_CFLAGS += -DUSE_NATIVE_HANDLE_SOURCE
+endif
+
LOCAL_C_INCLUDES:= \
frameworks/native/include/media/openmax \
$(TARGET_OUT_HEADERS)/mm-core/omxcore/ \
diff --git a/libstagefrighthw/QComOMXMetadata.h b/libstagefrighthw/QComOMXMetadata.h
index f03188ef..88b00db9 100644
--- a/libstagefrighthw/QComOMXMetadata.h
+++ b/libstagefrighthw/QComOMXMetadata.h
@@ -23,6 +23,16 @@
namespace android {
+#ifdef USE_NATIVE_HANDLE_SOURCE
+ typedef struct encoder_nativehandle_buffer_type {
+ MetadataBufferType buffer_type;
+ union {
+ buffer_handle_t meta_handle;
+ uint64_t padding;
+ };
+ } encoder_nativehandle_buffer_type;
+#endif
+
typedef struct encoder_media_buffer_type {
MetadataBufferType buffer_type;
buffer_handle_t meta_handle;