Commit graph

119 commits

Author SHA1 Message Date
Sebastian Dröge
847ba2a30d souphttpsrc: Also retry on unexpected network failures 2014-04-10 16:47:21 +02:00
Sebastian Dröge
037dfb6723 souphttpsrc: New property to specify the maximum number of retries before we give up 2014-04-10 16:47:07 +02:00
Alexander Zallesov
b089524b21 souphttpsrc: Change default timeout to 15 seconds
If nothing happens after 15 seconds, chances are good that
our connection will never will work. Stop after 15 seconds
instead of waiting until the system's default timeout, which
can be > 1 minute.
2014-04-10 11:11:35 +02:00
Sebastian Dröge
d918212e12 souphttpsrc: Use GST_FLOW_FLUSHING when flushing, not GST_FLOW_EOS
... and reset it properly after flushing is done. Fixes playback
in many cases when buffering is used.

https://bugzilla.gnome.org/show_bug.cgi?id=727821
2014-04-09 10:56:29 +02:00
Sebastian Dröge
5d06735dbd souphttpsrc: Add properties for selecting SSL/TLS certificate checking
And by default properly check certificates against the system's CA
certificates. Everything else is not a good default at all.
2014-03-12 15:32:55 +01:00
Sebastian Dröge
ac83961033 souphttpsrc: Make sure to not return EOS immediately if we finished a range request
Only return EOS the next time create() is called, if at all. basesrc
should already take care of not calling it again.

Also always return immediately if the previous flow return was
not OK. This indicates an error somewhere.
2014-03-07 16:56:51 +01:00
Sebastian Dröge
9701051485 souphttpsrc: Don't forget to quit mainloop after we cancelled when we got data after the stop position 2014-03-06 13:38:09 +01:00
Sebastian Dröge
0c6f1ce998 souphttpsrc: If we had a stop position, allow for the server to finish our connection instead of just cancelling
Otherwise keep-alive does not make much sense and also the server will have
confusing things in the logs.
2014-03-06 13:36:38 +01:00
Branislav Katreniak
6f1d4da8b4 souphttpsrc: do not emit error when connection with unknown size ends
Commit 46fd12ae5e introduced connection
recovery. But when server does not specify content-size,
souphttpsrc tries to reconnect even after regular end of stream.
Http server replies  with SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE
but souphttpsrc still emits error instead of EOS.

https://bugzilla.gnome.org/show_bug.cgi?id=724717

Signed-off-by: Branislav Katreniak <bkatreniak@nuvotechnologies.com>
2014-02-19 16:59:16 +01:00
Sebastian Dröge
fdb39a9f7b souphttpsrc: Use new automatic_eos API from basesrc
We want to notice ourselves that we're EOS. Otherwise we will
always cancel requests in the very end and confuse the server...
and also make it impossible to use persistent connections.
2014-02-13 12:09:13 +01:00
Sebastian Dröge
4dfad42e81 souphttpsrc: Consistently use have_size instead of content_size!=0 2014-02-13 11:11:13 +01:00
Sebastian Dröge
dde171ac30 souphttpsrc: Free extra headers when finalizing the element
It's set as property by the application, we should not just reset
properties when going back to READY.
2014-02-13 10:36:29 +01:00
Sebastian Dröge
a79f92ee9d souphttpsrc: Properly close the session when going back to NULL
Don't wait for that until the element is disposed.
2014-02-13 10:36:29 +01:00
Andoni Morales Alastruey
4d80d3fad9 souphttpsrc: add support for keep-alive sessions
https://bugzilla.gnome.org/show_bug.cgi?id=699926
2014-02-13 10:36:29 +01:00
Sebastian Dröge
106bc2b17b souphttpsrc: Add "compress" property to enable/disable automatic gzip/deflate content encoding handling 2014-02-12 13:00:13 +01:00
Sebastian Dröge
9cac68709a souphttpsrc: Retry connection if we're finished before the content size only if we actually have a content size
https://bugzilla.gnome.org/show_bug.cgi?id=722185
2014-02-12 12:39:10 +01:00
Reynaldo H. Verdejo Pinochet
4f42fff349 souphttp*: add ability to do HTTP session logging
This changeset adds the loggin infrastructure and
mods both souphttpsrc and souphttclientsink to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=721764
2014-02-11 17:50:44 -03:00
Sebastian Dröge
cf31a4284b souphttpsrc: Add mapping for NOT_FOUND and NOT_AUTHORIZED errors 2014-02-11 13:25:46 +01:00
Sebastian Dröge
5514bc2785 souphttpsrc: Don't duplicate status_code to GStreamer error mapping 2014-02-11 13:25:22 +01:00
Reynaldo H. Verdejo Pinochet
0e159e3b03 souphttpsrc: use status code macro instead of 407
Rest of the code is using the _PROXY_AUTHENTICATION_REQUIRED
macro too. Easier to understand if you don't recall HTTP
error codes by heart.
2014-01-03 14:15:59 -03:00
Thiago Santos
856c07ea00 souphttpsrc: do not emit EOS when connection drops
If the pipeline is stalled for too long, souphttpsrc will block and
stop fetching data from the network. This can cause the connection to
drop and souphttpsrc would handle it as an EOS. This patch makes it
persist and try to fetch more data until the end of the content length
or until receiving an error that it is beyong limits in case the content
is unknown.

