Lines Matching defs:surface

38      * Check if a surface is for preview consumer based on consumer end point Gralloc usage flags.
40 * @param surface The surface to be checked.
41 * @return true if the surface is for preview consumer, false otherwise.
43 public static boolean isSurfaceForPreview(Surface surface) {
44 return LegacyCameraDevice.isPreviewConsumer(surface);
48 * Check if the surface is for hardware video encoder consumer based on consumer end point
51 * @param surface The surface to be checked.
52 * @return true if the surface is for hardware video encoder consumer, false otherwise.
54 public static boolean isSurfaceForHwVideoEncoder(Surface surface) {
55 return LegacyCameraDevice.isVideoEncoderConsumer(surface);
61 * @param surface The surface to be queried for size.
62 * @return Size of the surface.
64 * @throws IllegalArgumentException if the surface is already abandoned.
66 public static Size getSurfaceSize(Surface surface) {
68 return LegacyCameraDevice.getSurfaceSize(surface);
77 * @param surface The surface to be queried for format.
78 * @return format of the surface.
80 * @throws IllegalArgumentException if the surface is already abandoned.
82 public static int getSurfaceFormat(Surface surface) {
84 return LegacyCameraDevice.detectSurfaceType(surface);
93 * @param surface The surface to be queried for dataspace.
94 * @return dataspace of the surface.
96 * @throws IllegalArgumentException if the surface is already abandoned.
98 public static int getSurfaceDataspace(Surface surface) {
100 return LegacyCameraDevice.detectSurfaceDataspace(surface);
116 * A high speed output surface can only be preview or hardware encoder surface.
118 * @param surface The high speed output surface to be checked.
120 private static void checkHighSpeedSurfaceFormat(Surface surface) {
121 int surfaceFormat = SurfaceUtils.getSurfaceFormat(surface);
140 throw new IllegalArgumentException("Output target surface list must not be null and"
158 for (Surface surface : surfaces) {
159 checkHighSpeedSurfaceFormat(surface);
162 Size surfaceSize = SurfaceUtils.getSurfaceSize(surface);
168 // Each output surface must be either preview surface or recording surface.
169 if (!SurfaceUtils.isSurfaceForPreview(surface) &&
170 !SurfaceUtils.isSurfaceForHwVideoEncoder(surface)) {
171 throw new IllegalArgumentException("This output surface is neither preview nor "
172 + "hardware video encoding surface");
174 if (SurfaceUtils.isSurfaceForPreview(surface) &&
175 SurfaceUtils.isSurfaceForHwVideoEncoder(surface)) {
176 throw new IllegalArgumentException("This output surface can not be both preview"
177 + " and hardware video encoding surface");
181 // For 2 output surface case, they shouldn't be same type.
183 // Up to here, each surface can only be either preview or recording.