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

Commit e4c918ba authored by Chong Zhang's avatar Chong Zhang Committed by Gerrit Code Review
Browse files

Merge "Color aspects keys information stored database"

parents 6f7d3848 839cc008
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -2090,6 +2090,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 {
+21 −0
Original line number Diff line number Diff line
@@ -513,6 +513,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 + ")");
            }
@@ -906,6 +918,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);
                    }