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 678546 - hlsdemux: supply a more useful user-agent
hlsdemux: supply a more useful user-agent
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-21 14:38 UTC by Gil Pedersen
Modified: 2018-11-03 13:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
hlsdemux: fetch uri's with souphttpsrc whenever possible (1.59 KB, patch)
2012-06-21 14:40 UTC, Gil Pedersen
none Details | Review
hlsdemux: try to set a user-agent (1.64 KB, patch)
2012-06-21 14:40 UTC, Gil Pedersen
none Details | Review

Description Gil Pedersen 2012-06-21 14:38:57 UTC
The hlsdemux component use the default uri handler to fetch the required resources. When this is HTTP(s) based, it talks to a remote server and exchanges a user-agent that the remote server can use to log the client type and serve specific content to work around known implementation bugs, etc.

A simple "gst-launch playbin uri=xxx" playback on my system reports the user-agent:
 GStreamer souphttpsrc libsoup/2.38.1

Compared to CoreMedia based players this is rather uninformative, where a sample agent is:
 AppleCoreMedia/1.0.0.11E53 (Macintosh; U; Intel Mac OS X 10_7_4; en_us)

I suggest to construct a slightly more informative user-agent, like:
 GStreamer/1.0.0 hlsdemux/0.11.92.1 libsoup/2.38.1

In order to do this reliably (since there is no standardised user-agent get/set interface)  I suggest to always try to use the "souphttpsrc" plugin to fetch the required files, and only use the default uri handler when it fails.

I will attach patches with both features,
Comment 1 Gil Pedersen 2012-06-21 14:40:05 UTC
Created attachment 216928 [details] [review]
hlsdemux: fetch uri's with souphttpsrc whenever possible
Comment 2 Gil Pedersen 2012-06-21 14:40:17 UTC
Created attachment 216929 [details] [review]
hlsdemux: try to set a user-agent
Comment 3 Sebastian Dröge (slomo) 2012-06-25 09:59:52 UTC
Instead of relying on souphttpsrc you could as well check if the element has an "user-agent" property which takes string arguments. See element_has_property() in gst-plugins-base/gst/playback/gstplaysink.c for example.
Comment 4 Gil Pedersen 2012-06-25 13:41:00 UTC
(In reply to comment #3)
> Instead of relying on souphttpsrc you could as well check if the element has an
> "user-agent" property which takes string arguments. See element_has_property()
> in gst-plugins-base/gst/playback/gstplaysink.c for example.

I considered this but I think this is risky since it makes assumptions about the functionality of potentially unknown modules. I don't see a way that we can guarantee that a "user-agent" property works as expected. The souphttpsrc property is already a bit wonky since it interprets a trailing space character in the agent to mean that it should insert an extra string at the end with the libsoup version.

Basing the fetching around a known module also opens up further possibilities, like specifying the cookies and auth headers, or possibly a custom timeout value which might be useful.
Comment 5 Sebastian Dröge (slomo) 2012-06-26 08:06:41 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Instead of relying on souphttpsrc you could as well check if the element has an
> > "user-agent" property which takes string arguments. See element_has_property()
> > in gst-plugins-base/gst/playback/gstplaysink.c for example.
> 
> I considered this but I think this is risky since it makes assumptions about
> the functionality of potentially unknown modules. I don't see a way that we can
> guarantee that a "user-agent" property works as expected. The souphttpsrc
> property is already a bit wonky since it interprets a trailing space character
> in the agent to mean that it should insert an extra string at the end with the
> libsoup version.

While this is potentially true, we're doing the same in other elements too already. This is a bit like an implicit interface and other, new elements (if automatically used) should if possible mimic the behaviour and interface of existing elements.

(This thing about the extra space is interesting though, doesn't really make sense, does it? :) )

> Basing the fetching around a known module also opens up further possibilities,
> like specifying the cookies and auth headers, or possibly a custom timeout
> value which might be useful.

Same as above, any new http source should just do the same as souphttpsrc if it wants to work as good.
Comment 6 Thiago Sousa Santos 2014-12-29 11:18:40 UTC
Any updates?
Comment 7 GStreamer system administrator 2018-11-03 13:12:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/74.