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

Commit 9a3f63d7 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge changes from topic "am-6269d6c0d0bb413c84e5068d06041457"

* changes:
  Merge "Add keys to retrieve color aspects from metadata" am: 6636b022 am: a2ec9e32 am: 194a3a75
  Merge "Color aspects keys information stored database" am: e4c918ba am: 89c61586 am: e8c39f3b
parents cbe76857 87e5a5e0
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -2029,6 +2029,27 @@ public final class MediaStore {
             * <P>Type: INTEGER</P>
             */
            public static final String BOOKMARK = "bookmark";

            /**
             * The standard of color aspects
             * <P>Type: INTEGER</P>
             * @hide
             */
            public static final String COLOR_STANDARD = "color_standard";

            /**
             * The transfer of color aspects
             * <P>Type: INTEGER</P>
             * @hide
             */
            public static final String COLOR_TRANSFER = "color_transfer";

            /**
             * The range of color aspects
             * <P>Type: INTEGER</P>
             * @hide
             */
            public static final String COLOR_RANGE = "color_range";
        }

        public static final class Media implements VideoColumns {
+34 −0
Original line number Diff line number Diff line
@@ -923,5 +923,39 @@ public class MediaMetadataRetriever
     * @hide
     */
    public static final int METADATA_KEY_EXIF_LENGTH = 34;

    /**
     * This key retrieves the color standard, if available.
     *
     * @see MediaFormat#COLOR_STANDARD_BT709
     * @see MediaFormat#COLOR_STANDARD_BT601_PAL
     * @see MediaFormat#COLOR_STANDARD_BT601_NTSC
     * @see MediaFormat#COLOR_STANDARD_BT2020
     *
     * @hide
     */
    public static final int METADATA_KEY_COLOR_STANDARD = 35;

    /**
     * This key retrieves the color transfer, if available.
     *
     * @see MediaFormat#COLOR_TRANSFER_LINEAR
     * @see MediaFormat#COLOR_TRANSFER_SDR_VIDEO
     * @see MediaFormat#COLOR_TRANSFER_ST2084
     * @see MediaFormat#COLOR_TRANSFER_HLG
     *
     * @hide
     */
    public static final int METADATA_KEY_COLOR_TRANSFER = 36;

    /**
     * This key retrieves the color range, if available.
     *
     * @see MediaFormat#COLOR_RANGE_LIMITED
     * @see MediaFormat#COLOR_RANGE_FULL
     *
     * @hide
     */
    public static final int METADATA_KEY_COLOR_RANGE    = 37;
    // Add more here...
}
+21 −0
Original line number Diff line number Diff line
@@ -524,6 +524,9 @@ public class MediaScanner implements AutoCloseable {
        private boolean mScanSuccess;
        private int mWidth;
        private int mHeight;
        private int mColorStandard;
        private int mColorTransfer;
        private int mColorRange;

        public MyMediaScannerClient() {
            mDateFormatter = new SimpleDateFormat("yyyyMMdd'T'HHmmss");
@@ -592,6 +595,9 @@ public class MediaScanner implements AutoCloseable {
            mCompilation = 0;
            mWidth = 0;
            mHeight = 0;
            mColorStandard = -1;
            mColorTransfer = -1;
            mColorRange = -1;

            return entry;
        }
@@ -760,6 +766,12 @@ public class MediaScanner implements AutoCloseable {
                mWidth = parseSubstring(value, 0, 0);
            } else if (name.equalsIgnoreCase("height")) {
                mHeight = parseSubstring(value, 0, 0);
            } else if (name.equalsIgnoreCase("colorstandard")) {
                mColorStandard = parseSubstring(value, 0, -1);
            } else if (name.equalsIgnoreCase("colortransfer")) {
                mColorTransfer = parseSubstring(value, 0, -1);
            } else if (name.equalsIgnoreCase("colorrange")) {
                mColorRange = parseSubstring(value, 0, -1);
            } else {
                //Log.v(TAG, "unknown tag: " + name + " (" + mProcessGenres + ")");
            }
@@ -905,6 +917,15 @@ public class MediaScanner implements AutoCloseable {
                    if (resolution != null) {
                        map.put(Video.Media.RESOLUTION, resolution);
                    }
                    if (mColorStandard >= 0) {
                        map.put(Video.Media.COLOR_STANDARD, mColorStandard);
                    }
                    if (mColorTransfer >= 0) {
                        map.put(Video.Media.COLOR_TRANSFER, mColorTransfer);
                    }
                    if (mColorRange >= 0) {
                        map.put(Video.Media.COLOR_RANGE, mColorRange);
                    }
                    if (mDate > 0) {
                        map.put(Video.Media.DATE_TAKEN, mDate);
                    }