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

Commit 522632cd authored by Nipun Kwatra's avatar Nipun Kwatra
Browse files

Exposing specific profile levels + hasProfile().

- Exposing the specific resolution profile levels
  QUALITY_{QCIF,CIF,480P,720P,1080P} and the new time lapse profiles
  QUALITY_TIME_LAPSE_{LOW,HIGH,QCIF,CIF,480P,720P,1080P}
- Unhiding the hasProfile() function used to test if a given profile exists.

Change-Id: I5d8b9e1ba61718f304235e76d85244e428e68643
parent 5976d24d
Loading
Loading
Loading
Loading
+160 −0
Original line number Diff line number Diff line
@@ -98314,6 +98314,78 @@
<parameter name="quality" type="int">
</parameter>
</method>
<method name="hasProfile"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="quality" type="int">
</parameter>
</method>
<method name="hasProfile"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="cameraId" type="int">
</parameter>
<parameter name="quality" type="int">
</parameter>
</method>
<field name="QUALITY_1080P"
 type="int"
 transient="false"
 volatile="false"
 value="6"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_480P"
 type="int"
 transient="false"
 volatile="false"
 value="4"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_720P"
 type="int"
 transient="false"
 volatile="false"
 value="5"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_CIF"
 type="int"
 transient="false"
 volatile="false"
 value="3"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_HIGH"
 type="int"
 transient="false"
@@ -98336,6 +98408,94 @@
 visibility="public"
>
</field>
<field name="QUALITY_QCIF"
 type="int"
 transient="false"
 volatile="false"
 value="2"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_TIME_LAPSE_1080P"
 type="int"
 transient="false"
 volatile="false"
 value="1006"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_TIME_LAPSE_480P"
 type="int"
 transient="false"
 volatile="false"
 value="1004"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_TIME_LAPSE_720P"
 type="int"
 transient="false"
 volatile="false"
 value="1005"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_TIME_LAPSE_CIF"
 type="int"
 transient="false"
 volatile="false"
 value="1003"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_TIME_LAPSE_HIGH"
 type="int"
 transient="false"
 volatile="false"
 value="1001"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_TIME_LAPSE_LOW"
 type="int"
 transient="false"
 volatile="false"
 value="1000"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="QUALITY_TIME_LAPSE_QCIF"
 type="int"
 transient="false"
 volatile="false"
 value="1002"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="audioBitRate"
 type="int"
 transient="false"
+8 −6
Original line number Diff line number Diff line
@@ -27,16 +27,18 @@ enum camcorder_quality {
    CAMCORDER_QUALITY_LOW  = 0,
    CAMCORDER_QUALITY_HIGH = 1,
    CAMCORDER_QUALITY_QCIF = 2,
    CAMCORDER_QUALITY_480P = 3,
    CAMCORDER_QUALITY_720P = 4,
    CAMCORDER_QUALITY_1080P = 5,
    CAMCORDER_QUALITY_CIF = 3,
    CAMCORDER_QUALITY_480P = 4,
    CAMCORDER_QUALITY_720P = 5,
    CAMCORDER_QUALITY_1080P = 6,

    CAMCORDER_QUALITY_TIME_LAPSE_LOW  = 1000,
    CAMCORDER_QUALITY_TIME_LAPSE_HIGH = 1001,
    CAMCORDER_QUALITY_TIME_LAPSE_QCIF = 1002,
    CAMCORDER_QUALITY_TIME_LAPSE_480P = 1003,
    CAMCORDER_QUALITY_TIME_LAPSE_720P = 1004,
    CAMCORDER_QUALITY_TIME_LAPSE_1080P = 1005
    CAMCORDER_QUALITY_TIME_LAPSE_CIF = 1003,
    CAMCORDER_QUALITY_TIME_LAPSE_480P = 1004,
    CAMCORDER_QUALITY_TIME_LAPSE_720P = 1005,
    CAMCORDER_QUALITY_TIME_LAPSE_1080P = 1006
};

enum video_decoder {
+39 −16
Original line number Diff line number Diff line
@@ -53,54 +53,64 @@ public class CamcorderProfile
    public static final int QUALITY_HIGH = 1;

    /**
     * Quality level corresponding to the qcif (176 × 144) resolution.
     * Quality level corresponding to the qcif (176 x 144) resolution.
     */
    private static final int QUALITY_QCIF = 2;
    public static final int QUALITY_QCIF = 2;

    /**
     * Quality level corresponding to the cif (352 x 288) resolution.
     */
    public static final int QUALITY_CIF = 3;

    /**
     * Quality level corresponding to the 480p (720 x 480) resolution.
     */
    private static final int QUALITY_480P = 3;
    public static final int QUALITY_480P = 4;

    /**
     * Quality level corresponding to the 720p (1280 x 720) resolution.
     */
    private static final int QUALITY_720P = 4;
    public static final int QUALITY_720P = 5;

    /**
     * Quality level corresponding to the 1080p (1920 x 1088) resolution.
     */
    private static final int QUALITY_1080P = 5;
    public static final int QUALITY_1080P = 6;