https://bugzilla.gnome.org/show_bug.cgi?id=683536
2013-10-11 16:10:16 -03:00
Thiago Santos
c84282b9a6 souphttpsrc: do not do http requests in READY
HEAD requests to discover if the server is seekable shouldn't be done in
READY as it might lock the main thread that is doing the state change.

https://bugzilla.gnome.org/show_bug.cgi?id=705371
2013-09-18 18:36:38 +02:00
Tim-Philipp Müller
604bfa586e soup: don't use deprecated soup_message_headers_get() API 2013-08-14 11:54:19 +01:00
Andoni Morales Alastruey
24b4ea3418 souphttpsrc: fix critical setting a NULL uri redirection 2013-08-13 12:02:29 +02:00
Andoni Morales Alastruey
b9faeab236 souphttpsrc: add redirection to the URI query 2013-08-12 16:40:26 +02:00
Arnaud Vrac
e67655608c souphttpsrc: always ignore HEAD errors
https://bugzilla.gnome.org/show_bug.cgi?id=704241
2013-07-25 18:01:30 +02:00
Thiago Santos
9a7321872f souphttpsrc: ignore errors from HEAD request
HEAD requests are used to check the server headers to see if it
seekable. Ignore errors from those requests as they shouldn't be
critical.

https://bugzilla.gnome.org/show_bug.cgi?id=704053
2013-07-12 10:01:26 +02:00
Andoni Morales Alastruey
66dbe3151a souphttpsrc: also consider stop positions in seeks
Use seek stop position as range end for requests

https://bugzilla.gnome.org/show_bug.cgi?id=702206
2013-07-01 13:55:13 -03:00
Thiago Santos
5bc5f4a0f6 souphttpsrc: allow seeks in ready
On is_seekable, check if the server's headers have already been
received. If not, do a HEAD request to get them before responding
to basesrc.

https://bugzilla.gnome.org/show_bug.cgi?id=702206
2013-07-01 13:55:13 -03:00
Sebastian Dröge
c43e7001ab souphttpsrc: Don't consider the content size from the HTTP headers as absolutely correct
The HTTP server could give wrong information, e.g. if the HTTP stream is
chunk-encoded or compressed, or if the server does not know the complete size
at the time when the file is requested by the client.

Also see
https://bugs.webkit.org/show_bug.cgi?id=115354
2013-05-04 13:22:04 +02:00
Philippe Normand
d975a70f12 souphttpsrc: fix SCHEDULING query support
Chain the query up to parent before adding _BANDWIDTH_LIMITED flag,
so that all the other flags get set, and push mode gets added as
supported activation mode.

https://bugzilla.gnome.org/show_bug.cgi?id=693484
https://bugzilla.gnome.org/show_bug.cgi?id=698156
2013-04-16 19:53:18 +01:00
Philippe Normand
b857cb38dd souphttpsrc: basic scheduling query support
Answer to scheduling queries with default parameters and the new
_BANDWIDTH_LIMITED_FLAG so that downstream is advised to minimize seek
operations and perform on-disk buffering if possible.

Bug 693484
2013-04-16 16:46:20 +02:00
Tim-Philipp Müller
24bc3c46f9 souphttpsrc: add back "iradio-mode" property to disable sending of icecast request headers
In 1.0 we now always send the icecast request headers by default, which
makes the server send icecasts metadata inserted into the stream if it
supports that. However, there are some use cases where this is not
desirable, like when just saving a radio stream to disk, so add back
the "iradio-mode" property to allow people to disable this.

https://bugzilla.gnome.org/show_bug.cgi?id=697984
2013-04-14 12:39:28 +01:00
Tim-Philipp Müller
a3e1db1292 soup: use default proxy resolver instead of deprecated GNOME proxy resolver
Apparently there's no reason to use it any longer. Drop libsoup-gnome
dependency while at it, now that we don't need anything from it any
more (it only consists entirely of deprecated API now anyways).

