Merge "android_media_Utils: update camera_jpeg_blob definition to match aidl." into tm-dev

This commit is contained in:
Jayant Chowdhary
2022-05-12 04:16:57 +00:00
committed by Android (Google) Code Review
2 changed files with 17 additions and 3 deletions

View File

@@ -18,10 +18,10 @@
#define LOG_TAG "AndroidMediaUtils" #define LOG_TAG "AndroidMediaUtils"
#include <aidl/android/hardware/graphics/common/PlaneLayoutComponentType.h> #include <aidl/android/hardware/graphics/common/PlaneLayoutComponentType.h>
#include <hardware/camera3.h>
#include <ui/GraphicBufferMapper.h> #include <ui/GraphicBufferMapper.h>
#include <ui/GraphicTypes.h> #include <ui/GraphicTypes.h>
#include <utils/Log.h> #include <utils/Log.h>
#include "android_media_Utils.h" #include "android_media_Utils.h"
#define ALIGN(x, mask) ( ((x) + (mask) - 1) & ~((mask) - 1) ) #define ALIGN(x, mask) ( ((x) + (mask) - 1) & ~((mask) - 1) )
@@ -122,8 +122,8 @@ uint32_t Image_getBlobSize(LockedImage* buffer, bool usingRGBAOverride) {
} }
// First check for BLOB transport header at the end of the buffer // First check for BLOB transport header at the end of the buffer
uint8_t* header = blobBuffer + (width - sizeof(struct camera3_jpeg_blob)); uint8_t* header = blobBuffer + (width - sizeof(struct camera3_jpeg_blob_v2));
struct camera3_jpeg_blob *blob = (struct camera3_jpeg_blob*)(header); struct camera3_jpeg_blob_v2 *blob = (struct camera3_jpeg_blob_v2*)(header);
if (blob->jpeg_blob_id == CAMERA3_JPEG_BLOB_ID || if (blob->jpeg_blob_id == CAMERA3_JPEG_BLOB_ID ||
blob->jpeg_blob_id == CAMERA3_HEIC_BLOB_ID) { blob->jpeg_blob_id == CAMERA3_HEIC_BLOB_ID) {
size = blob->jpeg_size; size = blob->jpeg_size;

View File

@@ -50,6 +50,20 @@ int getBufferWidth(BufferItem *buffer);
int getBufferHeight(BufferItem *buffer); int getBufferHeight(BufferItem *buffer);
// Must be in sync with AIDL CameraBlob : android.hardware.camera.device.CameraBlob
// HALs must NOT copy this definition.
// for details: http://b/229688810
typedef struct camera3_jpeg_blob_v2 {
uint32_t jpeg_blob_id;
uint32_t jpeg_size;
} camera3_jpeg_blobv2_t;
// Must be in sync with AIDL CameraBlob : android.hardware.camera.device.CameraBlobId
enum {
CAMERA3_JPEG_BLOB_ID = 0x00FF,
CAMERA3_JPEG_APP_SEGMENTS_BLOB_ID = 0x0100,
};
}; // namespace android }; // namespace android
#endif // _ANDROID_MEDIA_UTILS_H_ #endif // _ANDROID_MEDIA_UTILS_H_