Merge "Camera: use framework header for VideoNativeHandleMetadata" into oc-dev

This commit is contained in:
TreeHugger Robot 2017-04-28 08:01:49 +00:00 committed by Android (Google) Code Review
commit d4fc468392
3 changed files with 6 additions and 13 deletions

View file

@ -27,6 +27,9 @@ cc_library_shared {
static_libs: [
"android.hardware.camera.common@1.0-helper"
],
include_dirs: [
"frameworks/native/include/media/openmax"
],
export_include_dirs: ["."]
}

View file

@ -21,6 +21,7 @@
#include <log/log.h>
#include <utils/Trace.h>
#include <media/hardware/HardwareAPI.h> // For VideoNativeHandleMetadata
#include "CameraDevice_1_0.h"
namespace android {
@ -500,7 +501,7 @@ void CameraDevice::sDataCbTimestamp(nsecs_t timestamp, int32_t msg_type,
if (mem->mBufSize == sizeof(VideoNativeHandleMetadata)) {
VideoNativeHandleMetadata* md = (VideoNativeHandleMetadata*)
((uint8_t*) mem->mHidlHeapMemData + index * mem->mBufSize);
if (md->eType == VideoNativeHandleMetadata::kMetadataBufferTypeNativeHandleSource) {
if (md->eType == kMetadataBufferTypeNativeHandleSource) {
handle = md->pHandle;
}
}
@ -837,7 +838,7 @@ void CameraDevice::releaseRecordingFrameLocked(
void *data = ((uint8_t *) camMemory->mHidlHeapMemData) + bufferIndex * camMemory->mBufSize;
if (handle) {
VideoNativeHandleMetadata* md = (VideoNativeHandleMetadata*) data;
if (md->eType == VideoNativeHandleMetadata::kMetadataBufferTypeNativeHandleSource) {
if (md->eType == kMetadataBufferTypeNativeHandleSource) {
// Input handle will be closed by HIDL transport later, so clone it
// HAL implementation is responsible to close/delete the clone
native_handle_t* clone = native_handle_clone(handle);

View file

@ -133,17 +133,6 @@ private:
};
sp<IAllocator> mAshmemAllocator;
// TODO: b/35625849
// Meta data buffer layout for passing a native_handle to codec
// matching frameworks/native/include/media/hardware/MetadataBufferType.h and
// frameworks/native/include/media/hardware/HardwareAPI.h
struct VideoNativeHandleMetadata {
static const uint32_t kMetadataBufferTypeNativeHandleSource = 3;
uint32_t eType; // must be kMetadataBufferTypeNativeHandleSource
native_handle_t* pHandle;
};
const sp<CameraModule> mModule;
const std::string mCameraId;
// const after ctor