Closed legosaro closed 1 month ago
Hello,
What do you means with "place an object in front of camera"? Do you have a code example to reproduce the error?
When an object, like a finger, was placed over the lens. The code I am using is the "rotation" example.
Again, I don't understand you. Can you share a full code example to reproduce the error?
To reproduce the error, I am using the RootEncoder sample app. I tested the same code on a smartphone, and it works correctly. However, on my device, it only works if I use rootEncoder 2.4.9.
What are you doing to reproduce it? Can you describe steps?
I'm not able to reproduce it.
Can you reproduce it using the last commit in master branch? Can you reproduce it using other device? If not, can you tell me your device model that fail? Also, check if it is working in version 2.5.0 to know if the error is in that version or last version
Pedro, thank you for your responses. Yes, I have tried both version 2.5.0 and the last commit on the master branch, and unfortunately, I get the same behavior as with 2.5.1.
Ok, so version 2.5.0 also have this bug. I did a refactor to camera2 manager in that version
Can you reproduce this error using the library in this commit? https://github.com/pedroSG94/RootEncoder/tree/e4c2575a7fcaa532a7ac3af43e88dc5fdeafaaa5 Also, tell me the Android version of your device
In this commit, the issue is not reproduced.
Can you reproduce this error using the library in this commit? https://github.com/pedroSG94/RootEncoder/tree/e4c2575a7fcaa532a7ac3af43e88dc5fdeafaaa5
I'm testing it on a device running Android 13.
Ok, this is related with the camera2 refactor. Try using the last commit in master replace this method: https://github.com/pedroSG94/RootEncoder/blob/master/encoder/src/main/java/com/pedro/encoder/input/video/Camera2ApiManager.kt#L853 To:
@Suppress("DEPRECATION")
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
private fun createCaptureSession(
cameraDevice: CameraDevice,
surfaces: List<Surface>,
onConfigured: (CameraCaptureSession) -> Unit,
onConfiguredFailed: (CameraCaptureSession) -> Unit,
handler: Handler?
) {
val callback = object: CameraCaptureSession.StateCallback() {
override fun onConfigured(cameraCaptureSession: CameraCaptureSession) {
onConfigured(cameraCaptureSession)
}
override fun onConfigureFailed(cameraCaptureSession: CameraCaptureSession) {
onConfiguredFailed(cameraCaptureSession)
}
}
cameraDevice.createCaptureSession(surfaces, callback, handler)
}
unfortunately it doesn't fix
Hello,
Can you try using this branch? https://github.com/pedroSG94/RootEncoder/tree/fix/camera2
I’m sorry to report that the issue persists
Get the last commit and try again please.
The issue persists
I'm not sure where is the error.
Only to discard. I did a new commit using the old camera2 implementation. Can you confirm me if all is working?
After that, I will do a line by line minimal migration
Sorry, the problem persists. Just to be safe, I tried this commit again
https://github.com/pedroSG94/RootEncoder/tree/e4c2575a7fcaa532a7ac3af43e88dc5fdeafaaa5
and it works fine.
Ok, the error is not related with the camera2 implementation. I will need find the exact commit that produce the error. Only to confirm, the version 2.5.0 fail, right?
Try this commits: https://github.com/pedroSG94/RootEncoder/tree/ed2768512df7d179bde119c421abb366811e437c https://github.com/pedroSG94/RootEncoder/tree/6f21355eb795a0312bae53881dac085c8019cbae https://github.com/pedroSG94/RootEncoder/tree/d81223d222c7e427e040d2cc13d2a7f24647bd7a Let me know in which commit fail.
I tried all of these commits, but the issue is present in all of them
I tried this one:
https://github.com/pedroSG94/RootEncoder/tree/e4c2575a7fcaa532a7ac3af43e88dc5fdeafaaa5
and work fine
Ok, Are you sure that the last commit of https://github.com/pedroSG94/RootEncoder/tree/fix/camera2 produce this error?
The last commit is using this camera implementation: https://github.com/pedroSG94/RootEncoder/blob/fix/camera2/encoder/src/main/java/com/pedro/encoder/input/sources/video/Camera2Source.kt#L38 Which is the same that in commit: https://github.com/pedroSG94/RootEncoder/tree/e4c2575a7fcaa532a7ac3af43e88dc5fdeafaaa5
Also, I did a new branch from https://github.com/pedroSG94/RootEncoder/tree/d81223d222c7e427e040d2cc13d2a7f24647bd7a but using old camera implementation to discard that the error is not related with the code migration but it is in other class: https://github.com/pedroSG94/RootEncoder/tree/test/camera2old
Let me know the result of your tests.
Sorry for this but I haven't other way to detect the error.
The issue was introduced in this commit:
https://github.com/pedroSG94/RootEncoder/tree/d81223d222c7e427e040d2cc13d2a7f24647bd7a
What about this branch? https://github.com/pedroSG94/RootEncoder/tree/test/camera2old
This is to discard/confirm that the camera2 implementation produce the issue and not other classes of that commit.
After that, please try again get the last commit of this branch: https://github.com/pedroSG94/RootEncoder/tree/fix/camera2
Let me know the results.
Both branches are experiencing the same problem. I tried revision e4c2575 and it works fine. I also tested revision d81223d, and the problem is present here
This branch should reverse the error: https://github.com/pedroSG94/RootEncoder/tree/fix/reverse-camera2-fix
What about this branch? https://github.com/pedroSG94/RootEncoder/tree/test/camera2old
This is to discard/confirm that the camera2 implementation produce the issue and not other classes of that commit.
After that, please try again get the last commit of this branch: https://github.com/pedroSG94/RootEncoder/tree/fix/camera2
Let me know the results.
Sorry Pedro, I recompiled both branches, and they are working correctly
Ok, this is a good news. I will do migration steps by steps and with that we can know the line that fail.
Hello,
I did the migration with multiple commits to detect the error. First, test this commit to confirm that all is working: https://github.com/pedroSG94/RootEncoder/tree/49bc4793a0ceb5edc1b5f0ebf76b4627c2770012
After that, test this commits: https://github.com/pedroSG94/RootEncoder/tree/da7e73be00d12ed06bd7e695bc5d2efca015a65c https://github.com/pedroSG94/RootEncoder/tree/614e1a3acebe19213d3c4a20bfb65a490329789f https://github.com/pedroSG94/RootEncoder/tree/614e1a3acebe19213d3c4a20bfb65a490329789f https://github.com/pedroSG94/RootEncoder/tree/9f31066f8ad8ba0292bdb7541489f48cd5d95da9 https://github.com/pedroSG94/RootEncoder/tree/83ce2e768e632da74773db0b2cbeebd4fa6e4c0e https://github.com/pedroSG94/RootEncoder/tree/882c35e917958fb6fbc63228566f62e13bb8dd98 https://github.com/pedroSG94/RootEncoder/tree/49137708453dac411bbade652f4dc39faab33ac2 https://github.com/pedroSG94/RootEncoder/tree/9c1cc84bbe36c839e4f461cbdf136b07624a766b https://github.com/pedroSG94/RootEncoder/tree/a87a4ad2553012e0407406c1997b1da9ba3e3889
All this commits are in order to test. The idea is find the commit that fail
Hello, thanks a lot Pedro. The commit that failed is: https://github.com/pedroSG94/RootEncoder/tree/83ce2e768e632da74773db0b2cbeebd4fa6e4c0e
Hello,
I did a fix for that method that should solve the problem: https://github.com/pedroSG94/RootEncoder/tree/bcf95e720e621cb6a72f240a6fc2a3509939ab23
Let me know if this solve the problem and I will merge the error into master
That's perfect, the problem has been completely resolved now
Closed as solved. The fix will be available in version 2.5.2
I am experiencing an issue with the Camera2Source library when using version 2.5.1 of RootEncoder. If I place an object in front of the camera, the streaming freezes. This behavior did not occur with version 2.4.9, where the streaming continued to work properly even when an object was placed in front of the camera.