public class SurfaceUtils extends Object
Constructor and Description |
---|
SurfaceUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
checkConstrainedHighSpeedSurfaces(Collection<Surface> surfaces,
Range<Integer> fpsRange,
StreamConfigurationMap config)
Verify that that the surfaces are valid for high-speed recording mode,
and that the FPS range is supported
|
static int |
getSurfaceDataspace(Surface surface)
Get the Surface dataspace.
|
static int |
getSurfaceFormat(Surface surface)
Get the Surface format.
|
static Size |
getSurfaceSize(Surface surface)
Get the Surface size.
|
static boolean |
isFlexibleConsumer(Surface output)
Return true is the consumer is one of the consumers that can accept
producer overrides of the default dimensions and format.
|
static boolean |
isSurfaceForHwVideoEncoder(Surface surface)
Check if the surface is for hardware video encoder consumer based on consumer end point
Gralloc usage flags.
|
static boolean |
isSurfaceForPreview(Surface surface)
Check if a surface is for preview consumer based on consumer end point Gralloc usage flags.
|
public static boolean isSurfaceForPreview(Surface surface)
surface
- The surface to be checked.public static boolean isSurfaceForHwVideoEncoder(Surface surface)
surface
- The surface to be checked.public static Size getSurfaceSize(Surface surface)
surface
- The surface to be queried for size.IllegalArgumentException
- if the surface is already abandoned.public static int getSurfaceFormat(Surface surface)
surface
- The surface to be queried for format.IllegalArgumentException
- if the surface is already abandoned.public static int getSurfaceDataspace(Surface surface)
surface
- The surface to be queried for dataspace.IllegalArgumentException
- if the surface is already abandoned.public static boolean isFlexibleConsumer(Surface output)
public static void checkConstrainedHighSpeedSurfaces(Collection<Surface> surfaces, Range<Integer> fpsRange, StreamConfigurationMap config)
surfaces
- the surfaces to verify as valid in terms of size and formatfpsRange
- the target high-speed FPS range to validateconfig
- The stream configuration map for the device in question