Skip to content

Added experimental NativeCameraView class for Android 24+.#24662

Merged
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/android_native_camera
Dec 11, 2023
Merged

Added experimental NativeCameraView class for Android 24+.#24662
asmorkalov merged 1 commit intoopencv:4.xfrom
asmorkalov:as/android_native_camera

Conversation

@asmorkalov
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov commented Dec 7, 2023

The PR fixes minor issues in cv::VideoCapture implementation for Android and adds experimental NativeCameraView to test it with samples. The NativeCameraView may be tested by samples/android/tutorial-1-camerapreview/res/layout/tutorial1_surface_view.xml modification. Not recommended for production usage. Requires API level 24+ and WITH_ANDROID_NATIVE_CAMERA cmake option enabled.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@mshabunin
Copy link
Copy Markdown
Contributor

mshabunin commented Dec 8, 2023

I tried tutorial-1 witth modified tutorial1_surface_view.xml (changed JavaCameraView to NativeCameraView, right?) and I see memory leak: top command shows very high RES memory grow ~30Mb/sec (meter shows ~14 FPS@1080x720 - it means 1 whole frame is lost for each captured frame).

No leak with JavaCameraView and JavaCamera2View - RES is stable ~ 150-160Mb.

@asmorkalov asmorkalov force-pushed the as/android_native_camera branch from 25a8639 to e5468a8 Compare December 10, 2023 16:52
@asmorkalov asmorkalov merged commit 06ff35c into opencv:4.x Dec 11, 2023
@asmorkalov asmorkalov mentioned this pull request Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants