After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 502335 - [souphttpsrc] some enhancements
[souphttpsrc] some enhancements
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: 0.10.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-12-07 15:51 UTC by Wouter Cloetens
Modified: 2008-01-22 08:58 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch. (23.50 KB, patch)
2007-12-07 15:51 UTC, Wouter Cloetens
none Details | Review
Patch to CVS HEAD supporting seek (28.77 KB, patch)
2007-12-10 14:58 UTC, Wouter Cloetens
needs-work Details | Review
Patch to CVS HEAD without seek (24.25 KB, patch)
2007-12-10 15:23 UTC, Wouter Cloetens
committed Details | Review
use gst_tag_freeform_string_to_utf8() (2.46 KB, patch)
2007-12-11 17:17 UTC, Tim-Philipp Müller
none Details | Review
use gst_tag_freeform_string_to_utf8() and post tags on bus (4.69 KB, patch)
2007-12-12 10:53 UTC, Wouter Cloetens
none Details | Review
use gst_tag_freeform_string_to_utf8() and post tags on bus (4.69 KB, patch)
2007-12-12 11:01 UTC, Wouter Cloetens
committed Details | Review
Seek support for souphttpsrc. (6.31 KB, patch)
2008-01-18 00:04 UTC, Wouter Cloetens
none Details | Review
Seek support for souphttpsrc. (6.22 KB, patch)
2008-01-18 00:09 UTC, Wouter Cloetens
committed Details | Review
Set segment size when it is known. (946 bytes, patch)
2008-01-18 21:55 UTC, Wouter Cloetens
committed Details | Review
Fix seek bug. (1.69 KB, patch)
2008-01-20 00:22 UTC, Wouter Cloetens
committed Details | Review

Description Wouter Cloetens 2007-12-07 15:51:26 UTC
* Improved error reporting discrimitates and exposes location property errors,
  transport errors and HTTP error codes.
* Shoutcast/icecast support. Note: shoutcast server support requires a version
  of libsoup with bug 502325 fixed.
* Support for setting a custom HTTP user-agent header.
* Do not call io_pause() on "finished" handler. It triggers a libsoup assert
  if the  connection failed.
* Implement urihandler interface.
Comment 1 Wouter Cloetens 2007-12-07 15:51:49 UTC
Created attachment 100536 [details] [review]
Patch.
Comment 2 Wouter Cloetens 2007-12-07 15:58:56 UTC
This also implements seek, but only in READY so far, which isn't very useful. That's another TODO which requires more effort...
Comment 3 Sebastian Dröge (slomo) 2007-12-09 05:12:17 UTC
You could use g_value_dup_string() instead of strdup(g_value_get_string()).

Also for seeking you could keep track of your current position and if current_position!=wanted_position in create() you could destroy your connection and create a new one with the correct range.
Comment 4 Wouter Cloetens 2007-12-10 10:24:25 UTC
Thanks for the g_value_dup_string() tip; it was a copy and paste from neonhttpsrc.

If I want to know the required offset, I'll have to drop PushSrc as a base class because it masks that from the arguments to create(). I guess I can fall back to the default implementation of do_seek() in BaseSrc then?
Comment 5 Wouter Cloetens 2007-12-10 14:58:27 UTC
Created attachment 100692 [details] [review]
Patch to CVS HEAD supporting seek

This implements seeking. However, there is no practical use for this. None of the other HTTP sources support seeking (correctly).
I tried mp3 audio, MPEG-1 video (fails to convert time seek to byte seek), QuickTime (does not even try to seek) and motion JPEG AVI (avidemux crashes).
As this is not properly tested for leaks, I'm just attaching this for test purposes. I would not recommend actual use.
Comment 6 Wouter Cloetens 2007-12-10 15:23:37 UTC
Created attachment 100694 [details] [review]
Patch to CVS HEAD without seek

