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 774112 - mpdparser: MS PlayReady ContentProtection event is truncated
mpdparser: MS PlayReady ContentProtection event is truncated
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-08 16:47 UTC by Philippe Normand
Modified: 2016-11-14 11:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mssdemux: wrap unmodified data in protection event (1.51 KB, patch)
2016-11-14 10:10 UTC, Philippe Normand
committed Details | Review
mpdparser: wrap unmodified data in protection event (1.45 KB, patch)
2016-11-14 10:10 UTC, Philippe Normand
committed Details | Review
release-notes-1.12: document Protection buffer storage changes (1.15 KB, patch)
2016-11-14 11:02 UTC, Philippe Normand
committed Details | Review

Description Philippe Normand 2016-11-08 16:47:06 UTC
When the demuxer emits the protection event it uses strlen() to get the data length but in some cases (PlayReady...) the data can have a \0 before the end of the actual data.

The proposed fix is to store the base64 decoded_len in the descriptor and fallback to strlen() in other cases.
Comment 1 Sebastian Dröge (slomo) 2016-11-09 07:26:36 UTC
If it's not a string, don't store it as a string. Use a GstBuffer instead for example.

As everybody will need it base64 decoded, it probably makes sense to do that in adaptivedemux already.
Comment 2 Philippe Normand 2016-11-10 09:39:00 UTC
Not sure what you mean about doing this in adaptivedemux, using a new dedicated vfunc?

I see that mssdemux indeed already wraps the base64 decoded data in a buffer :)
Comment 3 Sebastian Dröge (slomo) 2016-11-10 11:14:30 UTC
I mean doing base64 decoding here (once instead of in every user of the event, or is base64 encoding part of the event API?), and storing things in a GBytes or GstBuffer if it's not a string (i.e. can contain \0 and other things).
Comment 4 Philippe Normand 2016-11-14 09:03:06 UTC
From what I could observe so far, PlayReady seems to be the only system encoding its data with base64.

This isn't part of the event API, protection events use a GstBuffer already.

Currently the demuxers use gst_adaptive_demux_stream_queue_event() to handle the protection events they create. We could have adaptivedemux base64-decode events buffers if the system_id matches PlayReady. Would that be ok?
Comment 5 Sebastian Dröge (slomo) 2016-11-14 09:18:45 UTC
Ok in that case maybe just leave it as given by the stream, leave it base64 and put it into a GstBuffer. \0 in there would be something for the consumer to worry about then (which might require it base64 encoded anyway?)
Comment 6 Philippe Normand 2016-11-14 09:42:07 UTC
So the consumer of the event would be responsible to decode the buffer data?

I'm fine with that but it would be worth a paragraph in the release notes :)
Comment 7 Sebastian Dröge (slomo) 2016-11-14 09:46:29 UTC
(In reply to Philippe Normand from comment #6)
> So the consumer of the event would be responsible to decode the buffer data?
> 
> I'm fine with that but it would be worth a paragraph in the release notes :)

There was no support for this in 1.10, it's completely new, right?
Comment 8 Philippe Normand 2016-11-14 10:03:30 UTC
(In reply to Sebastian Dröge (slomo) from comment #7)
> (In reply to Philippe Normand from comment #6)
> > So the consumer of the event would be responsible to decode the buffer data?
> > 
> > I'm fine with that but it would be worth a paragraph in the release notes :)
> 
> There was no support for this in 1.10, it's completely new, right?

mssdemux in the 1.8 branch has this base64-decoding support:

https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/smoothstreaming/gstmssdemux.c?h=1.8#n476

Same in 1.10 :) So this would be a change of behavior for 1.12.
Comment 9 Philippe Normand 2016-11-14 10:10:25 UTC
Created attachment 339786 [details] [review]
mssdemux: wrap unmodified data in protection event

The base64 decoding operation now needs to be done by the protection event
consumer.
Comment 10 Philippe Normand 2016-11-14 10:10:38 UTC
Created attachment 339787 [details] [review]
mpdparser: wrap unmodified data in protection event

The base64 decoding operation now needs to be done by the protection event
consumer.
Comment 11 Sebastian Dröge (slomo) 2016-11-14 10:15:52 UTC
Ok, please also provide a patch as reminder for the www module then (there's already an empty 1.12 release notes files). Can be just a bullet point somewhere
Comment 12 Sebastian Dröge (slomo) 2016-11-14 10:16:56 UTC
Comment on attachment 339786 [details] [review]
mssdemux: wrap unmodified data in protection event

Maybe mention in the commit message *why* :)
Comment 13 Philippe Normand 2016-11-14 10:56:01 UTC
Comment on attachment 339786 [details] [review]
mssdemux: wrap unmodified data in protection event

Pushed as b35979c31aa1f812a1d3cfdeb5b4e7188f97bb7e with commit message amended.
Comment 14 Philippe Normand 2016-11-14 10:56:44 UTC
Comment on attachment 339787 [details] [review]
mpdparser: wrap unmodified data in protection event

Pushed as 0fbd2edaffe97e920aa0fa8a509256a1a70a3bfe with commit message amended and unit-test updated.
Comment 15 Philippe Normand 2016-11-14 11:02:56 UTC
Created attachment 339790 [details] [review]
release-notes-1.12: document Protection buffer storage changes
Comment 16 Sebastian Dröge (slomo) 2016-11-14 11:05:01 UTC
Comment on attachment 339790 [details] [review]
release-notes-1.12: document Protection buffer storage changes

Thanks, we can move that to a better section later if needed (e.g. if there's a adaptive streaming section as usual), or shorten it, or whatever is needed later :)