From: Maksim Shabunin Date: Sat, 9 Nov 2019 11:19:23 +0000 (+0000) Subject: Fixed relative paths handling in cap_gstreamer: X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1^2~60^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fccf28408818a112d64fe9c5d0ad4a392359d61c;p=platform%2Fupstream%2Fopencv.git Fixed relative paths handling in cap_gstreamer: --- diff --git a/modules/videoio/src/cap_gstreamer.cpp b/modules/videoio/src/cap_gstreamer.cpp index 585f439..f0a4f8e 100644 --- a/modules/videoio/src/cap_gstreamer.cpp +++ b/modules/videoio/src/cap_gstreamer.cpp @@ -748,18 +748,20 @@ bool GStreamerCapture::open(const String &filename_) // else, we might have a file or a manual pipeline. // if gstreamer cannot parse the manual pipeline, we assume we were given and // ordinary file path. + CV_LOG_INFO(NULL, "OpenCV | GStreamer: " << filename); if (!gst_uri_is_valid(filename)) { if (utils::fs::exists(filename_)) { - uri.attach(g_filename_to_uri(filename, NULL, NULL)); + GSafePtr err; + uri.attach(gst_filename_to_uri(filename, err.getRef())); if (uri) { file = true; } else { - CV_WARN("Error opening file: " << filename << " (" << uri.get() << ")"); + CV_WARN("Error opening file: " << filename << " (" << err->message << ")"); return false; } } @@ -779,7 +781,7 @@ bool GStreamerCapture::open(const String &filename_) { uri.attach(g_strdup(filename)); } - + CV_LOG_INFO(NULL, "OpenCV | GStreamer: mode - " << (file ? "FILE" : manualpipeline ? "MANUAL" : "URI")); bool element_from_uri = false; if (!uridecodebin) {