Camera: Fix passing video native handle for 64-bit app
Add new binder calls to pass video native handle so the video native
handle can be passed between 32-bit and 64-bit processes.
Remove problematic code that used IMemory to pass video native
handle because the sizes of VideoNativeMetadata are different in
32-bit and 64-bit processes.
Bug: 28403412
Change-Id: I3341b1812ecc41d61846bb72ca926ecb1674c9ec
diff --git a/include/camera/android/hardware/ICamera.h b/include/camera/android/hardware/ICamera.h
index 322b741..3b12afe 100644
--- a/include/camera/android/hardware/ICamera.h
+++ b/include/camera/android/hardware/ICamera.h
@@ -94,9 +94,13 @@
// get recording state
virtual bool recordingEnabled() = 0;
- // release a recording frame
+ // Release a recording frame that was received via ICameraClient::dataCallbackTimestamp.
virtual void releaseRecordingFrame(const sp<IMemory>& mem) = 0;
+ // Release a recording frame handle that was received via
+ // ICameraClient::recordingFrameHandleCallbackTimestamp.
+ virtual void releaseRecordingFrameHandle(native_handle_t *handle) = 0;
+
// auto focus
virtual status_t autoFocus() = 0;
diff --git a/include/camera/android/hardware/ICameraClient.h b/include/camera/android/hardware/ICameraClient.h
index d7f9a75..3f835a9 100644
--- a/include/camera/android/hardware/ICameraClient.h
+++ b/include/camera/android/hardware/ICameraClient.h
@@ -36,6 +36,11 @@
virtual void dataCallback(int32_t msgType, const sp<IMemory>& data,
camera_frame_metadata_t *metadata) = 0;
virtual void dataCallbackTimestamp(nsecs_t timestamp, int32_t msgType, const sp<IMemory>& data) = 0;
+
+ // Invoked to send a recording frame handle with a timestamp. Call
+ // ICamera::releaseRecordingFrameHandle to release the frame handle.
+ virtual void recordingFrameHandleCallbackTimestamp(nsecs_t timestamp,
+ native_handle_t* handle) = 0;
};
// ----------------------------------------------------------------------------