Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0644a5f9 authored by Jayant Chowdhary's avatar Jayant Chowdhary
Browse files

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: default avatarJayant Chowdhary <jchowdhary@google.com>
parent 375d7c41
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
+14 −0
Original line number Diff line number Diff line
@@ -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_