From 1e47be9a6084687f76027f0e227573f7fe44beed Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Thu, 10 Dec 2020 17:33:10 -0800 Subject: [PATCH] Add XMP offset/size to MediaMetadataRetriever bug: 159373092 test: local manual test that ExifInterface gets the XMP offset/size correctly Change-Id: I718a8819ea348b4268beaac3efbbe0cb428f1b01 --- core/api/module-lib-current.txt | 2 ++ .../android/media/MediaMetadataRetriever.java | 22 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index d83c0adb3ae13..75e8266ce26e6 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -80,6 +80,8 @@ package android.media { public class MediaMetadataRetriever implements java.lang.AutoCloseable { field public static final int METADATA_KEY_VIDEO_CODEC_MIME_TYPE = 40; // 0x28 + field public static final int METADATA_KEY_XMP_LENGTH = 42; // 0x2a + field public static final int METADATA_KEY_XMP_OFFSET = 41; // 0x29 } } diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java index 86d1d15c8b749..32a916838c002 100644 --- a/media/java/android/media/MediaMetadataRetriever.java +++ b/media/java/android/media/MediaMetadataRetriever.java @@ -1313,14 +1313,14 @@ public class MediaMetadataRetriever implements AutoCloseable { public static final int METADATA_KEY_VIDEO_FRAME_COUNT = 32; /** - * If the media contains EXIF data, this key retrieves the offset value + * If the media contains EXIF data, this key retrieves the offset (in bytes) * of the data. */ public static final int METADATA_KEY_EXIF_OFFSET = 33; /** - * If the media contains EXIF data, this key retrieves the length of the - * data. + * If the media contains EXIF data, this key retrieves the length (in bytes) + * of the data. */ public static final int METADATA_KEY_EXIF_LENGTH = 34; @@ -1371,5 +1371,21 @@ public class MediaMetadataRetriever implements AutoCloseable { @SystemApi(client = MODULE_LIBRARIES) public static final int METADATA_KEY_VIDEO_CODEC_MIME_TYPE = 40; + /** + * If the media contains XMP data, this key retrieves the offset (in bytes) + * of the data. + * @hide + */ + @SystemApi(client = MODULE_LIBRARIES) + public static final int METADATA_KEY_XMP_OFFSET = 41; + + /** + * If the media contains XMP data, this key retrieves the length (in bytes) + * of the data. + * @hide + */ + @SystemApi(client = MODULE_LIBRARIES) + public static final int METADATA_KEY_XMP_LENGTH = 42; + // Add more here... }