Improve error reporting

Pass GError around for things that can fail and report the errors back
to the client.

Improve shutdown of pipeline when no clients are consuming.

Make GStreamer elements handle all kinds of data and not just video
because we can.
This commit is contained in:
Wim Taymans 2015-05-15 13:34:32 +02:00
parent 4bc308835a
commit cbe7b52a70
13 changed files with 145 additions and 61 deletions

View file

@ -184,7 +184,8 @@ static PvSourceOutput *
client_create_source_output (PvSource *source,
const gchar *client_path,
GBytes *format_filter,
const gchar *prefix)
const gchar *prefix,
GError **error)
{
PvClientSourcePrivate *priv = PV_CLIENT_SOURCE (source)->priv;
PvSourceOutput *output;
@ -192,7 +193,15 @@ client_create_source_output (PvSource *source,
/* propose format of input */
g_object_get (priv->input, "format", &format_filter, NULL);
output = PV_SOURCE_CLASS (pv_client_source_parent_class)->create_source_output (source, client_path, format_filter, prefix);
output = PV_SOURCE_CLASS (pv_client_source_parent_class)
->create_source_output (source,
client_path,
format_filter,
prefix,
error);
if (output == NULL)
return NULL;
gst_element_set_state (priv->pipeline, GST_STATE_READY);
@ -246,7 +255,8 @@ PvSourceOutput *
pv_client_source_get_source_input (PvClientSource *source,
const gchar *client_path,
GBytes *format_filter,
const gchar *prefix)
const gchar *prefix,
GError **error)
{
PvClientSourcePrivate *priv;
@ -254,7 +264,15 @@ pv_client_source_get_source_input (PvClientSource *source,
priv = source->priv;
if (priv->input == NULL) {
priv->input = PV_SOURCE_CLASS (pv_client_source_parent_class)->create_source_output (PV_SOURCE (source), client_path, format_filter, prefix);
priv->input = PV_SOURCE_CLASS (pv_client_source_parent_class)
->create_source_output (PV_SOURCE (source),
client_path,
format_filter,
prefix,
error);
if (priv->input == NULL)
return NULL;
g_signal_connect (priv->input, "notify::socket", (GCallback) on_input_socket_notify, source);
}
return priv->input;