Timeouts support for GStreamer backend#22919
Conversation
|
@alalek Could you take a look? |
|
@asmorkalov , I've added the test to your PR. Also made some cosmetic changes to reduce number of constant being used. And added timeout to the |
|
@mshabunin Thanks a lot for the fix! |
| return false; | ||
|
|
||
| sample.attach(gst_app_sink_pull_sample(GST_APP_SINK(sink.get()))); | ||
| sample.attach(gst_app_sink_try_pull_sample(GST_APP_SINK(sink.get()), readTimeout)); |
There was a problem hiding this comment.
We need a GStreamer version check here.
/build/precommit_custom_linux/4.x/opencv/modules/videoio/src/cap_gstreamer.cpp: In member function 'virtual bool cv::GStreamerCapture::grabFrame()':
/build/precommit_custom_linux/4.x/opencv/modules/videoio/src/cap_gstreamer.cpp:513:85: error: 'gst_app_sink_try_pull_sample' was not declared in this scope
sample.attach(gst_app_sink_try_pull_sample(GST_APP_SINK(sink.get()), readTimeout));
^
with probably CV_LOG_ONCE_INFO() message for old versions.
There was a problem hiding this comment.
I have device with old GSteamer. Will check today and update.
0ac5fc3 to
95ec8c3
Compare
95ec8c3 to
6e4c04b
Compare
|
@asmorkalov when a read timeout occurs, how can I detect a timeout and handle it gracefully? Also, what's the expected behavior of |
…eout Address opencv#22868 Used the same defaults as it's done for FFmpeg ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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 - [x] The PR is proposed to the proper branch - [x] 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 ``` force_builders=Custom build_image:Custom=gstreamer:16.04 buildworker:Custom=linux-1 ```
Address #22868
Used the same defaults as it's done for FFmpeg
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.