mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
gio: Post a custom "not-mounted" message on the bus
This allows applications to mount the GFile if possible and restart the pipeline instead of simply giving an error.
This commit is contained in:
parent
fa0a5a667f
commit
ce08823dc5
1 changed files with 8 additions and 0 deletions
|
@ -298,6 +298,14 @@ gst_gio_src_get_stream (GstGioBaseSrc * bsrc)
|
|||
if (GST_GIO_ERROR_MATCHES (err, NOT_FOUND)) {
|
||||
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
|
||||
("Could not open location %s for reading: %s", uri, err->message));
|
||||
} else if (GST_GIO_ERROR_MATCHES (err, NOT_MOUNTED)) {
|
||||
gst_element_post_message (GST_ELEMENT_CAST (src),
|
||||
gst_message_new_element (GST_OBJECT_CAST (src),
|
||||
gst_structure_new ("not-mounted", "file", G_TYPE_FILE, src->file,
|
||||
"uri", G_TYPE_STRING, uri, NULL)));
|
||||
|
||||
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, (NULL),
|
||||
("Location %s not mounted: %s", uri, err->message));
|
||||
} else {
|
||||
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ, (NULL),
|
||||
("Could not open location %s for reading: %s", uri, err->message));
|
||||
|
|
Loading…
Reference in a new issue