This:
* fixes the suggestion about strdup,
* removes references to seeking abilities,
* does not try to unpause I/O in the "queued" state,
* reorganises a bunch of things,
* uses G_GUINT64_FORMAT instead of hard-coding %llu.
Comment 7 Wim Taymans 2007-12-11 16:39:47 UTC
        Patch by: Wouter Cloetens <wouter at mind dot be>

        * ext/soup/gstsouphttpsrc.c: (_do_init),
        (gst_souphttp_src_class_init), (gst_souphttp_src_init),
        (gst_souphttp_src_dispose), (gst_souphttp_src_set_property),
        (gst_souphttp_src_get_property), (unicodify),
        (gst_souphttp_src_unicodify), (gst_souphttp_src_create),
        (gst_souphttp_src_start), (gst_souphttp_src_stop),
        (gst_souphttp_src_unlock), (gst_souphttp_src_unlock_stop),
        (gst_souphttp_src_get_size), (gst_souphttp_src_is_seekable),
        (soup_got_headers), (soup_got_body), (soup_finished),
        (soup_got_chunk), (soup_response), (soup_parse_status),
        (gst_souphttp_src_uri_get_type),
        (gst_souphttp_src_uri_get_protocols),
        (gst_souphttp_src_uri_get_uri), (gst_souphttp_src_uri_set_uri),
        (gst_souphttp_src_uri_handler_init):
        * ext/soup/gstsouphttpsrc.h:
        Do not try to unpause I/O in the "queued" state.
        Reorganise a bunch of things and cleanups.
        Uses G_GUINT64_FORMAT instead of hard-coding %llu.
        See #502335.
Comment 8 Wim Taymans 2007-12-11 16:40:41 UTC
The seeking thing is still useful but likely needs some more work, I'm not closing this yet.
Comment 9 Wouter Cloetens 2007-12-11 17:01:40 UTC
You probably wanted to put the change list in comment 0 in the ChangeLog instead of the list of incremental improvements to that in comment 6.
I think I'm going to need more input from you guys to understand the expected seek behaviour...
Comment 10 Tim-Philipp Müller 2007-12-11 17:17:41 UTC
Created attachment 100772 [details] [review]
use gst_tag_freeform_string_to_utf8()

Ideally you should also use gst_tag_freeform_string_to_utf8() here instead of the home-baked version that doesn't take into account any environment variables (I've just fixed up gnomevfssrc to do the same, but can't test with souphttpsrc because my soup version is too old).  Would appreciate it if someone could test the patch.
Comment 11 Wouter Cloetens 2007-12-12 10:53:25 UTC
Created attachment 100822 [details] [review]
use gst_tag_freeform_string_to_utf8() and post tags on bus

Post Icecast/Shoutcast tags on bus.

(obsoletes attachment 100772 [details] [review])
Comment 12 Wouter Cloetens 2007-12-12 11:01:59 UTC
Created attachment 100823 [details] [review]
use gst_tag_freeform_string_to_utf8() and post tags on bus

Fix snarf & barf error in that last patch.
Comment 13 Wouter Cloetens 2008-01-17 08:56:00 UTC
Should this bug still be set to 'new' if the patch has already been committed?

Without some guidance on what to do with seeking functionality, I'm stuck there.
Comment 14 Wouter Cloetens 2008-01-18 00:04:14 UTC
Created attachment 103100 [details] [review]
Seek support for souphttpsrc.

Support seek.
Comment 15 Wouter Cloetens 2008-01-18 00:09:06 UTC
Created attachment 103101 [details] [review]
Seek support for souphttpsrc.

Seek support.


The seek patch is updated to apply against CVS HEAD. It has been tested and actually works, in contrast to the original patch. I accidentally left 2 lines of debug cruft in the previous patch.
Comment 16 Sebastian Dröge (slomo) 2008-01-18 05:24:27 UTC
Thanks, committed.
Comment 17 Wouter Cloetens 2008-01-18 21:55:10 UTC
Created attachment 103167 [details] [review]
Set segment size when it is known.

Fix Totem failing to query the duration of the stream.
Comment 18 Sebastian Dröge (slomo) 2008-01-19 14:34:50 UTC
Thanks, committed too :)
Comment 19 Wouter Cloetens 2008-01-20 00:22:36 UTC
Created attachment 103228 [details] [review]
Fix seek bug.

Report the size of the stream as the total size instead of the remaining Content-Length, which is wrong after a seek.
Comment 20 Sebastian Dröge (slomo) 2008-01-20 05:07:35 UTC
Thanks, and again committed :)
Comment 21 Wouter Cloetens 2008-01-22 04:15:50 UTC
This bug can be closed now, I suppose? Everything has been committed.
Further development in bug 510708.