public class CameraAgentFactory extends Object
CameraAgent
.
The choice of framework API to use can be made automatically based on the system API level, explicitly forced by the client app, or overridden entirely by setting the system property com.camera2.portability.fwk_api to 1 or 2.
Modifier and Type | Class and Description |
---|---|
static class |
CameraAgentFactory.CameraApi
Used to indicate which camera framework should be used.
|
Constructor and Description |
---|
CameraAgentFactory() |
Modifier and Type | Method and Description |
---|---|
static CameraAgent |
getAndroidCameraAgent(Context context,
CameraAgentFactory.CameraApi api)
Returns the android camera implementation of
com.android.camera.cameradevice.CameraAgent . |
static void |
recycle(CameraAgentFactory.CameraApi api)
Recycles the resources.
|
public static CameraAgent getAndroidCameraAgent(Context context, CameraAgentFactory.CameraApi api)
com.android.camera.cameradevice.CameraAgent
.
To clean up the resources allocated by this call, be sure to invoke
#recycle(boolean)
with the same api
value provided
here.
context
- The application context.api
- Which camera framework to use.CameraAgent
to control the camera device.UnsupportedOperationException
- If CameraApi.API_2
was
requested on an unsupported device.public static void recycle(CameraAgentFactory.CameraApi api)
api
- Which camera framework handle to recycle.UnsupportedOperationException
- If CameraApi.API_2
was
requested on an unsupported device.