Slide 1

Slide 1 text

CameraX

Slide 2

Slide 2 text

MoyuruAizawa Moyuru Aizawa A Software House Pairs Div. Eureka Inc. FRESH LIVE Div CyberAgent Inc. CATS Div. CyberAgent Inc. https://moyuru.io https://cinematic.fm

Slide 3

Slide 3 text

CameraX uses Camera2 API

Slide 4

Slide 4 text

API 21+

Slide 5

Slide 5 text

Consistent across devices

Slide 6

Slide 6 text

‣Automated CameraX test lab ‣Google tests hundreds of devices across all OS layers. ‣Tests run 24 hours a day, seven days a week.

Slide 7

Slide 7 text

‣This test suite is open sourced. ‣You can benchmark … ‣Photo capture latency ‣Startup/shutdown latency ‣…

Slide 8

Slide 8 text

Easy to use

Slide 9

Slide 9 text

‣Provide a use case based API ‣Displays up on screen ‣Gives high quality frames to analyze ‣Takes a picture or a video ‣Lifecycle aware

Slide 10

Slide 10 text

‣Reduced device specific testing ‣75% reduction in lines of code ‣Easier to read code ‣Smaller apk size In case of Camera360 https://play.google.com/store/apps/details?id=vStudio.Android.Camera360

Slide 11

Slide 11 text

val previewConfig = PreviewConfig.Builder().build() val preview = Preview(previewConfig) preview.setOnPreviewOutputUpdateListener { output -> textureView.surfaceTexture = output.surfaceTexture } CameraX.bindToLifecycle(this as LifecycleOwner, preview)

Slide 12

Slide 12 text

val imageAnalysisConfig = ImageAnalysisConfig.Builder() .setTargetResolution(Size(1280, 720)) .build val imageAnalysis = ImageAnalysis(imageAnalysisConfig) imageAnalysis.setAnalyzer { image, rotationDegrees -> // analyze } CameraX.bindToLifecycle(this as LifecycleOwner, imageAnalysis, preview)

Slide 13

Slide 13 text

val imageCaptureConfig = ImageCaptureConfig.Builder() .setTargetRotation(windowManager.defaultDisplay.rotation) .build() val imageCapture = ImageCapture(imageCaptureConfig) CameraX.bindToLifecycle(this as LifecycleOwner, imageCapture, imageAnalysis, preview)

Slide 14

Slide 14 text

val file = File(...) imageCapture.takePicture(file, object: ImageCapture.OnImageSavedListener { override fun onError( error: ImageCapture.UseCaseError, message: String, e: Throwable?) { } override fun onImageSaved(file: File) { } } )

Slide 15

Slide 15 text

CameraX Extensions

Slide 16

Slide 16 text

Portrait

Slide 17

Slide 17 text

Portrait Night

Slide 18

Slide 18 text

Portrait Night HDR

Slide 19

Slide 19 text

Portrait Night HDR Beauty

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Thank you https://www.youtube.com/watch?v=kuv8uK-5CLY