Advertisement
rhcp011235

Untitled

Jun 20th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. package android.media;
  2.  
  3. import android.hardware.Camera;
  4. import android.hardware.Camera.CameraInfo;
  5.  
  6. public class CamcorderProfile
  7. {
  8. public static final int QUALITY_1080P = 6;
  9. public static final int QUALITY_480P = 4;
  10. public static final int QUALITY_720P = 5;
  11. public static final int QUALITY_CIF = 3;
  12. public static final int QUALITY_HIGH = 1;
  13. private static final int QUALITY_LIST_END = 7;
  14. private static final int QUALITY_LIST_START = 0;
  15. public static final int QUALITY_LOW = 0;
  16. public static final int QUALITY_QCIF = 2;
  17. public static final int QUALITY_QVGA = 7;
  18. public static final int QUALITY_TIME_LAPSE_1080P = 1006;
  19. public static final int QUALITY_TIME_LAPSE_480P = 1004;
  20. public static final int QUALITY_TIME_LAPSE_720P = 1005;
  21. public static final int QUALITY_TIME_LAPSE_CIF = 1003;
  22. public static final int QUALITY_TIME_LAPSE_HIGH = 1001;
  23. private static final int QUALITY_TIME_LAPSE_LIST_END = 1007;
  24. private static final int QUALITY_TIME_LAPSE_LIST_START = 1000;
  25. public static final int QUALITY_TIME_LAPSE_LOW = 1000;
  26. public static final int QUALITY_TIME_LAPSE_QCIF = 1002;
  27. public static final int QUALITY_TIME_LAPSE_QVGA = 1007;
  28. public int audioBitRate;
  29. public int audioChannels;
  30. public int audioCodec;
  31. public int audioSampleRate;
  32. public int duration;
  33. public int fileFormat;
  34. public int quality;
  35. public int videoBitRate;
  36. public int videoCodec;
  37. public int videoFrameHeight;
  38. public int videoFrameRate;
  39. public int videoFrameWidth;
  40.  
  41. static
  42. {
  43. System.loadLibrary("media_jni");
  44. native_init();
  45. }
  46.  
  47. private CamcorderProfile(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, int paramInt11, int paramInt12)
  48. {
  49. this.duration = paramInt1;
  50. this.quality = paramInt2;
  51. this.fileFormat = paramInt3;
  52. this.videoCodec = paramInt4;
  53. this.videoBitRate = paramInt5;
  54. this.videoFrameRate = paramInt6;
  55. this.videoFrameWidth = paramInt7;
  56. this.videoFrameHeight = paramInt8;
  57. this.audioCodec = paramInt9;
  58. this.audioBitRate = paramInt10;
  59. this.audioSampleRate = paramInt11;
  60. this.audioChannels = paramInt12;
  61. }
  62.  
  63. public static CamcorderProfile get(int paramInt)
  64. {
  65. int i = Camera.getNumberOfCameras();
  66. Camera.CameraInfo localCameraInfo = new Camera.CameraInfo();
  67. int j = 0;
  68. if (j < i)
  69. {
  70. Camera.getCameraInfo(j, localCameraInfo);
  71. if (localCameraInfo.facing != 0);
  72. }
  73. for (CamcorderProfile localCamcorderProfile = get(j, paramInt); ; localCamcorderProfile = null)
  74. {
  75. return localCamcorderProfile;
  76. j++;
  77. break;
  78. }
  79. }
  80.  
  81. public static CamcorderProfile get(int paramInt1, int paramInt2)
  82. {
  83. if (((paramInt2 < 0) || (paramInt2 > 7)) && ((paramInt2 < 1000) || (paramInt2 > 1007)))
  84. throw new IllegalArgumentException("Unsupported quality level: " + paramInt2);
  85. return native_get_camcorder_profile(paramInt1, paramInt2);
  86. }
  87.  
  88. public static boolean hasProfile(int paramInt)
  89. {
  90. int i = Camera.getNumberOfCameras();
  91. Camera.CameraInfo localCameraInfo = new Camera.CameraInfo();
  92. int j = 0;
  93. if (j < i)
  94. {
  95. Camera.getCameraInfo(j, localCameraInfo);
  96. if (localCameraInfo.facing != 0);
  97. }
  98. for (boolean bool = hasProfile(j, paramInt); ; bool = false)
  99. {
  100. return bool;
  101. j++;
  102. break;
  103. }
  104. }
  105.  
  106. public static boolean hasProfile(int paramInt1, int paramInt2)
  107. {
  108. return native_has_camcorder_profile(paramInt1, paramInt2);
  109. }
  110.  
  111. private static final native CamcorderProfile native_get_camcorder_profile(int paramInt1, int paramInt2);
  112.  
  113. private static final native boolean native_has_camcorder_profile(int paramInt1, int paramInt2);
  114.  
  115. private static final native void native_init();
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement