And mention this in docs.
https://bugzilla.gnome.org/show_bug.cgi?id=689326
* file descriptors can be added to multifdsink by emitting the #GstMultiFdSink::add signal.
* For each descriptor added, the #GstMultiFdSink::client-added signal will be called.
*
+ * The multifdsink element needs to be set into READY, PAUSED or PLAYING state
+ * before operations such as adding clients are possible.
+ *
* As of version 0.10.8, a client can also be added with the #GstMultiFdSink::add-full signal
* that allows for more control over what and how much data a client
* initially receives.
GstMultiHandleSinkClass *mhsinkclass =
GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink);
+ if (!sink->running) {
+ g_warning ("Element %s must be set to READY, PAUSED or PLAYING state "
+ "before clients can be added", GST_OBJECT_NAME (sink));
+ return;
+ }
+
mhsinkclass->handle_debug (handle, debug);
GST_DEBUG_OBJECT (sink, "%s adding client, sync_method %d, "
"min_format %d, min_value %" G_GUINT64_FORMAT
GST_END_TEST;
+GST_START_TEST (test_add_client_in_null_state)
+{
+ GstElement *sink;
+
+ sink = setup_multifdsink ();
+
+ ASSERT_WARNING (g_signal_emit_by_name (sink, "add", 99));
+
+ cleanup_multifdsink (sink);
+}
+
+GST_END_TEST;
+
#define fail_unless_read(msg,fd,size,ref) \
G_STMT_START { \
char data[size + 1]; \
suite_add_tcase (s, tc_chain);
tcase_add_test (tc_chain, test_no_clients);
tcase_add_test (tc_chain, test_add_client);
+ tcase_add_test (tc_chain, test_add_client_in_null_state);
tcase_add_test (tc_chain, test_streamheader);
tcase_add_test (tc_chain, test_change_streamheader);
tcase_add_test (tc_chain, test_burst_client_bytes);