CamcorderProfiles: add high speed profile constants

Change-Id: I8f783466f8c2560820db14488acc1a309d27ab0f
diff --git a/api/current.txt b/api/current.txt
index e1e91eb..88d7157 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -14369,6 +14369,11 @@
     field public static final int QUALITY_720P = 5; // 0x5
     field public static final int QUALITY_CIF = 3; // 0x3
     field public static final int QUALITY_HIGH = 1; // 0x1
+    field public static final int QUALITY_HIGH_SPEED_1080P = 2004; // 0x7d4
+    field public static final int QUALITY_HIGH_SPEED_480P = 2002; // 0x7d2
+    field public static final int QUALITY_HIGH_SPEED_720P = 2003; // 0x7d3
+    field public static final int QUALITY_HIGH_SPEED_HIGH = 2001; // 0x7d1
+    field public static final int QUALITY_HIGH_SPEED_LOW = 2000; // 0x7d0
     field public static final int QUALITY_LOW = 0; // 0x0
     field public static final int QUALITY_QCIF = 2; // 0x2
     field public static final int QUALITY_QVGA = 7; // 0x7
diff --git a/media/java/android/media/CamcorderProfile.java b/media/java/android/media/CamcorderProfile.java
index f9e49c1..8883d28 100644
--- a/media/java/android/media/CamcorderProfile.java
+++ b/media/java/android/media/CamcorderProfile.java
@@ -149,6 +149,39 @@
     private static final int QUALITY_TIME_LAPSE_LIST_END = QUALITY_TIME_LAPSE_2160P;
 
     /**
+     * High speed ( >= 100fps) quality level corresponding to the lowest available resolution.
+     */
+    public static final int QUALITY_HIGH_SPEED_LOW = 2000;
+
+    /**
+     * High speed ( >= 100fps) quality level corresponding to the highest available resolution.
+     */
+    public static final int QUALITY_HIGH_SPEED_HIGH = 2001;
+
+    /**
+     * High speed ( >= 100fps) quality level corresponding to the 480p (720 x 480) resolution.
+     *
+     * Note that the horizontal resolution for 480p can also be other
+     * values, such as 640 or 704, instead of 720.
+     */
+    public static final int QUALITY_HIGH_SPEED_480P = 2002;
+
+    /**
+     * High speed ( >= 100fps) quality level corresponding to the 720p (1280 x 720) resolution.
+     */
+    public static final int QUALITY_HIGH_SPEED_720P = 2003;
+
+    /**
+     * High speed ( >= 100fps) quality level corresponding to the 1080p (1920 x 1080 or 1920x1088)
+     * resolution.
+     */
+    public static final int QUALITY_HIGH_SPEED_1080P = 2004;
+
+    // Start and end of high speed quality list
+    private static final int QUALITY_HIGH_SPEED_LIST_START = QUALITY_HIGH_SPEED_LOW;
+    private static final int QUALITY_HIGH_SPEED_LIST_END = QUALITY_HIGH_SPEED_1080P;
+
+    /**
      * Default recording duration in seconds before the session is terminated.
      * This is useful for applications like MMS has limited file size requirement.
      */
@@ -240,13 +273,17 @@
      * {@link #hasProfile(int, int)}.
      * QUALITY_LOW refers to the lowest quality available, while QUALITY_HIGH refers to
      * the highest quality available.
-     * QUALITY_LOW/QUALITY_HIGH have to match one of qcif, cif, 480p, 720p, or 1080p.
-     * E.g. if the device supports 480p, 720p, and 1080p, then low is 480p and high is
-     * 1080p.
+     * QUALITY_LOW/QUALITY_HIGH have to match one of qcif, cif, 480p, 720p, 1080p or 2160p.
+     * E.g. if the device supports 480p, 720p, 1080p and 2160p, then low is 480p and high is
+     * 2160p.
      *
      * The same is true for time lapse quality levels, i.e. QUALITY_TIME_LAPSE_LOW,
      * QUALITY_TIME_LAPSE_HIGH are guaranteed to be supported and have to match one of
-     * qcif, cif, 480p, 720p, or 1080p.
+     * qcif, cif, 480p, 720p, 1080p, or 2160p.
+     *
+     * For high speed quality levels, they may or may not be supported. If a subset of the levels
+     * are supported, QUALITY_HIGH_SPEED_LOW and QUALITY_HIGH_SPEED_HIGH are guaranteed to be
+     * supported and have to match one of 480p, 720p, or 1080p.
      *
      * A camcorder recording session with higher quality level usually has higher output
      * bit rate, better video and/or audio recording quality, larger video frame
@@ -262,6 +299,7 @@
      * @see #QUALITY_480P
      * @see #QUALITY_720P
      * @see #QUALITY_1080P
+     * @see #QUALITY_2160P
      * @see #QUALITY_TIME_LAPSE_LOW
      * @see #QUALITY_TIME_LAPSE_HIGH
      * @see #QUALITY_TIME_LAPSE_QCIF
@@ -269,12 +307,20 @@
      * @see #QUALITY_TIME_LAPSE_480P
      * @see #QUALITY_TIME_LAPSE_720P
      * @see #QUALITY_TIME_LAPSE_1080P
-     */
+     * @see #QUALITY_TIME_LAPSE_2160P
+     * @see #QUALITY_HIGH_SPEED_LOW
+     * @see #QUALITY_HIGH_SPEED_HIGH
+     * @see #QUALITY_HIGH_SPEED_480P
+     * @see #QUALITY_HIGH_SPEED_720P
+     * @see #QUALITY_HIGH_SPEED_1080P
+    */
     public static CamcorderProfile get(int cameraId, int quality) {
         if (!((quality >= QUALITY_LIST_START &&
                quality <= QUALITY_LIST_END) ||
               (quality >= QUALITY_TIME_LAPSE_LIST_START &&
-               quality <= QUALITY_TIME_LAPSE_LIST_END))) {
+               quality <= QUALITY_TIME_LAPSE_LIST_END) ||
+               (quality >= QUALITY_HIGH_SPEED_LIST_START &&
+               quality <= QUALITY_HIGH_SPEED_LIST_END))) {
             String errMessage = "Unsupported quality level: " + quality;
             throw new IllegalArgumentException(errMessage);
         }
diff --git a/media/jni/android_media_MediaProfiles.cpp b/media/jni/android_media_MediaProfiles.cpp
index 1e5c700..007fc14 100644
--- a/media/jni/android_media_MediaProfiles.cpp
+++ b/media/jni/android_media_MediaProfiles.cpp
@@ -166,7 +166,9 @@
     return ((quality >= CAMCORDER_QUALITY_LIST_START &&
              quality <= CAMCORDER_QUALITY_LIST_END) ||
             (quality >= CAMCORDER_QUALITY_TIME_LAPSE_LIST_START &&
-             quality <= CAMCORDER_QUALITY_TIME_LAPSE_LIST_END));
+             quality <= CAMCORDER_QUALITY_TIME_LAPSE_LIST_END) ||
+             (quality >= CAMCORDER_QUALITY_HIGH_SPEED_LIST_START &&
+              quality <= CAMCORDER_QUALITY_HIGH_SPEED_LIST_END));
 }
 
 static jobject