提交 fccf2840 编写于 作者: M Maksim Shabunin

Fixed relative paths handling in cap_gstreamer:

上级 cfc78194
...@@ -748,18 +748,20 @@ bool GStreamerCapture::open(const String &filename_) ...@@ -748,18 +748,20 @@ bool GStreamerCapture::open(const String &filename_)
// else, we might have a file or a manual pipeline. // else, we might have a file or a manual pipeline.
// if gstreamer cannot parse the manual pipeline, we assume we were given and // if gstreamer cannot parse the manual pipeline, we assume we were given and
// ordinary file path. // ordinary file path.
CV_LOG_INFO(NULL, "OpenCV | GStreamer: " << filename);
if (!gst_uri_is_valid(filename)) if (!gst_uri_is_valid(filename))
{ {
if (utils::fs::exists(filename_)) if (utils::fs::exists(filename_))
{ {
uri.attach(g_filename_to_uri(filename, NULL, NULL)); GSafePtr<GError> err;
uri.attach(gst_filename_to_uri(filename, err.getRef()));
if (uri) if (uri)
{ {
file = true; file = true;
} }
else else
{ {
CV_WARN("Error opening file: " << filename << " (" << uri.get() << ")"); CV_WARN("Error opening file: " << filename << " (" << err->message << ")");
return false; return false;
} }
} }
...@@ -779,7 +781,7 @@ bool GStreamerCapture::open(const String &filename_) ...@@ -779,7 +781,7 @@ bool GStreamerCapture::open(const String &filename_)
{ {
uri.attach(g_strdup(filename)); uri.attach(g_strdup(filename));
} }
CV_LOG_INFO(NULL, "OpenCV | GStreamer: mode - " << (file ? "FILE" : manualpipeline ? "MANUAL" : "URI"));
bool element_from_uri = false; bool element_from_uri = false;
if (!uridecodebin) if (!uridecodebin)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册