Content Decryption Module (CDM/html5)

4,157 views
Skip to first unread message

Tony P.

unread,
Feb 13, 2014, 11:43:01 AM2/13/14
to chromi...@chromium.org
Hi,
 I try to understand how I can integrate my own CDM (like clear key/widevine) with Chromium. 
It seems to have two choices for CDM integration the first one based on pepper API, with Linux for example, and the second one based on the use of the CDM like a browser component.
 Somebody can explain why we don't use the same API on each platform? 
 

Tony

David Dorwin

unread,
Feb 13, 2014, 2:00:00 PM2/13/14
to elt...@gmail.com, chromium-dev
Hi Tony,

Chromium supports three types of CDMs:
  • Internal from source (Clear Key, which is implemented internally by aes_decryptor.cc)
  • Pepper-based CDMs (used for desktop and Chrome OS)
  • Platform-based (e.g. Android using MediaDrm APIs)

If by "browser component" you are referring to the use of the ComponentUpdateService, that is a deployment detail and does not affect how the CDM is implemented or integrated. On platforms where it is available (Windows and Mac), Chrome installs and updates the Widevine CDM as a component, similar to Flash and PNaCl.

If you want to target desktop platforms, you probably want to implement a Pepper-based CDM. The Pepper APIs are abstracted by cdm_adapter.cc. Your CDM would implement the interfaces in http://src.chromium.org/viewvc/chrome/trunk/deps/cdm/content_decryption_module.h. You'd also need to make appropriate GYP changes to build an adapter binary for your CDM. For all platforms, you need to register your key system, as in http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/media/chrome_key_systems.cc.

David


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

Sasha Nikolic

unread,
Feb 24, 2014, 6:18:56 AM2/24/14
to chromi...@chromium.org, elt...@gmail.com
Hi David,
 
Are pepper-based CDM's only possible for desktop / Chrome OS? Can I for example create my own CDM component for Android with pepper API?
 
In case I have to create CDM as a MediaDrm plug-in on Android, how should I integrate it with Chromium?
 
Sasha
 

Op donderdag 13 februari 2014 20:00:00 UTC+1 schreef David Dorwin:

David Dorwin

unread,
Feb 24, 2014, 1:16:20 PM2/24/14
to sasha....@gmail.com, chromium-dev, Tony P.
Pepper APIs are not currently supported on Android, so a Pepper-based CDM is not an option there.

Chromium interacts with the MediaDrm APIs exposed by Android. Registration of a key system is very similar to desktop except a UUID is used instead of a Pepper type. At the lower levels, such as MediaDrmBridge, you might need to make some minor changes depending on how similar your MediaDrm plugin is.

David

Tony

unread,
Feb 25, 2014, 6:00:19 AM2/25/14
to David Dorwin, chromium-dev
Hi,
   I can use pepper-based CDM on my Desktop; no change in Chrome is require, but on Android when you tell about “some minor changes depending on how similar your MediaDrm plugin is.”; I suppose you tell about Chrome?
 Or is it possible to add a new CDM on Chrome on android without Chrome customisation like on desktop with Pepper CDM.

Tony

 

David Dorwin

unread,
Feb 25, 2014, 8:24:20 PM2/25/14
to Tony, chromium-dev
Both desktop and Android require customization of http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/media/chrome_key_systems.cc or an equivalent.

If there are other changes required on Android, such key system-specific information should probably be refactored out of MediaDrmBridge into a separate file like chrome_key_systems.cc.

David

Sasha Nikolic

unread,
Apr 9, 2014, 6:52:18 AM4/9/14
to chromi...@chromium.org, Tony
Hi David,

Is it possible to test Working Draft EME functionality from custom CDM with ContentShell.apk on Android? I have done:

a) registered my CDM similarly to clear key (but with use_aes_decryptor = false) in http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/media/crypto/key_systems.cc


c) use --enable-encrypted-media switch for enabling WD support

d) from HTML5 page, trying to instantiate MediaKeys with my key system string as parameter

However, the check fails at ProxyMediaKeys constructor since the RendererMediaPlayerManager input param is null. I looked through the code and this manager instance should come from CdmSessionAdapter::Initialize, however it is hard-coded to NULL (with a TODO: Support Android).

Does this mean WD support is not yet present in Android build or I am doing something wrong (which is quite possible since not very familiar with Chromium yet)?

Sasha


Op woensdag 26 februari 2014 02:24:20 UTC+1 schreef David Dorwin:

David Dorwin

unread,
Apr 9, 2014, 12:35:18 PM4/9/14
to Sasha Nikolic, chromium-dev, Tony
Hi Sasha,

EME WD API support on Android is still in progress. The CDM has been separated from the media player on the render side, but the browser side still needs to be split in order to support the new model. I believe that will allows the TODO you referenced to be addressed.

David
Message has been deleted

SD

unread,
Jun 17, 2014, 1:21:07 AM6/17/14
to chromi...@chromium.org
Hi David,

I had a few questions regarding Widevine integration with Chrome OS. ( platform - chromebooks) It would be really helpful if you could answer them.

1. As a browser component, does Widevine run as part of the main browser process or as a different instance part of each renderer process? Could you please describe the high level flow from the MediaElement Extensions (provided by the EME specification) used by javascript to Widevine CDM ?
2. Just to confirm, as mentioned by you previously, does Widevine CDM interact with the Chromium source code via the Pepper APIs, when its integrated within the browser as a component rather then an external plugin ?  (abstracted by cdm_adapter.cc)

Thanks
Sneh 

Ryan Sleevi

unread,
Jun 17, 2014, 1:25:40 AM6/17/14
to sjde...@gmail.com, Chromium-dev

On Jun 16, 2014 10:21 PM, "SD" <sjde...@gmail.com> wrote:
>
> Hi David,
>
> I had a few questions regarding Widevine integration with Chrome OS. ( platform - chromebooks) It would be really helpful if you could answer them.
>
> 1. As a browser component, does Widevine run as part of the main browser process or as a different instance part of each renderer process? Could you please describe the high level flow from the MediaElement Extensions (provided by the EME specification) used by javascript to Widevine CDM ?

CDMs run as PPAPI plugins, so the answer to your question about browser v renderer is 'neither'

> 2. Just to confirm, as mentioned by you previously, does Widevine CDM interact with the Chromium source code via the Pepper APIs, when its integrated within the browser as a component rather then an external plugin ?  (abstracted by cdm_adapter.cc)

Yes.

The component updater is capable of updating components independently of the main Chrome binary (eg: as used for Flash or the PDF renderer). It does not require that components be PPAPI plugins, but many are.

That is, its always treated as a plugin.

SD

unread,
Jun 17, 2014, 1:52:27 AM6/17/14
to chromi...@chromium.org
Hi Ryan,

Thanks a lot for your reply ! Clears up a lot of things for me.

Could you also possibly depict the high level view from the javascript to the CDM ?

HTML -> Renderer ->  parser -> V8 <-> Content Module (renderer process) <-- PPAPi --->  Separate Plugin Process ( Widevine) 

Sneh

On Thursday, 13 February 2014 08:43:01 UTC-8, Tony wrote:

Mike Frysinger

unread,
Jun 17, 2014, 1:57:18 AM6/17/14
to sjde...@gmail.com, chromium-dev
it'll be the same for any JS talking to any PPAPI plugin.  CDMs aren't unique here.
-mike


--

David Dorwin

unread,
Jun 17, 2014, 2:19:12 AM6/17/14
to vap...@chromium.org, sjde...@gmail.com, chromium-dev
The CDM runs in a --ppapi process. PPAPI IPCs are used for the renderer to communicate with that process.

I'm not sure what you mean by "browser component". On Windows and Mac, the CDM is installed and updated by the Component Updater Service like some other binaries as Ryan mentioned. This is not the case on Chrome OS where the CDM is part of the OS image. (The Component Updater Service is not used on Chrome OS.)

On Mon, Jun 16, 2014 at 10:56 PM, Mike Frysinger <vap...@chromium.org> wrote:
it'll be the same for any JS talking to any PPAPI plugin.  CDMs aren't unique here.

Actually, CDMs are unique. The CDM is not instantiated by an <object> tag like a traditional plugin. Instead, when JS requests the Widevine CDM via an EME API, the renderer process instantiates a CDM instance using WebHelperPlugin. The CDM instance is not accessible by the page. Only the renderer's EME code has a reference to it.

The media/base has MediaKeys and Decryptor interfaces. PpapiDecryptor implements both of these for Pepper-based CDMs. It passes requests to the CDM instance via a PPP interface.

cdm_adapter.cc implements that PPP interface and is used for all Pepper-based CDMs. It converts PPAPI calls to/from the interfaces in media/cdm/ppapi/api/content_decryption_module.h, which is the interface CDMs implement.

Daniel Lewis

unread,
Jun 21, 2014, 10:12:59 PM6/21/14
to chromi...@chromium.org
Hi David,

You had mentioned that Chromium supports three types of CDMs. I am mainly interested in showcasing platform-based CDMs. How can CDMs/Widevine meant for Android devices be integrated with Chromium for use in Chrome OS based devices ?

Thanks
Daniel Levis

David Dorwin

unread,
Jun 30, 2014, 3:13:09 PM6/30/14
to dlewi...@gmail.com, chromium-dev
Hi Daniel,

Do I understand correctly that you want to use Chromium OS on a device that has a platform-based CDM, such as via SoC support? That is not explicitly supported, but you could probably start by enabling ENABLE_BROWSER_CDMS and disabling ENABLE_PEPPER_CDMS. There is probably more work to do since the ENABLE_BROWSER_CDMS path relies on Android-specific code at the moment.

David


--

Sneh

unread,
Jul 2, 2014, 2:24:14 AM7/2/14
to chromi...@chromium.org
Hi David,

Please correct me if I am wrong,

Widevine/ppapi cdm when integrated with chromium isnt sandboxed with NaCl, so it works as a trusted out of process ppapi plugin and has access to system calls such as ioctls to the driver ?

Thanks !!
Sneh 

On Thursday, 13 February 2014 08:43:01 UTC-8, Tony wrote:

David Dorwin

unread,
Jul 2, 2014, 12:52:00 PM7/2/14
to Soham Desai, chromium-dev
Trusted Pepper plugins also run in a sandbox like most other Chrome processes.

--

Jennifer Reid

unread,
Jul 20, 2014, 8:30:46 PM7/20/14
to chromi...@chromium.org
Hi,

I aim to create my own pepper plugin CDM for Chromium OS. As per the above comments I understand that there are some changes need to be made for registering the key system, as well create my own GYP for building the adapter. Can the implementation done for Widevine (src/third_pary/widevine) be utilized for the same ? Could you please elaborate on the changes required ?

The CDM core provides a Decrypt only functionality and there is no Decoding/De-multiplexing performed in the underlying implementation, it provides secure environment by talking to a system driver. Could any 1 please guide me with what approach I should take ?

Also, any thoughts on the debugging approach for the plugin functionality from the browser level?

Jennifer

On Thursday, February 13, 2014 8:43:01 AM UTC-8, Tony wrote:

David Dorwin

unread,
Aug 4, 2014, 6:24:35 PM8/4/14
to reid.je...@gmail.com, chromium-dev
Hi Jennifer,

Yes, you need to register your key system name and (for a Pepper-based CDM) the adapter. See the Widevine registration in chrome/renderer/media/chrome_key_systems.cc and chrome/common/chrome_content_client.cc, respectively. You might look at clearkeycdmadapter in media/media_cdm.gypi for an example of the GYP rules for the adapter.

However, you won't be able to talk to a system driver from Pepper. If you need to use a platform-based solution, you'll need to use IPCs like the Android path. Chromium does not currently support IPCs and the desktop/Chrome OS media stack, though.

David



--

김영철

unread,
Nov 17, 2014, 7:32:20 AM11/17/14
to chromi...@chromium.org, reid.je...@gmail.com
Hi David,

I just try to port WV CDM into the CEF3 for desktop
It means that I just use out-of-process type to call PPAPI with Widevine CDM

HTML -> Renderer -> parser -> V8(codec) <-> Content Module(renderer)<-- PPAPI --> Separate Plugin Process(Widevine CDM)

Is it available to support PPAPI for chromium open source browser?

If yes, please explain on how to plugin CDM and connect with EME?

Chris




2014년 8월 5일 화요일 오전 7시 24분 35초 UTC+9, David Dorwin 님의 말:

David Dorwin

unread,
Nov 19, 2014, 4:53:14 PM11/19/14
to yc...@markany.com, chromium-dev, Jennifer Reid
Hi Chris,

  • PPAPI-based CDMs are supported by the Chromium browser. For example, the External Clear Key test CDM builds with Chromium.
  • The Widevine CDM is not part of Chromium. You would need to contact Widevine regarding your target platform.
  • I don't know whether CEF3 supports adding key systems, which is the responsibility of the ContentRendererClient. The code that adds all CDMs other than (non-External) Clear Key is in chrome/, which is not part of CEF.

pujari gupta

unread,
Dec 1, 2017, 4:19:26 AM12/1/17
to Chromium-dev, yc...@markany.com, reid.je...@gmail.com
Hi David,
I have trying to build the cdm  with chorme given at the link https://github.com/fraunhoferfokus/open-content-decryption-module/blob/2357_ppapi_chromium/docs/build_notes_chromium.md on ubuntu 14.04
when i follow the procedure given at https://github.com/fraunhoferfokus/open-content-decryption-module (
  • $ ln -s $HOME/opencdm/src $CHROMIUM_ROOT/src/media/cdm/ppapi/external_open_cdm
  • add include into the $CHROMIUM_ROOT/src/media/media.gyp file to contain this:
  'includes': [
    'media_cdm.gypi',
    './cdm/ppapi/external_open_cdm/browser/media_open_cdm.gypi'
    ]
  • apply changes by generating the project files
  • $ cd $CHROMIUM_ROOT/src
  • $ build/gyp_chromium
)

Build is failing for me . i am trying to build on ubuntu (14.04)side

when i run  build/gyp_chromium

Updating projects from gyp files...
gyp: /home/cdm_test/chrome/src/v8/src/d8.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: /home/cdm_test/chrome/src/third_party/webrtc/tools/tools.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: /home/cdm_test/chrome/src/native_client/build/untrusted.gypi not found (cwd: /home/cdm_test/chrome/src) while reading includes of /home/cdm_test/chrome/src/build/common_untrusted.gypi while reading includes of /home/cdm_test/chrome/src/mojo/mojo_nacl_untrusted.gyp
gyp: Error importing pymod_do_mainmodule (grit_info): No module named grit_info
gyp: /home/cdm_test/chrome/src/third_party/libaddressinput/src/cpp/libaddressinput.gypi not found (cwd: /home/cdm_test/chrome/src) while reading includes of /home/cdm_test/chrome/src/third_party/libaddressinput/libaddressinput.gyp
gyp: /home/cdm_test/chrome/src/native_client/build/untrusted.gypi not found (cwd: /home/cdm_test/chrome/src) while reading includes of /home/cdm_test/chrome/src/build/common_untrusted.gypi while reading includes of /home/cdm_test/chrome/src/remoting/remoting_key_tester.gypi while reading includes of /home/cdm_test/chrome/src/remoting/remoting.gyp
Package nss was not found in the pkg-config search path.
Perhaps you should add the directory containing `nss.pc'
to the PKG_CONFIG_PATH environment variable
No package 'nss' found
gyp: Call to 'pkg-config --libs-only-l nss | sed -e "s/-lssl3//"' returned exit status 0 while in /home/cdm_test/chrome/src/net/third_party/nss/ssl.gyp.
gyp: /home/cdm_test/chrome/src/third_party/libjpeg_turbo/libjpeg.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: /home/cdm_test/chrome/src/v8/tools/gyp/v8.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: /home/cdm_test/chrome/src/third_party/pdfium/samples/samples.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: /home/cdm_test/chrome/src/third_party/ffmpeg/ffmpeg.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: /home/cdm_test/chrome/src/third_party/WebKit/public/all.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: /home/cdm_test/chrome/src/third_party/skia/gyp/core.gypi not found (cwd: /home/cdm_test/chrome/src) while reading includes of /home/cdm_test/chrome/src/skia/skia_library.gypi while reading includes of /home/cdm_test/chrome/src/skia/skia.gyp
/bin/sh: 1: cups-config: not found
gyp: Call to 'cups-config --api-version' returned exit status 127 while in /home/cdm_test/chrome/src/printing/printing.gyp.
Package libpulse was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpulse.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libpulse' found
gyp: Call to 'pkg-config --cflags libpulse' returned exit status 1 while in /home/cdm_test/chrome/src/media/media.gyp.
gyp: /home/cdm_test/chrome/src/third_party/angle/build/common_defines.gypi not found (cwd: /home/cdm_test/chrome/src) while reading includes of /home/cdm_test/chrome/src/gpu/gpu.gyp
gyp: Error importing pymod_do_mainmodule (grit_info): No module named grit_info
gyp: /home/cdm_test/chrome/src/third_party/icu/icu.gyp not found (cwd: /home/cdm_test/chrome/src)
gyp: Error importing pymod_do_mainmodule (grit_info): No module named grit_info
gyp: Error importing pymod_do_mainmodule (grit_info): No module named grit_info
gyp: Error importing pymod_do_mainmodule (grit_info): No module named grit_info

Kindly help me to build the chrome + OCDM.
I am stuck.


Thanks Pujari

smaha...@gmail.com

unread,
Oct 1, 2018, 12:19:11 PM10/1/18
to Chromium-dev, yc...@markany.com, reid.je...@gmail.com
Hi Gupta,

I am also facing the same problem and same issue when i am trying to compile ./build/gyp_chromium. so if you have any solution then please suggest me.

Thanks.
Reply all
Reply to author
Forward
0 new messages