am 36322db5: Add focus API and FLASH_MODE_VIDEO_LIGHT.
Merge commit '36322db5752c7ec196f59ba94abe5d5a63cc19f5' into eclair-plus-aosp * commit '36322db5752c7ec196f59ba94abe5d5a63cc19f5': Add focus API and FLASH_MODE_VIDEO_LIGHT.
This commit is contained in:
@@ -67644,6 +67644,17 @@
|
|||||||
visibility="public"
|
visibility="public"
|
||||||
>
|
>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="getFocusMode"
|
||||||
|
return="java.lang.String"
|
||||||
|
abstract="false"
|
||||||
|
native="false"
|
||||||
|
synchronized="false"
|
||||||
|
static="false"
|
||||||
|
final="false"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</method>
|
||||||
<method name="getInt"
|
<method name="getInt"
|
||||||
return="int"
|
return="int"
|
||||||
abstract="false"
|
abstract="false"
|
||||||
@@ -67789,6 +67800,17 @@
|
|||||||
visibility="public"
|
visibility="public"
|
||||||
>
|
>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="getSupportedFocusModes"
|
||||||
|
return="java.util.List<java.lang.String>"
|
||||||
|
abstract="false"
|
||||||
|
native="false"
|
||||||
|
synchronized="false"
|
||||||
|
static="false"
|
||||||
|
final="false"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</method>
|
||||||
<method name="getSupportedPictureFormats"
|
<method name="getSupportedPictureFormats"
|
||||||
return="java.util.List<java.lang.Integer>"
|
return="java.util.List<java.lang.Integer>"
|
||||||
abstract="false"
|
abstract="false"
|
||||||
@@ -67970,6 +67992,19 @@
|
|||||||
<parameter name="value" type="java.lang.String">
|
<parameter name="value" type="java.lang.String">
|
||||||
</parameter>
|
</parameter>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="setFocusMode"
|
||||||
|
return="void"
|
||||||
|
abstract="false"
|
||||||
|
native="false"
|
||||||
|
synchronized="false"
|
||||||
|
static="false"
|
||||||
|
final="false"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
<parameter name="value" type="java.lang.String">
|
||||||
|
</parameter>
|
||||||
|
</method>
|
||||||
<method name="setGpsAltitude"
|
<method name="setGpsAltitude"
|
||||||
return="void"
|
return="void"
|
||||||
abstract="false"
|
abstract="false"
|
||||||
@@ -68371,6 +68406,61 @@
|
|||||||
visibility="public"
|
visibility="public"
|
||||||
>
|
>
|
||||||
</field>
|
</field>
|
||||||
|
<field name="FLASH_MODE_VIDEO_LIGHT"
|
||||||
|
type="java.lang.String"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value=""video-light""
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="FOCUS_MODE_AUTO"
|
||||||
|
type="java.lang.String"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value=""auto""
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="FOCUS_MODE_FIXED"
|
||||||
|
type="java.lang.String"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value=""fixed""
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="FOCUS_MODE_INFINITY"
|
||||||
|
type="java.lang.String"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value=""infinity""
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
|
<field name="FOCUS_MODE_MACRO"
|
||||||
|
type="java.lang.String"
|
||||||
|
transient="false"
|
||||||
|
volatile="false"
|
||||||
|
value=""macro""
|
||||||
|
static="true"
|
||||||
|
final="true"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
</field>
|
||||||
<field name="SCENE_MODE_ACTION"
|
<field name="SCENE_MODE_ACTION"
|
||||||
type="java.lang.String"
|
type="java.lang.String"
|
||||||
transient="false"
|
transient="false"
|
||||||
|
|||||||
@@ -357,10 +357,12 @@ public class Camera {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts auto-focus function and registers a callback function to run when
|
* Starts auto-focus function and registers a callback function to run when
|
||||||
* camera is focused. Only valid after startPreview() has been called. If
|
* camera is focused. Only valid after startPreview() has been called.
|
||||||
* the camera does not support auto-focus, it is a no-op and {@link
|
* Applications should call {@link
|
||||||
* AutoFocusCallback#onAutoFocus(boolean, Camera)} callback will be called
|
* android.hardware.Camera.Parameters#getFocusMode()} to determine if this
|
||||||
* immediately.
|
* method should be called. If the camera does not support auto-focus, it is
|
||||||
|
* a no-op and {@link AutoFocusCallback#onAutoFocus(boolean, Camera)}
|
||||||
|
* callback will be called immediately.
|
||||||
* <p>If your application should not be installed
|
* <p>If your application should not be installed
|
||||||
* on devices without auto-focus, you must declare that your application
|
* on devices without auto-focus, you must declare that your application
|
||||||
* uses auto-focus with the
|
* uses auto-focus with the
|
||||||
@@ -598,6 +600,7 @@ public class Camera {
|
|||||||
private static final String KEY_ANTIBANDING = "antibanding";
|
private static final String KEY_ANTIBANDING = "antibanding";
|
||||||
private static final String KEY_SCENE_MODE = "scene-mode";
|
private static final String KEY_SCENE_MODE = "scene-mode";
|
||||||
private static final String KEY_FLASH_MODE = "flash-mode";
|
private static final String KEY_FLASH_MODE = "flash-mode";
|
||||||
|
private static final String KEY_FOCUS_MODE = "focus-mode";
|
||||||
// Parameter key suffix for supported values.
|
// Parameter key suffix for supported values.
|
||||||
private static final String SUPPORTED_VALUES_SUFFIX = "-values";
|
private static final String SUPPORTED_VALUES_SUFFIX = "-values";
|
||||||
|
|
||||||
@@ -646,6 +649,10 @@ public class Camera {
|
|||||||
* Flash will be fired in red-eye reduction mode.
|
* Flash will be fired in red-eye reduction mode.
|
||||||
*/
|
*/
|
||||||
public static final String FLASH_MODE_RED_EYE = "red-eye";
|
public static final String FLASH_MODE_RED_EYE = "red-eye";
|
||||||
|
/**
|
||||||
|
* Constant emission of light. This can be used for video recording.
|
||||||
|
*/
|
||||||
|
public static final String FLASH_MODE_VIDEO_LIGHT = "video-light";
|
||||||
|
|
||||||
// Values for scene mode settings.
|
// Values for scene mode settings.
|
||||||
public static final String SCENE_MODE_AUTO = "auto";
|
public static final String SCENE_MODE_AUTO = "auto";
|
||||||
@@ -664,6 +671,25 @@ public class Camera {
|
|||||||
public static final String SCENE_MODE_PARTY = "party";
|
public static final String SCENE_MODE_PARTY = "party";
|
||||||
public static final String SCENE_MODE_CANDLELIGHT = "candlelight";
|
public static final String SCENE_MODE_CANDLELIGHT = "candlelight";
|
||||||
|
|
||||||
|
// Values for focus mode settings.
|
||||||
|
/**
|
||||||
|
* Auto-focus mode.
|
||||||
|
*/
|
||||||
|
public static final String FOCUS_MODE_AUTO = "auto";
|
||||||
|
/**
|
||||||
|
* Focus is set at infinity. Applications should not call
|
||||||
|
* {@link #autoFocus(AutoFocusCallback)} in this mode.
|
||||||
|
*/
|
||||||
|
public static final String FOCUS_MODE_INFINITY = "infinity";
|
||||||
|
public static final String FOCUS_MODE_MACRO = "macro";
|
||||||
|
/**
|
||||||
|
* Focus is fixed. The camera is always in this mode if the focus is not
|
||||||
|
* adjustable. If the camera has auto-focus, this mode can fix the
|
||||||
|
* focus, which is usually at hyperfocal distance. Applications should
|
||||||
|
* not call {@link #autoFocus(AutoFocusCallback)} in this mode.
|
||||||
|
*/
|
||||||
|
public static final String FOCUS_MODE_FIXED = "fixed";
|
||||||
|
|
||||||
// Formats for setPreviewFormat and setPictureFormat.
|
// Formats for setPreviewFormat and setPictureFormat.
|
||||||
private static final String PIXEL_FORMAT_YUV422SP = "yuv422sp";
|
private static final String PIXEL_FORMAT_YUV422SP = "yuv422sp";
|
||||||
private static final String PIXEL_FORMAT_YUV420SP = "yuv420sp";
|
private static final String PIXEL_FORMAT_YUV420SP = "yuv420sp";
|
||||||
@@ -1295,6 +1321,39 @@ public class Camera {
|
|||||||
return split(str);
|
return split(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current focus mode setting.
|
||||||
|
*
|
||||||
|
* @return one of FOCUS_MODE_XXX string constant. If the camera does not
|
||||||
|
* support auto-focus, this should return {@link
|
||||||
|
* #FOCUS_MODE_FIXED}. If the focus mode is not FOCUS_MODE_FIXED
|
||||||
|
* or {@link #FOCUS_MODE_INFINITY}, applications should call
|
||||||
|
* {@link #autoFocus(AutoFocusCallback)} to start the focus.
|
||||||
|
*/
|
||||||
|
public String getFocusMode() {
|
||||||
|
return get(KEY_FOCUS_MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the focus mode.
|
||||||
|
*
|
||||||
|
* @param value FOCUS_MODE_XXX string constants.
|
||||||
|
*/
|
||||||
|
public void setFocusMode(String value) {
|
||||||
|
set(KEY_FOCUS_MODE, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the supported focus modes.
|
||||||
|
*
|
||||||
|
* @return a List of FOCUS_MODE_XXX string constants. null if focus mode
|
||||||
|
* setting is not supported.
|
||||||
|
*/
|
||||||
|
public List<String> getSupportedFocusModes() {
|
||||||
|
String str = get(KEY_FOCUS_MODE + SUPPORTED_VALUES_SUFFIX);
|
||||||
|
return split(str);
|
||||||
|
}
|
||||||
|
|
||||||
// Splits a comma delimited string to an ArrayList of String.
|
// Splits a comma delimited string to an ArrayList of String.
|
||||||
// Return null if the passing string is null or the size is 0.
|
// Return null if the passing string is null or the size is 0.
|
||||||
private ArrayList<String> split(String str) {
|
private ArrayList<String> split(String str) {
|
||||||
|
|||||||
Reference in New Issue
Block a user