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

Commit e175e5cc authored by Jayant Chowdhary's avatar Jayant Chowdhary Committed by Automerger Merge Worker
Browse files

Merge "android_media_Utils: update camera_jpeg_blob definition to match aidl."...

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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17915803



Change-Id: I10df57e38c3f9f343d9dc1d9a13a2341ac681020
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 41afd589 dc95eae4
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_