mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-02 00:32:43 +00:00
souphttpsrc: Expose the SoupSession 'timeout' property.
This commit is contained in:
parent
2c2a1738ba
commit
1523ef681b
2 changed files with 19 additions and 4 deletions
|
@ -117,7 +117,8 @@ enum
|
|||
PROP_IRADIO_NAME,
|
||||
PROP_IRADIO_GENRE,
|
||||
PROP_IRADIO_URL,
|
||||
PROP_IRADIO_TITLE
|
||||
PROP_IRADIO_TITLE,
|
||||
PROP_TIMEOUT
|
||||
};
|
||||
|
||||
#define DEFAULT_USER_AGENT "GStreamer souphttpsrc "
|
||||
|
@ -276,6 +277,10 @@ gst_soup_http_src_class_init (GstSoupHTTPSrcClass * klass)
|
|||
g_object_class_install_property (gobject_class, PROP_IS_LIVE,
|
||||
g_param_spec_boolean ("is-live", "is-live", "Act like a live source",
|
||||
FALSE, G_PARAM_READWRITE));
|
||||
g_object_class_install_property (gobject_class, PROP_TIMEOUT,
|
||||
g_param_spec_uint ("timeout", "timeout",
|
||||
"Value in seconds to timeout a blocking I/O (0 = No timeout).", 0,
|
||||
3600, 0, G_PARAM_READWRITE));
|
||||
|
||||
/* icecast stuff */
|
||||
g_object_class_install_property (gobject_class,
|
||||
|
@ -426,9 +431,6 @@ gst_soup_http_src_set_property (GObject * object, guint prop_id,
|
|||
case PROP_IRADIO_MODE:
|
||||
src->iradio_mode = g_value_get_boolean (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
case PROP_AUTOMATIC_REDIRECT:
|
||||
src->automatic_redirect = g_value_get_boolean (value);
|
||||
break;
|
||||
|
@ -475,6 +477,12 @@ gst_soup_http_src_set_property (GObject * object, guint prop_id,
|
|||
g_free (src->proxy_pw);
|
||||
src->proxy_pw = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_TIMEOUT:
|
||||
src->timeout = g_value_get_uint (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
done:
|
||||
return;
|
||||
|
@ -539,6 +547,9 @@ gst_soup_http_src_get_property (GObject * object, guint prop_id,
|
|||
case PROP_PROXY_PW:
|
||||
g_value_set_string (value, src->proxy_pw);
|
||||
break;
|
||||
case PROP_TIMEOUT:
|
||||
g_value_set_uint (value, src->timeout);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -1118,6 +1129,7 @@ gst_soup_http_src_start (GstBaseSrc * bsrc)
|
|||
src->session =
|
||||
soup_session_async_new_with_options (SOUP_SESSION_ASYNC_CONTEXT,
|
||||
src->context, SOUP_SESSION_USER_AGENT, src->user_agent,
|
||||
SOUP_SESSION_TIMEOUT, src->timeout,
|
||||
#ifdef HAVE_LIBSOUP_GNOME
|
||||
SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_PROXY_RESOLVER_GNOME,
|
||||
#endif
|
||||
|
@ -1126,6 +1138,7 @@ gst_soup_http_src_start (GstBaseSrc * bsrc)
|
|||
src->session =
|
||||
soup_session_async_new_with_options (SOUP_SESSION_ASYNC_CONTEXT,
|
||||
src->context, SOUP_SESSION_PROXY_URI, src->proxy,
|
||||
SOUP_SESSION_TIMEOUT, src->timeout,
|
||||
SOUP_SESSION_USER_AGENT, src->user_agent, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,6 +83,8 @@ struct _GstSoupHTTPSrc {
|
|||
gchar *iradio_genre;
|
||||
gchar *iradio_url;
|
||||
gchar *iradio_title;
|
||||
|
||||
guint timeout;
|
||||
};
|
||||
|
||||
struct _GstSoupHTTPSrcClass {
|
||||
|
|
Loading…
Reference in a new issue