repaired gstreamer camera capture:

1. Enabled property retrieval: height, width, FPS
2. Fixed issue when isOpened returns always true even for non-existing devices
3. Ability to work with non-0 device. Camera capture index is taken into account
This commit is contained in:
Ilya Lavrenov
2015-08-15 18:30:08 +03:00
parent 8d264d9f64
commit dbd7912b88
2 changed files with 83 additions and 53 deletions

View File

@@ -238,10 +238,12 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
#endif
#ifdef HAVE_GSTREAMER
capture = cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, 0);
capture = cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2,
reinterpret_cast<char *>(index));
if (capture)
return capture;
capture = cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L, 0);
capture = cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L,
reinterpret_cast<char *>(index));
if (capture)
return capture;
#endif