android_media_Utils: update camera_jpeg_blob definition to match aidl.

- Also remove dependency on camera3.h header.

Bug: 229688810

Test: GCA (basic validity)
Test: DngCreatorTest#testRaw16JpegConsistency

Change-Id: I95e38adad3b6eeb71732d9cf9cb2c2c240b6b8bf
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
This commit is contained in:
Jayant Chowdhary
2022-04-22 17:44:59 +00:00
parent 375d7c417c
commit 0644a5f984
2 changed files with 17 additions and 3 deletions

View File

@@ -18,10 +18,10 @@
#define LOG_TAG "AndroidMediaUtils"
#include <aidl/android/hardware/graphics/common/PlaneLayoutComponentType.h>
#include <hardware/camera3.h>
#include <ui/GraphicBufferMapper.h>
#include <ui/GraphicTypes.h>
#include <utils/Log.h>
#include "android_media_Utils.h"
#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
uint8_t* header = blobBuffer + (width - sizeof(struct camera3_jpeg_blob));
struct camera3_jpeg_blob *blob = (struct camera3_jpeg_blob*)(header);
uint8_t* header = blobBuffer + (width - sizeof(struct camera3_jpeg_blob_v2));
struct camera3_jpeg_blob_v2 *blob = (struct camera3_jpeg_blob_v2*)(header);
if (blob->jpeg_blob_id == CAMERA3_JPEG_BLOB_ID ||
blob->jpeg_blob_id == CAMERA3_HEIC_BLOB_ID) {
size = blob->jpeg_size;

View File

@@ -50,6 +50,20 @@ int getBufferWidth(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
#endif // _ANDROID_MEDIA_UTILS_H_