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 709117 - souphttpsrc: Need ability to exclude HTTP Range header and set content size
souphttpsrc: Need ability to exclude HTTP Range header and set content size
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 709455
 
 
Reported: 2013-09-30 17:01 UTC by Lori Anderson
Modified: 2018-11-03 14:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch to add exclude-range-header & set content-size (10.08 KB, patch)
2013-09-30 17:09 UTC, Lori Anderson
none Details | Review

Description Lori Anderson 2013-09-30 17:01:50 UTC
Need to be able to disable the inclusion of the range header by souphttpsrc. The HTTP Range header is not allowed for dtcp encyrpted content. Also the HTTP Range header interferes with the usage of TimeSeekRange.dlna.org and Playspeed.dlna.org headers. The Range header should not be included when these other headers are added or for dtcp encrypted content. The proper headers will be added by the dlnasrc element which is a "manager" type element and will set the "exclude-range-header" property on souphttpsrc.  The souphttpsrc will still use the starting byte position and all the same logic should be performed by souphttpsrc and basesrc,  

The attached patch creates a boolean property "exclude-range-header" which specifies if the Range header should be included.  The default is false.  When false, souphttpsrc will include the Range header as it does currently.  When this property is set to true, souphttpsrc will formulate the HTTP request as it does now except it will not include the Range header.  It will be the responsibility of the dlnasrc "manager" element to do this.

If the HTTP Range header is not included, souphttpsrc will not be able to determine the size of the content.  The ability to set the content size is needed when the Range header is not included.  This patch adds the ability to set the content size through the "content-size" property.  The dlnasrc "manager" element will set the size as necessary such as for dtcp/ip encrypted content.
Comment 1 Tim-Philipp Müller 2013-09-30 17:06:58 UTC
Which patch?
Comment 2 Lori Anderson 2013-09-30 17:09:21 UTC
Created attachment 256121 [details] [review]
Proposed patch to add exclude-range-header & set content-size
Comment 3 Sebastian Dröge (slomo) 2013-10-03 10:54:35 UTC
I'm not sure if this is a good solution, it seems rather specific for this special use case. Maybe we can come up with something better... maybe signals on souphttpsrc to modify message before they're sent and before they're parsed by souphttpsrc.
Comment 4 Lori Anderson 2013-10-03 15:32:00 UTC
The "content-size" is already a property so this change makes it "writable".  Would you agree it should remain a property?  Or should I use a signal to set the property rather than making the property "writable"?

The "exclude-range-header" seemed similar to the "include-extra-headers" property that's why I chose to make it a property.  Maybe it should be more general purpose such as "exclude-headers" and provide a list of headers to exclude?     

I am not too familiar with signals.  I will investigate more and see if I can propose a solution using signals.
Comment 5 Lori Anderson 2013-10-03 20:19:54 UTC
Have discussed this some with another developer, we could have souphttpsrc emit a signal when it is about to send out a request.  The request could be modified and returned by listeners.  This approach could also replace the "include-extra-headers" property.  What do you think?
Comment 6 Tim-Philipp Müller 2013-10-04 10:20:48 UTC
Could you please provide your name for proper patch attribution?

I think making the content-size property writable makes sense.

I'm undecided about the range header, I don't like the "exclude-range-header" property either.