https://bugzilla.gnome.org/show_bug.cgi?id=693911
2013-02-16 15:48:06 +00:00
Norbert Waschbuesch
c00b142f44 souphttpsrc: error out properly when receiving data along with an error status
When receiving an error code from the http server, such as 404,
data might be sent along with it, like a web page. We don't want
to output that data in this case, and we also want to pass the
FLOW_ERROR return back to the base class, so it can stop properly.

https://bugzilla.gnome.org/show_bug.cgi?id=678429
2013-01-01 19:11:42 +00:00
Tim-Philipp Müller
b27ac94af2 gst_message_new_duration -> gst_message_new_duration_changed 2012-09-02 01:31:53 +01:00
Tim-Philipp Müller
4bb52bbadf docs: gst-launch -> gst-launch-1.0 and ffmpegcolorspace -> videoconvert 2012-08-27 21:20:30 +01:00
Tim-Philipp Müller
c074bfd0b9 gst_tag_list_free -> gst_tag_list_unref 2012-08-04 16:10:16 +01:00
Sebastian Dröge
0827f54b93 tag: Update for taglist/tag event API changes 2012-07-28 00:19:51 +02:00
Alban Browaeys
0c24e92308 soup: deprecated soup_message_headers _get -> _get_one
https://bugzilla.gnome.org/show_bug.cgi?id=680206
2012-07-18 22:48:08 +01:00
Wim Taymans
b5df4f0e62 update for tag event change 2012-06-06 13:02:12 +02:00
Jens Georg
982c1b479f soup: Drop transferMode.dlna.org header
Leave it to the application to decide on the header. No header at all
is better than having the wrong header as DLNA mandates that a missing
header has to be tolerated while a wrong header is an error.

https://bugzilla.gnome.org/show_bug.cgi?id=676020
2012-05-28 15:22:55 +02:00
Tim-Philipp Müller
95f6e0dbe4 souphttpsrc: fix possible data corruption after seeking
Consider a downstream element that may issue seeks in very short
succession (e.g. queue2), depending on the access pattern of
the downstream element (e.g. qtdemux with audio/video chunks
interleaved so that there's always a sizeable gap between the
current chunks for each stream). In this case, queue2 will maintain
two ranges, and even when it serves a chunk from memory, it will
switch ranges and make souphttpsrc seek to the end of the available
data for that range, assuming that that's where we'll want to
continue reading from next.

This may lead to the following seek request pattern:

 - source reading position A
 - seek to B
 - now reading position still A, requested_postion is B
 - streaming thread to be restarted to continue from B
 - seek to A, before streaming thread had time to do the seek
 - do_seek() now sees reading position == seek position and
   returns early.
 - however, requested position is still B from the earlier
   seek request
 - streaming thread starts up, sees that a seek to B is pending
   and requests data from B from the server, while the GstBaseSrc
   segment has of course been updated/reset to position A, which
   was the last seek request.
 - we will now send data for position B and pretend that's the
   data from position A (via the newsegment event, etc.)
 - this causes data corruption

Reproducible doing seek-emulated fast-forward/backward on 006648.
2012-05-16 08:31:15 +01:00
Bastien Nocera
933986fccc soup: Handle icy and icyx URI schemes
As handled by QuickTime (for icy), and Orban/Coding Technologies
AAC/aacPlus Player (for icyx). See also:
https://bugzilla.gnome.org/show_bug.cgi?id=394207
https://bugzilla.gnome.org/show_bug.cgi?id=403285

https://bugzilla.gnome.org/show_bug.cgi?id=673899
2012-04-23 15:34:54 +02:00
Tim-Philipp Müller
e09ae5736d Use new gst_element_class_set_static_metadata() 2012-04-10 00:51:41 +01:00
Wim Taymans
88733ea2f8 soup: fix caps 2012-02-07 10:30:28 +01:00
Wim Taymans
b4630dd3e0 more memory API porting 2012-01-25 12:30:29 +01:00
Sebastian Dröge
e3c8c4f8b0 souphttpsrc: Fix buffer handling
souphttpsrc is now usable again and doesn't crash anymore
whenever something is read from a HTTP connection.
2012-01-11 14:10:46 +01:00
Wim Taymans
5fd2b7abe3 GST_FLOW_UNEXPECTED -> GST_FLOW_EOS 2012-01-03 15:26:21 +01:00
Tim-Philipp Müller
2cfb92f253 souphttpsrc: get rid of iradio-* properties, post tags instead 2011-11-24 01:45:43 +00:00