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 753613 - mssdemux: PlayReady WRM parsing support
mssdemux: PlayReady WRM parsing support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-14 10:05 UTC by Philippe Normand
Modified: 2015-09-30 15:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (8.25 KB, patch)
2015-08-14 10:09 UTC, Philippe Normand
none Details | Review
gst-indented patch (8.36 KB, patch)
2015-08-15 09:01 UTC, Philippe Normand
none Details | Review
updated patch (8.60 KB, patch)
2015-08-18 08:48 UTC, Philippe Normand
none Details | Review
patch (8.54 KB, patch)
2015-08-18 09:14 UTC, Philippe Normand
none Details | Review
updated patch (8.80 KB, patch)
2015-09-07 09:47 UTC, Philippe Normand
none Details | Review
mssdemux: PlayReady WRM parsing support (8.80 KB, patch)
2015-09-07 11:40 UTC, Philippe Normand
none Details | Review
updated patch (8.86 KB, patch)
2015-09-08 07:00 UTC, Philippe Normand
none Details | Review
updated patch (8.92 KB, patch)
2015-09-08 07:06 UTC, Philippe Normand
none Details | Review
mssdemux: PlayReady WRM parsing support (9.17 KB, patch)
2015-09-22 15:47 UTC, Philippe Normand
committed Details | Review

Description Philippe Normand 2015-08-14 10:05:30 UTC
It would be nice if the element could parse the ProtectionHeader node of the manifest and emit protection events so downstream element can decrypt the media.

I started a patch!
Comment 1 Philippe Normand 2015-08-14 10:09:01 UTC
Created attachment 309250 [details] [review]
patch
Comment 2 Philippe Normand 2015-08-15 09:01:36 UTC
Created attachment 309320 [details] [review]
gst-indented patch
Comment 3 Philippe Normand 2015-08-18 08:48:19 UTC
Created attachment 309444 [details] [review]
updated patch

Strip {} from SystemID attribute.
Comment 4 Philippe Normand 2015-08-18 09:14:46 UTC
Created attachment 309445 [details] [review]
patch

gst-indent'd :)
Comment 5 Julien Isorce 2015-09-07 09:43:23 UTC
Is there any on going work to support webm encryption ? (http://www.webmproject.org/docs/webm-encryption/)

Tim that would be great if you could review Philippe's patch :)
Comment 6 Philippe Normand 2015-09-07 09:47:40 UTC
Created attachment 310787 [details] [review]
updated patch

This version attempts to improve the {} stripping in the SystemID parsing, still not very happy about this part of the code, maybe I should use a regex for this?
Comment 7 Philippe Normand 2015-09-07 09:48:13 UTC
(In reply to Julien Isorce from comment #5)
> Is there any on going work to support webm encryption ?
> (http://www.webmproject.org/docs/webm-encryption/)
> 

Not to my knowledge :)
Comment 8 Tim-Philipp Müller 2015-09-07 10:54:11 UTC
Well, the {} stripping is not elegant, but that's string ops in C for you. I don't think using a regex will improve it much. You could also do something like, i.e. strip in place. If that's less code or nicer, I don't know. It doesn't really matter much imho.

  gsize id_len = strlen (system_id);

  if (system_id[id_len - 1] == '}') {
    system_id[id_len - 1] = '\0';
    --id_len;
  }

  /* move string one forward including the terminator */
  if (system_id[0] == '{')
    memmove (system_id, system_id + 1, id_len - 1 + 1);

Is the patch otherwise ready for review or is it still work in progress? ("started a patch" sounds like work in progress)
Comment 9 Philippe Normand 2015-09-07 10:59:39 UTC
(In reply to Tim-Philipp Müller from comment #8)
> Well, the {} stripping is not elegant, but that's string ops in C for you. I
> don't think using a regex will improve it much. You could also do something
> like, i.e. strip in place. If that's less code or nicer, I don't know. It
> doesn't really matter much imho.
> 
>   gsize id_len = strlen (system_id);
> 
>   if (system_id[id_len - 1] == '}') {
>     system_id[id_len - 1] = '\0';
>     --id_len;
>   }
> 
>   /* move string one forward including the terminator */
>   if (system_id[0] == '{')
>     memmove (system_id, system_id + 1, id_len - 1 + 1);
> 

Ok I can try with this. Thanks.

> Is the patch otherwise ready for review or is it still work in progress?
> ("started a patch" sounds like work in progress)

Yes it is ready for review but I suppose we have to wait anyway because git master is frozen and this patch kind-of is a new feature rather than a critical bugfix :)
Comment 10 Tim-Philipp Müller 2015-09-07 11:07:11 UTC
You could also use GString which does support converting to lower-case, and removing chars.
Comment 11 Philippe Normand 2015-09-07 11:40:31 UTC
Created attachment 310802 [details] [review]
mssdemux: PlayReady WRM parsing support

If the manifest has a ProtectionHeader node then parse it and emit
protection events according to the specified protection SystemID.
Comment 12 Philippe Normand 2015-09-08 07:00:53 UTC
Created attachment 310873 [details] [review]
updated patch
Comment 13 Philippe Normand 2015-09-08 07:06:35 UTC
Created attachment 310874 [details] [review]
updated patch

Now I'm done for a while hopefully :)
Comment 14 Thiago Sousa Santos 2015-09-21 22:25:28 UTC
Review of attachment 310874 [details] [review]:

Looks good overall.

Tim, as you merged the DASH CENC stuff, do you see any issues here or can we mark this as commit-after-freeze? (after this minor fix)

::: ext/smoothstreaming/gstmssdemux.c
@@ +553,3 @@
+          NULL);
+      gst_structure_set_name (s, "application/x-cenc");
+    }

Would you mind moving this to a function to avoid the repeated code?
Comment 15 Tim-Philipp Müller 2015-09-21 22:44:32 UTC
Patch looks fine at first glance, didn't review in detail. The duplication of the if(protected) block you already mentioned. You could also put that fixed-size 2-element sys_ids[] array on the stack instead of alloc/freeing it there, but that's minor of course.
Comment 16 Philippe Normand 2015-09-22 15:47:28 UTC
Created attachment 311883 [details] [review]
mssdemux: PlayReady WRM parsing support

If the manifest has a ProtectionHeader node then parse it and emit
protection events according to the specified protection SystemID.


I didn't find much code to factor out to a function apart from the
caps update. The protection system selection is 2 lines only after
switching to a stack allocated array.
Comment 17 Tim-Philipp Müller 2015-09-30 15:57:07 UTC
commit ae7d938842da35f1523ea0ec3ab025327adf31c5
Author: Philippe Normand <philn@igalia.com>
Date:   Mon Jun 8 15:33:22 2015 +0200

    mssdemux: PlayReady WRM parsing support
    
    If the manifest has a ProtectionHeader node then parse it and emit
    protection events according to the specified protection SystemID.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753613