How to use androidx camera integration-tests examples

259 views
Skip to first unread message

Andrea Turrini

unread,
Oct 30, 2023, 3:21:29 PM10/30/23
to Android CameraX Discussion Group
Hello all, I wanted to implement an app that performs continuous capture like the one implemented in Grafika. I want to use androidx to do this, and I've come to the understanding that I could use the CameraEffect API on the Preview use case to somehow get the frames, save them in a buffer, and display the preview. My question is, how can I use CameraEffect? I tried looking for examples of CameraEffect and found the one on the AndroidX GitHub repository for the integration tests (link), also linked in other discussion here in the androidx cameraX discussion group.

The problem is that if I copy the code for implementing my own surface processor, I get an error (can only be called from within the same library group (referenced groupId=androidx.camera from groupId=Jetpack)). Can anyone tell me if the approach I am taking is correct and, if so, how I can fix/use the example?

Thanks in advance!

Leo Huang

unread,
Oct 31, 2023, 2:41:09 AM10/31/23
to Android CameraX Discussion Group, andrea.t...@gmail.com
Hi,
Since the sample code (link) uses some internal classes/methods inside the CameraX camera-core artifact, you can just copy them to your project to fix the error.
Especially for OpenGlRenderer, you can refer to Grafika and modify it to your own rendering class.

andrea.t...@gmail.com 在 2023年10月31日 星期二凌晨3:21:29 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages