am c0df3a47: Merge change 25746 into eclair
Merge commit 'c0df3a473f6973cf32b343a886dd62559a4b93c7' into eclair-plus-aosp * commit 'c0df3a473f6973cf32b343a886dd62559a4b93c7': Fix 2092386: Support yuyv for camera preview format.
This commit is contained in:
@@ -61135,6 +61135,17 @@
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="YCbCr_422_I"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="20"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
<field name="YCbCr_422_SP"
|
||||
type="int"
|
||||
transient="false"
|
||||
|
||||
@@ -673,6 +673,7 @@ public class Camera {
|
||||
// Formats for setPreviewFormat and setPictureFormat.
|
||||
private static final String PIXEL_FORMAT_YUV422SP = "yuv422sp";
|
||||
private static final String PIXEL_FORMAT_YUV420SP = "yuv420sp";
|
||||
private static final String PIXEL_FORMAT_YUV422I = "yuv422i-yuyv";
|
||||
private static final String PIXEL_FORMAT_RGB565 = "rgb565";
|
||||
private static final String PIXEL_FORMAT_JPEG = "jpeg";
|
||||
|
||||
@@ -957,7 +958,13 @@ public class Camera {
|
||||
*/
|
||||
public List<Integer> getSupportedPreviewFormats() {
|
||||
String str = get(KEY_PREVIEW_FORMAT + SUPPORTED_VALUES_SUFFIX);
|
||||
return splitInt(str);
|
||||
ArrayList<Integer> formats = new ArrayList<Integer>();
|
||||
for (String s : split(str)) {
|
||||
int f = pixelFormatForCameraFormat(s);
|
||||
if (f == PixelFormat.UNKNOWN) continue;
|
||||
formats.add(f);
|
||||
}
|
||||
return formats;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1036,6 +1043,7 @@ public class Camera {
|
||||
switch(pixel_format) {
|
||||
case PixelFormat.YCbCr_422_SP: return PIXEL_FORMAT_YUV422SP;
|
||||
case PixelFormat.YCbCr_420_SP: return PIXEL_FORMAT_YUV420SP;
|
||||
case PixelFormat.YCbCr_422_I: return PIXEL_FORMAT_YUV422I;
|
||||
case PixelFormat.RGB_565: return PIXEL_FORMAT_RGB565;
|
||||
case PixelFormat.JPEG: return PIXEL_FORMAT_JPEG;
|
||||
default: return null;
|
||||
@@ -1052,6 +1060,9 @@ public class Camera {
|
||||
if (format.equals(PIXEL_FORMAT_YUV420SP))
|
||||
return PixelFormat.YCbCr_420_SP;
|
||||
|
||||
if (format.equals(PIXEL_FORMAT_YUV422I))
|
||||
return PixelFormat.YCbCr_422_I;
|
||||
|
||||
if (format.equals(PIXEL_FORMAT_RGB565))
|
||||
return PixelFormat.RGB_565;
|
||||
|
||||
|
||||
@@ -60,6 +60,13 @@ public class PixelFormat
|
||||
*/
|
||||
public static final int YCbCr_420_SP= 0x11;
|
||||
|
||||
/** YCbCr format used for images, which uses YUYV (YUY2) encoding format.
|
||||
* This is an alternative format for camera preview images. Whether this
|
||||
* format is supported by the camera hardware can be determined by
|
||||
* {@link android.hardware.Camera.Parameters#getSupportedPreviewFormats()}.
|
||||
*/
|
||||
public static final int YCbCr_422_I = 0x14;
|
||||
|
||||
/**
|
||||
* Encoded formats. These are not necessarily supported by the hardware.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user