    /**
     * Time lapse quality level corresponding to the lowest available resolution.
     */
    private static final int QUALITY_TIME_LAPSE_LOW  = 1000;
    public static final int QUALITY_TIME_LAPSE_LOW  = 1000;

    /**
     * Time lapse quality level corresponding to the highest available resolution.
     */
    private static final int QUALITY_TIME_LAPSE_HIGH = 1001;
    public static final int QUALITY_TIME_LAPSE_HIGH = 1001;

    /**
     * Time lapse quality level corresponding to the qcif (176 x 144) resolution.
     */
    public static final int QUALITY_TIME_LAPSE_QCIF = 1002;

    /**
     * Time lapse quality level corresponding to the qcif (176 × 144) resolution.
     * Time lapse quality level corresponding to the cif (352 x 288) resolution.
     */
    private static final int QUALITY_TIME_LAPSE_QCIF = 1002;
    public static final int QUALITY_TIME_LAPSE_CIF = 1003;

    /**
     * Time lapse quality level corresponding to the 480p (720 x 480) resolution.
     */
    private static final int QUALITY_TIME_LAPSE_480P = 1003;
    public static final int QUALITY_TIME_LAPSE_480P = 1004;

    /**
     * Time lapse quality level corresponding to the 720p (1280 x 720) resolution.
     */
    private static final int QUALITY_TIME_LAPSE_720P = 1004;
    public static final int QUALITY_TIME_LAPSE_720P = 1005;

    /**
     * Time lapse quality level corresponding to the 1080p (1920 x 1088) resolution.
     */
    private static final int QUALITY_TIME_LAPSE_1080P = 1005;
    public static final int QUALITY_TIME_LAPSE_1080P = 1006;

    /**
     * Default recording duration in seconds before the session is terminated.
@@ -181,10 +191,11 @@ public class CamcorderProfile
     * quality level.
     *
     * Quality levels QUALITY_LOW, QUALITY_HIGH are guaranteed to be supported, while
     * other levels may or may not be supported.
     * other levels may or may not be supported. The supported levels can be checked using
     * {@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, 480p, 720p, or 1080p.
     * 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.
     *
@@ -195,6 +206,20 @@ public class CamcorderProfile
     *
     * @param cameraId the id for the camera
     * @param quality the target quality level for the camcorder profile.
     * @see #QUALITY_LOW
     * @see #QUALITY_HIGH
     * @see #QUALITY_QCIF
     * @see #QUALITY_CIF
     * @see #QUALITY_480P
     * @see #QUALITY_720P
     * @see #QUALITY_1080P
     * @see #QUALITY_TIME_LAPSE_LOW
     * @see #QUALITY_TIME_LAPSE_HIGH
     * @see #QUALITY_TIME_LAPSE_QCIF
     * @see #QUALITY_TIME_LAPSE_CIF
     * @see #QUALITY_TIME_LAPSE_480P
     * @see #QUALITY_TIME_LAPSE_720P
     * @see #QUALITY_TIME_LAPSE_1080P
     */
    public static CamcorderProfile get(int cameraId, int quality) {
        if (!((quality >= QUALITY_LOW && quality <= QUALITY_1080P) ||
@@ -209,7 +234,6 @@ public class CamcorderProfile
     * Returns true if camcorder profile exists for the default camera at
     * the given quality level.
     * @param quality the target quality level for the camcorder profile
     * @hide
     */
    public static boolean hasProfile(int quality) {
        return hasProfile(android.hardware.Camera.CAMERA_ID_DEFAULT, quality);
@@ -220,7 +244,6 @@ public class CamcorderProfile
     * the given quality level.
     * @param cameraId the id for the camera
     * @param quality the target quality level for the camcorder profile
     * @hide
     */
    public static boolean hasProfile(int cameraId, int quality) {
        return native_has_camcorder_profile(cameraId, quality);
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ const MediaProfiles::NameToTagMap MediaProfiles::sCamcorderQualityNameMap[] = {
    {"low", CAMCORDER_QUALITY_LOW},
    {"high", CAMCORDER_QUALITY_HIGH},
    {"qcif", CAMCORDER_QUALITY_QCIF},
    {"cif", CAMCORDER_QUALITY_CIF},
    {"480p", CAMCORDER_QUALITY_480P},
    {"720p", CAMCORDER_QUALITY_720P},
    {"1080p", CAMCORDER_QUALITY_1080P},
@@ -69,6 +70,7 @@ const MediaProfiles::NameToTagMap MediaProfiles::sCamcorderQualityNameMap[] = {
    {"timelapselow",  CAMCORDER_QUALITY_TIME_LAPSE_LOW},
    {"timelapsehigh", CAMCORDER_QUALITY_TIME_LAPSE_HIGH},
    {"timelapseqcif", CAMCORDER_QUALITY_TIME_LAPSE_QCIF},
    {"timelapsecif", CAMCORDER_QUALITY_TIME_LAPSE_CIF},
    {"timelapse480p", CAMCORDER_QUALITY_TIME_LAPSE_480P},
    {"timelapse720p", CAMCORDER_QUALITY_TIME_LAPSE_720P},
    {"timelapse1080p", CAMCORDER_QUALITY_TIME_LAPSE_1080P}