• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Service-Based reference implementation
2This reference implementation demonstrates how to implement the Extensions in a standalone service.
3
4It contains the following components:
51) oem_library:
6   A Camera Extensions OEM library that implements the Extensions-Interface to enable both Camera2
7   and CameraX Extensions APIS. It is basically a pass-through that forwards all calls from
8   Extensions-Interface to the service. If it works well for you, you don't have to modify it.
9
10   It also contains the AIDL and wrapper classes for communicating with the service. AIDL and
11   wrapper classes are located in androidx.camera.extensions.impl.service package.
12
13   Both Advanced Extender and Basic Extender is supported, however, Advanced Extender is enabled
14   by default. If you want to use Basic Extender to implement, change
15   ExtensionsVersionImpl#isAdvancedExtenderImplemented to return false.
16
172) extensions_service:
18   A sample implementation of extensions service is provided. You should add your real implementation
19   here. The sample service is built using Android.bp, but you can transform it into a gradle
20   project by adding the stub jar of oem_library (located in
21   out/target/common/obj/JAVA_LIBRARIES/service_based_camera_extensions_intermediates/) to the
22   dependencies.
23
24In this service-based architecture, all functionalities of the Extensions-Interface are supposed to
25be implemented in extensions_service except for ExtensionVersionImpl#checkApiVersion and
26#isAdvancedExtenderImplemented which require you to implement it in the oem_library.