It sounds like this should all be looked at with the bigger picture (various DLNA use cases we don't handle properly yet, like TIME seeking) in mind, instead doing things piecemeal.
Comment 7 Lori Anderson 2013-10-04 18:57:38 UTC
My name is Lori Anderson.  I am a consultant with CableLabs.  We are currently working on a gstreamer element which we plan to contribute to the GStreamer project called "dlnasrc" which is a manager type element.  It supports a media player pipeline within the WebKit framework.  The dlnasrc creates a bin and includes the souphttpsrc element a the source for the pipeline. It will also include a dtcp/ip decrypter element (another element we plan on submitting - dtcpip) which is responsible for the decryption of content.  

My design approach was to minimize any changes to souphttpsrc and exclude any special dlna requirements from souphttpsrc.  The dlnasrc element would have the logic to deal with dlna requirements.
  
I am not sure how the process works to submit elements for contribution but perhaps looking at the dlnasrc element would shed more light onto the changes needed to souphttpsrc.  How does the process work?  I think we are ready to start the submission process.
Comment 8 Lori Anderson 2013-10-04 23:27:42 UTC
I have submitted the dlnasrc for contribution to the gstreamer project - see Bug #709455
Comment 9 Sebastian Dröge (slomo) 2013-10-07 11:27:51 UTC
(In reply to comment #7)
> It supports a media player pipeline within the WebKit framework.

Wouldn't it be better to use the WebKit HTTP code for that though? Otherwise you don't get cookies, authentication, refers and all that right if you just use souphttpsrc.
Comment 10 Lori Anderson 2013-10-07 13:40:53 UTC
I need the dlnasrc to hook up the dtcp/ip decrypter element and WebKit's source doesn't do this.  Also, the logic specific to dlna headers is not supported by WebKit's source.  

In terms of cookies and authentication, it looks like that logic is performed within souphttpsrc rather than provided by WebKit's source (WebKitWebSourceGStreamer.cpp).   

The other functionality provided by WebKit's source is support for icecast headers.  Icecast isn't addressed by dlna specifications so currently not a requirement for dlnasrc.
Comment 11 Sebastian Dröge (slomo) 2013-10-07 13:50:40 UTC
WebKitWebSourceGStreamer.cpp uses the WebKit infrastructure to pass cookies to the server, add referers and also handle authentication via the normal WebKit ways. If you use souphttpsrc you will need to replicate all this or provide a behaviour that is different from the one that WebKit applications would expect.

I think we should try to get something like dlnasrc work with any HTTP source element that provides a specific interface.
Comment 12 Lori Anderson 2013-10-07 14:15:27 UTC
The dlnasrc element needs to be used both inside and outside of the WebKit framework.  There is another gstreamer based media player which is built within the Rygel framework that also needs the dlnasrc element.

It sounds like the cookie and authentication logic is built within the WebKit framework and not GStreamer.  I imagine it would not be easy to move it to the gstreamer framework.  Sounds like it will need to be duplicated in GStreamer?

In terms of your comment - "work with any HTTP source element that provides a specific interface", can you give an example of what you meant by "specific interface"?  

Thinking in terms of implementation, the media player's pipeline source would determine this is a "dlna" server so I need to utilize the "dlna" interface and include HTTP headers which are specific to dlna.  Or this is an icecast server, so I need to utilzie the "icecast" interface and include the ice HTTP headers.  Is that what you were thinking?
Comment 13 Sebastian Dröge (slomo) 2013-10-07 14:18:43 UTC
(In reply to comment #12)
> The dlnasrc element needs to be used both inside and outside of the WebKit
> framework.  There is another gstreamer based media player which is built within
> the Rygel framework that also needs the dlnasrc element.
> 
> It sounds like the cookie and authentication logic is built within the WebKit
> framework and not GStreamer.  I imagine it would not be easy to move it to the
> gstreamer framework.  Sounds like it will need to be duplicated in GStreamer?

Yes

> In terms of your comment - "work with any HTTP source element that provides a
> specific interface", can you give an example of what you meant by "specific
> interface"?  

The properties and signals on the element, the behaviour it provides. So you could have the same dlnasrc element that can use souphttpsrc or webkitwebsrc without having to worry about what the exact HTTP element is that is used.

> Thinking in terms of implementation, the media player's pipeline source would
> determine this is a "dlna" server so I need to utilize the "dlna" interface and
> include HTTP headers which are specific to dlna.  Or this is an icecast server,
> so I need to utilzie the "icecast" interface and include the ice HTTP headers. 
> Is that what you were thinking?

That's not what I thought but that's also an interesting idea about how we could define some kind of interface for HTTP elements. Or some helper API on top of that interface which sets specific HTTP headers for example.
Comment 14 Sebastian Dröge (slomo) 2014-02-12 08:40:33 UTC
What's the plan here?
Comment 15 Edward Hervey 2017-11-10 09:29:55 UTC
ping ?
Comment 16 GStreamer system administrator 2018-11-03 14:50:04 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-good/issues/95.