GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit 183695c6 authored by Thiago Santos's avatar Thiago Santos
Browse files

souphttpsrc: refactor to use Soup's sync API

Replace the async API with the sync API to remove all the extra mainloop
and context handling. Currently it blocks reading until 'blocksize'
bytes are available but that can be improved by using:

https://developer.gnome.org/gio/unstable/GPollableInputStream.html#g-pollable-input-stream-read-nonblocking

https://bugzilla.gnome.org/show_bug.cgi?id=693911
parent 79e52b9f
This diff is collapsed.
...@@ -59,16 +59,9 @@ struct _GstSoupHTTPSrc { ...@@ -59,16 +59,9 @@ struct _GstSoupHTTPSrc {
gchar *proxy_id; /* Authentication user id for proxy URI. */ gchar *proxy_id; /* Authentication user id for proxy URI. */
gchar *proxy_pw; /* Authentication user password for proxy URI. */ gchar *proxy_pw; /* Authentication user password for proxy URI. */
gchar **cookies; /* HTTP request cookies. */ gchar **cookies; /* HTTP request cookies. */
GMainContext *context; /* I/O context. */
GMainLoop *loop; /* Event loop. */
SoupSession *session; /* Async context. */ SoupSession *session; /* Async context. */
GstSoupHTTPSrcSessionIOStatus session_io_status;
/* Async I/O status. */
SoupMessage *msg; /* Request message. */ SoupMessage *msg; /* Request message. */
GstFlowReturn ret; /* Return code from callback. */ GstFlowReturn ret; /* Return code from callback. */
GstBuffer **outbuf; /* Return buffer allocated by callback. */
gboolean interrupted; /* Signal unlock(). */
gboolean retry; /* Should attempt to reconnect. */
gint retry_count; /* Number of retries since we received data */ gint retry_count; /* Number of retries since we received data */
gint max_retries; /* Maximum number of retries */ gint max_retries; /* Maximum number of retries */
gchar *method; /* HTTP method */ gchar *method; /* HTTP method */
...@@ -94,6 +87,9 @@ struct _GstSoupHTTPSrc { ...@@ -94,6 +87,9 @@ struct _GstSoupHTTPSrc {
GTlsDatabase *tls_database; GTlsDatabase *tls_database;
GTlsInteraction *tls_interaction; GTlsInteraction *tls_interaction;
GCancellable *cancellable;
GInputStream *input_stream;
/* Shoutcast/icecast metadata extraction handling. */ /* Shoutcast/icecast metadata extraction handling. */
gboolean iradio_mode; gboolean iradio_mode;
GstCaps *src_caps; GstCaps *src_caps;
...@@ -110,7 +106,7 @@ struct _GstSoupHTTPSrc { ...@@ -110,7 +106,7 @@ struct _GstSoupHTTPSrc {
guint timeout; guint timeout;
GMutex mutex; GMutex mutex;
GCond request_finished_cond; GCond have_headers_cond;
GstEvent *http_headers_event; GstEvent *http_headers_event;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment