matroska: Add the WebM encrypted content support in matroskademux
authorYacine Bandou <yacine.bandou@softathome.com>
Sun, 30 Sep 2018 17:28:07 +0000 (19:28 +0200)
committerThibault Saunier <tsaunier@igalia.com>
Wed, 3 Oct 2018 14:59:14 +0000 (16:59 +0200)
commit0432826950d4d80fe2b50ffd3757dc08155de9e3
tree692886f989e9f05de45f1143dc37182df01c388c
parent6fe214e7a9f40212d0eb10a2d5d579414b7b8e31
matroska: Add the WebM encrypted content support in matroskademux

This commit:

1. Reads the WebM and Matroska ContentEncryption subelements.

2. Creates a GST_PROTECTION event for each ContentEncryption, which
   will be sent before pushing the first source buffer.
   The DRM system id field in this event is set to GST_PROTECTION_UNSPECIFIED_SYSTEM_ID,
   because it isn't specified neither by Matroska nor by the WebM spec.

3. Reads the protection information of encrypted Block/SimpleBlock and
   extracts the IV and the partitioning format (subsamples).

4. Creates the metadata protection for each encrypted Block/SimpleBlock,
   with those informations: KeyID (extracted from ContentEncryption element),
   IV and partitioning format.

5. Adds a new caps for WebM encrypted content named "application/x-webm-enc",
   with the following new fields:

   "encryption-algorithm": The encryption algorithm used.
                           values: "None", "DES", "3DES", "Twofish", "Blowfish", "AES".

   "encoding-scope": The field that describes which Elements have been modified.
                     Values: "frame", "codec-data", "next-content".

   "cipher-mode": The cipher mode used in the encryption.
                  Values: "None", "CTR".

https://bugzilla.gnome.org/show_bug.cgi?id=765275
gst/matroska/matroska-demux.c
gst/matroska/matroska-ids.c
gst/matroska/matroska-ids.h
gst/matroska/matroska-read-common.c
gst/matroska/matroska-read-common.h