@@ -82,7 +82,6 @@ public class Cameras
8282 public Cameras (Context xCtx ) {
8383 super (xCtx );
8484 context = xCtx ;
85-
8685 cameraVendors = Utils .loadJSONFromAsset (xCtx , "camera_vendors.json" );
8786
8887 // Get resolutions of the camera
@@ -256,7 +255,9 @@ public ArrayList<String> getImageFormat(CameraCharacteristics characteristics) {
256255 if (outputFormats != null ) {
257256 for (int value : outputFormats ) {
258257 String type = typeFormat (value );
259- types .add (type .replaceAll ("[<>]" , "" ));
258+ if (!type .isEmpty ()){
259+ types .add (type .replaceAll ("[<>]" , "" ));
260+ }
260261 }
261262 }
262263 }
@@ -269,6 +270,8 @@ public ArrayList<String> getImageFormat(CameraCharacteristics characteristics) {
269270
270271 private String typeFormat (int i ) {
271272 switch (i ) {
273+ case 0 :
274+ return "UNKNOWN" ;
272275 case 4 :
273276 return "RGB_565" ;
274277 case 16 :
@@ -279,16 +282,38 @@ private String typeFormat(int i) {
279282 return "YUY2" ;
280283 case 32 :
281284 return "RAW_SENSOR" ;
285+ case 34 :
286+ return "PRIVATE" ;
282287 case 35 :
283288 return "YUV_420_888" ;
289+ case 36 :
290+ return "RAW_PRIVATE" ;
284291 case 37 :
285292 return "RAW10" ;
293+ case 38 :
294+ return "RAW12" ;
286295 case 39 :
287296 return "YUV_422_888" ;
297+ case 40 :
298+ return "YUV_444_888" ;
299+ case 41 :
300+ return "FLEX_RGB_888" ;
301+ case 42 :
302+ return "FLEX_RGBA_8888" ;
288303 case 256 :
289304 return "JPEG" ;
305+ case 257 :
306+ return "DEPTH_POINT_CLOUD" ;
290307 case 842094169 :
291308 return "YV12" ;
309+ case 1144402265 :
310+ return "DEPTH16" ;
311+ case 1212500294 :
312+ return "HEIC" ;
313+ case 1768253795 :
314+ return "DEPTH_JPEG" ;
315+ case 538982489 :
316+ return "Y8" ;
292317 default :
293318 return "" ;
294319 }
@@ -319,22 +344,27 @@ public String getOrientation(CameraCharacteristics characteristics) {
319344 * @param index number of camera
320345 * @return String video resolution camera
321346 */
322- public String getVideoResolution (int index ) {
347+ public ArrayList <String > getVideoResolution (int index ) {
348+ ArrayList <String > resolutions = new ArrayList <>();
323349 String value = "N/A" ;
324350 try {
325351 Camera open = Camera .open (index );
326352 Camera .Parameters parameters = open .getParameters ();
327353 List <Camera .Size > supportedVideoSizes = parameters .getSupportedVideoSizes ();
328354 if (supportedVideoSizes != null ) {
329- Camera .Size infoSize = supportedVideoSizes .get (supportedVideoSizes .size () - 1 );
330- int width = infoSize .width ;
331- int height = infoSize .height ;
332- value = width + "x" + height ;
355+ for (int i = 0 ; i <supportedVideoSizes .size (); i ++ ){
356+ Camera .Size infoSize = supportedVideoSizes .get (i );
357+ int width = infoSize .width ;
358+ int height = infoSize .height ;
359+ value = width + "x" + height ;
360+ resolutions .add (value );
361+ }
333362 }
334363 } catch (Exception ex ) {
335364 InventoryLog .e (InventoryLog .getMessage (context , CommonErrorType .CAMERA_VIDEO_RESOLUTION , ex .getMessage ()));
336365 }
337- return value ;
366+
367+ return resolutions ;
338368 }
339369
340370 /**
0 commit comments