Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2023-02-08 18:44:27 +0300
committerJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>2023-02-09 15:07:32 +0300
commit0af7151ae9ec34939c63f1731bde4c77064e9ac3 (patch)
tree2431dba234e776795fc45a06ae059413a5d16a40 /utils/livesync
parentf03ee95bf0726a4bf00559b8658b8ac6162ec84e (diff)
livesync: Extract LiveSync::flow_error
And add details so it behaves more like the `GST_ELEMENT_FLOW_ERROR` macro. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1083>
Diffstat (limited to 'utils/livesync')
-rw-r--r--utils/livesync/src/livesync/imp.rs29
1 files changed, 16 insertions, 13 deletions
diff --git a/utils/livesync/src/livesync/imp.rs b/utils/livesync/src/livesync/imp.rs
index 9fc222577..fb8bc3f9f 100644
--- a/utils/livesync/src/livesync/imp.rs
+++ b/utils/livesync/src/livesync/imp.rs
@@ -624,13 +624,7 @@ impl LiveSync {
if let Err(err) = state.srcresult {
if matches!(err, gst::FlowError::Flushing | gst::FlowError::Eos) {
- let err = state.srcresult.unwrap_err();
- gst::element_imp_error!(
- self,
- gst::StreamError::Failed,
- ("Internal data flow error."),
- ["streaming task paused, reason {} ({:?})", err, err]
- );
+ self.flow_error(err);
}
}
@@ -952,12 +946,7 @@ impl LiveSync {
}
if eos && !matches!(err, gst::FlowError::Flushing | gst::FlowError::Eos) {
- gst::element_imp_error!(
- self,
- gst::StreamError::Failed,
- ("Internal data flow error."),
- ["streaming task paused, reason {} ({:?})", err, err]
- );
+ self.flow_error(err);
pad.push_event(gst::event::Eos::new());
}
@@ -1239,4 +1228,18 @@ impl LiveSync {
true
}
+
+ /// Produces a message like GST_ELEMENT_FLOW_ERROR does
+ fn flow_error(&self, err: gst::FlowError) {
+ let details = gst::Structure::builder("details")
+ .field("flow-return", err.into_glib())
+ .build();
+ gst::element_imp_error!(
+ self,
+ gst::StreamError::Failed,
+ ("Internal data flow error."),
+ ["streaming task paused, reason {} ({:?})", err, err],
+ details: details
+ );
+ }
}