Skip to content

Java VideoCapture buffered stream constructor#27284

Merged
asmorkalov merged 17 commits intoopencv:4.xfrom
dkurt:java_video_capture_read
May 14, 2025
Merged

Java VideoCapture buffered stream constructor#27284
asmorkalov merged 17 commits intoopencv:4.xfrom
dkurt:java_video_capture_read

Conversation

@dkurt
Copy link
Copy Markdown
Member

@dkurt dkurt commented May 5, 2025

Pull Request Readiness Checklist

resolves #26809

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

@dkurt dkurt changed the title Java VideoCapture buffered stream Java VideoCapture buffered stream constructor May 5, 2025
@asmorkalov asmorkalov self-requested a review May 5, 2025 16:37
@asmorkalov asmorkalov self-assigned this May 5, 2025
@dkurt dkurt force-pushed the java_video_capture_read branch from 9b46002 to faddefc Compare May 6, 2025 15:13
@dkurt dkurt force-pushed the java_video_capture_read branch 5 times, most recently from 80b985b to 6dfcd4e Compare May 7, 2025 13:40
@dkurt dkurt force-pushed the java_video_capture_read branch from 6dfcd4e to 79afad9 Compare May 7, 2025 13:59
@dkurt dkurt marked this pull request as ready for review May 7, 2025 14:29
@dkurt dkurt requested a review from opencv-alalek May 8, 2025 06:20
@asmorkalov
Copy link
Copy Markdown
Contributor

Great job!

@asmorkalov
Copy link
Copy Markdown
Contributor

Android build error:

 ccache /opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=armv7-none-linux-androideabi21 --sysroot=/opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DCVAPI_EXPORTS -D_USE_MATH_DEFINES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/ci/opencv/modules/core/misc/java/src/cpp -I/home/ci/opencv/modules/imgproc/misc/java/src/cpp -I/home/ci/opencv/modules/ml/misc/java/src/cpp -I/home/ci/opencv/modules/photo/misc/java/src/cpp -I/home/ci/opencv/modules/dnn/misc/java/src/cpp -I/home/ci/opencv/modules/features2d/misc/java/src/cpp -I/home/ci/opencv/modules/imgcodecs/misc/java/src/cpp -I/home/ci/opencv/modules/videoio/misc/java/src/cpp -I/home/ci/opencv/modules/calib3d/misc/java/src/cpp -I/home/ci/opencv/modules/objdetect/misc/java/src/cpp -I/home/ci/opencv/modules/video/misc/java/src/cpp -I/home/ci/opencv/modules/java/generator/src/cpp -I/home/ci/build/o4a/modules/java_bindings_generator/gen/cpp -I/home/ci/opencv/modules/core/include -I/home/ci/opencv/modules/flann/include -I/home/ci/opencv/modules/imgproc/include -I/home/ci/opencv/modules/ml/include -I/home/ci/opencv/modules/photo/include -I/home/ci/opencv/modules/dnn/include -I/home/ci/opencv/modules/features2d/include -I/home/ci/opencv/modules/imgcodecs/include -I/home/ci/opencv/modules/videoio/include -I/home/ci/opencv/modules/calib3d/include -I/home/ci/opencv/modules/objdetect/include -I/home/ci/opencv/modules/video/include -isystem /home/ci/build/o4a -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security     -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments  -fvisibility=hidden -fvisibility-inlines-hidden  -Wno-deprecated-declarations -O3 -DNDEBUG   -DNDEBUG -fPIC -std=c++11 -MD -MT modules/java/jni/CMakeFiles/opencv_java.dir/__/__/videoio/misc/java/src/cpp/videoio_converters.cpp.o -MF modules/java/jni/CMakeFiles/opencv_java.dir/__/__/videoio/misc/java/src/cpp/videoio_converters.cpp.o.d -o modules/java/jni/CMakeFiles/opencv_java.dir/__/__/videoio/misc/java/src/cpp/videoio_converters.cpp.o -c /home/ci/opencv/modules/videoio/misc/java/src/cpp/videoio_converters.cpp
/home/ci/opencv/modules/videoio/misc/java/src/cpp/videoio_converters.cpp:11:39: error: cannot initialize a parameter of type 'JNIEnv **' (aka '_JNIEnv **') with an rvalue of type 'void **'
        res = vm->AttachCurrentThread((void**)&env, NULL);
                                      ^~~~~~~~~~~~
/opt/android-sdk/ndk/26.3.11579264/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/jni.h:1057:39: note: passing argument to parameter 'p_env' here
    jint AttachCurrentThread(JNIEnv** p_env, void* thr_args)
                                      ^
1 error generated.

@dkurt dkurt force-pushed the java_video_capture_read branch from d129930 to f9cb6d4 Compare May 13, 2025 12:05
@dkurt dkurt requested review from asmorkalov and opencv-alalek May 14, 2025 05:30
@dkurt dkurt force-pushed the java_video_capture_read branch from 7ee4ad3 to 797d610 Compare May 14, 2025 07:51
@dkurt dkurt force-pushed the java_video_capture_read branch from 797d610 to c3be053 Compare May 14, 2025 07:51
@asmorkalov
Copy link
Copy Markdown
Contributor

@opencv-alalek Do you have other remarks? Is it ready for merge?

Copy link
Copy Markdown
Contributor

@opencv-alalek opencv-alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 👍

@asmorkalov asmorkalov merged commit 67ba045 into opencv:4.x May 14, 2025
54 of 55 checks passed
@dkurt dkurt deleted the java_video_capture_read branch May 14, 2025 15:31
@asmorkalov asmorkalov mentioned this pull request May 27, 2025
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.

No way to initialize the IStreamReader class in the Java wrapper.

3 participants