summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Kim <justin.kim@collabora.com>2017-12-04 20:12:40 +0900
committerOlivier CrĂȘte <olivier.crete@collabora.com>2018-02-01 10:12:46 +0000
commitad8a6cb6399c100e3ed74c3672e1cd69a718aa85 (patch)
treeb714496683409bb86d1d11b41a09a5ecffed2a3e
parentdabeed52a995d27e16eba9e4617e61eb0bcd44c4 (diff)
qtmux: send stream warning when refusing video caps
If codec_data is changed, the stream is no longer valid. Rather than keeping running when refusing new caps, this patch send a warning to the bus. Also fix up splitmuxsink to ignore this warning while changing caps. https://bugzilla.gnome.org/show_bug.cgi?id=790000
-rw-r--r--gst/isomp4/gstqtmux.c7
-rw-r--r--gst/multifile/gstsplitmuxsink.c33
2 files changed, 37 insertions, 3 deletions
diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c
index 12a654e61..09357be1b 100644
--- a/gst/isomp4/gstqtmux.c
+++ b/gst/isomp4/gstqtmux.c
@@ -5685,9 +5685,10 @@ refuse_caps:
}
refuse_renegotiation:
{
- GST_WARNING_OBJECT (qtmux,
- "pad %s refused renegotiation to %" GST_PTR_FORMAT, GST_PAD_NAME (pad),
- caps);
+ GST_ELEMENT_WARNING (qtmux, STREAM, FORMAT,
+ ("Can't change input format at runtime."),
+ ("pad %s refused renegotiation to %" GST_PTR_FORMAT, GST_PAD_NAME (pad),
+ caps));
gst_object_unref (qtmux);
return FALSE;
}
diff --git a/gst/multifile/gstsplitmuxsink.c b/gst/multifile/gstsplitmuxsink.c
index 20bded2f8..be37933f0 100644
--- a/gst/multifile/gstsplitmuxsink.c
+++ b/gst/multifile/gstsplitmuxsink.c
@@ -1250,6 +1250,39 @@ bus_handler (GstBin * bin, GstMessage * message)
}
}
break;
+ case GST_MESSAGE_WARNING:
+ {
+ GError *gerror = NULL;
+
+ gst_message_parse_warning (message, &gerror, NULL);
+
+ if (g_error_matches (gerror, GST_STREAM_ERROR, GST_STREAM_ERROR_FORMAT)) {
+ GList *item;
+ gboolean caps_change = FALSE;
+
+ GST_SPLITMUX_LOCK (splitmux);
+
+ for (item = splitmux->contexts; item; item = item->next) {
+ MqStreamCtx *ctx = item->data;
+
+ if (ctx->caps_change) {
+ caps_change = TRUE;
+ break;
+ }
+ }
+
+ GST_SPLITMUX_UNLOCK (splitmux);
+
+ if (caps_change) {
+ GST_LOG_OBJECT (splitmux,
+ "Ignoring warning change from child %" GST_PTR_FORMAT
+ " while switching caps", GST_MESSAGE_SRC (message));
+ gst_message_unref (message);
+ return;
+ }
+ }
+ break;
+ }
default:
break;
}