gecko-dev/dom/media/gmp
Chris Pearce 967567edb5 Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald
Makes transfer of samples between the content and CDM processes use shmems.

The Chromium CDM API requires us to implement a synchronous interface to supply
buffers to the CDM for it to write decrypted samples into. We want our buffers
to be backed by shmems, in order to reduce the overhead of transferring decoded
frames. However due to sandboxing restrictions, the CDM process cannot allocate
shmems itself.  We don't want to be doing synchronous IPC to request shmems
from the content process, nor do we want to have to do intr IPC or make async
IPC conform to the sync allocation interface. So instead we have the content
process pre-allocate a set of shmems and give them to the CDM process in
advance of them being needed.

When the CDM needs to allocate a buffer for storing a decrypted sample, the CDM
host gives it one of these shmems' buffers. When this is sent back to the
content process, we copy the result out (uploading to a GPU surface for video
frames), and send the shmem back to the CDM process so it can reuse it.

We predict the size of buffer the CDM will allocate, and prepopulate the CDM's
list of shmems with shmems of at least that size, plus a bit of padding for
safety. We pad frames out to be the next multiple of 16, as we've seen some
decoders do that.

Normally the CDM won't allocate more than one buffer at once, but we've seen
cases where it allocates two buffers, returns one and holds onto the other. So
the minimum number of shmems we give to the CDM must be at least two, and the
default is three for safety.


MozReview-Commit-ID: 5FaWAst3aeh

--HG--
extra : rebase_source : a0cb126e72bfb2905bcdf02e864dc654e8340410
2017-03-28 18:59:11 +13:00
..
gmp-api Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
widevine-adapter Bug 1315850 - Hook up CDM storage. r=gerald 2017-03-22 16:30:54 +13:00
ChromiumCDMAdapter.cpp Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
ChromiumCDMAdapter.h Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
ChromiumCDMChild.cpp Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
ChromiumCDMChild.h Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
ChromiumCDMParent.cpp Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
ChromiumCDMParent.h Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
ChromiumCDMProxy.cpp Bug 1351874 - Dispatch shutdown runnable to CDMParent rather than null. r=gerald 2017-03-30 11:03:50 +13:00
ChromiumCDMProxy.h Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
DecryptJob.cpp Bug 1351953 - Make DecryptJob::PostResult take a mozilla::Span instead of nsTArray. r=gerald 2017-04-05 10:32:19 +12:00
DecryptJob.h Bug 1351953 - Make DecryptJob::PostResult take a mozilla::Span instead of nsTArray. r=gerald 2017-04-05 10:32:19 +12:00
GMPCDMCallbackProxy.cpp Bug 1346679 - Label runnables in dom/media/gmp/GMPCDMCallbackProxy.cpp. r=cpearce 2017-03-10 16:07:04 +08:00
GMPCDMCallbackProxy.h Bug 1346679 - Label runnables in dom/media/gmp/GMPCDMCallbackProxy.cpp. r=cpearce 2017-03-10 16:07:04 +08:00
GMPCDMProxy.cpp Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
GMPCDMProxy.h Bug 1315850 - Implement CDM persistent sessions. r=gerald 2017-03-09 19:09:43 +13:00
GMPCallbackBase.h
GMPChild.cpp Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
GMPChild.h Replace GMP use of PCrashReporter with shmem-based annotations. (bug 1337518, r=billm) 2017-02-12 11:39:44 -08:00
GMPContentChild.cpp Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
GMPContentChild.h Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald 2017-02-23 11:51:00 +13:00
GMPContentParent.cpp Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPContentParent.h Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPCrashHelper.cpp Bug 1346678 - Label runnables in dom/media/gmp/GMPParent.cpp and its friends. r=cpearce 2017-03-09 15:31:11 +08:00
GMPCrashHelper.h Bug 1322739: P1. Fix style and headers. r=gerald 2017-02-22 13:02:58 +01:00
GMPCrashHelperHolder.cpp
GMPCrashHelperHolder.h
GMPDecryptorChild.cpp Bug 1337778 - Use counter for decryptor ID instead of IPDL actor Id. r=gerald 2017-03-01 17:19:08 +13:00
GMPDecryptorChild.h Bug 1337778 - Use counter for decryptor ID instead of IPDL actor Id. r=gerald 2017-03-01 17:19:08 +13:00
GMPDecryptorParent.cpp Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
GMPDecryptorParent.h Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPDecryptorProxy.h Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
GMPDiskStorage.cpp
GMPEncryptedBufferDataImpl.cpp
GMPEncryptedBufferDataImpl.h
GMPLoader.cpp
GMPLoader.h
GMPLog.h Bug 1315850 - Add GMP_LOG macro. r=gerald 2017-02-22 09:45:54 +13:00
GMPMemoryStorage.cpp
GMPMessageUtils.h Bug 1315850 - Create ChromiumCDMProxy in MediaKeys.cpp when preffed on. r=gerald 2017-02-22 14:42:55 +13:00
GMPParent.cpp Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPParent.h Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPPlatform.cpp Bug 1344614 - Improve GMP clock precision to match Chromium's CDM clock. r=jwwang 2017-02-27 10:42:59 +13:00
GMPPlatform.h Bug 1338924 - Add GMPTask that takes/runs a lambda and a simple mechanism to set a timer on a lambda task. r=gerald 2017-02-14 11:09:38 +13:00
GMPProcessChild.cpp
GMPProcessChild.h
GMPProcessParent.cpp
GMPProcessParent.h
GMPService.cpp Bug 1315850 - Add GMPService::GetCDM. r=gerald 2017-02-22 09:26:47 +13:00
GMPService.h Bug 1315850 - Add GMPService::GetCDM. r=gerald 2017-02-22 09:26:47 +13:00
GMPServiceChild.cpp Bug 1352924 - Disconnect GMP service in child from parent once all GMPs are shutdown. r=gerald 2017-04-03 11:10:04 +12:00
GMPServiceChild.h Bug 1352924 - Block creation of new GMPs once parent process begins shutdown. r=gerald 2017-04-03 11:08:06 +12:00
GMPServiceParent.cpp Bug 1352924 - Block creation of new GMPs once parent process begins shutdown. r=gerald 2017-04-03 11:08:06 +12:00
GMPServiceParent.h Bug 1352924 - Keep list of GMPServiceParents in GeckoMediaPluginServiceParent. r=gerald 2017-03-31 11:43:27 +13:00
GMPSharedMemManager.cpp
GMPSharedMemManager.h
GMPStorage.h
GMPStorageChild.cpp
GMPStorageChild.h
GMPStorageParent.cpp Bug 1060419 - make log_print use Printf.h, r=froydnj 2016-12-15 20:16:31 -07:00
GMPStorageParent.h
GMPTimerChild.cpp
GMPTimerChild.h
GMPTimerParent.cpp
GMPTimerParent.h
GMPTypes.ipdlh Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
GMPUtils.cpp Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
GMPUtils.h Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
GMPVideoDecoderChild.cpp
GMPVideoDecoderChild.h
GMPVideoDecoderParent.cpp Bug 1315850 - Ask the GMPService for the GMP thread in GMPParent::ChildTerminated. r=gerald 2017-03-24 13:38:00 +13:00
GMPVideoDecoderParent.h
GMPVideoDecoderProxy.h
GMPVideoEncodedFrameImpl.cpp
GMPVideoEncodedFrameImpl.h
GMPVideoEncoderChild.cpp
GMPVideoEncoderChild.h
GMPVideoEncoderParent.cpp Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald 2017-02-23 11:51:00 +13:00
GMPVideoEncoderParent.h
GMPVideoEncoderProxy.h
GMPVideoHost.cpp
GMPVideoHost.h
GMPVideoPlaneImpl.cpp
GMPVideoPlaneImpl.h
GMPVideoi420FrameImpl.cpp
GMPVideoi420FrameImpl.h
PChromiumCDM.ipdl Bug 1351953 - Pre-allocate shmems for the CDM process to use for storing decrypted and audio samples. r=gerald 2017-03-28 18:59:11 +13:00
PGMP.ipdl Store the child process thread id in CrashReporterHost. (bug 1338281 part 2, r=billm) 2017-02-15 14:44:29 -08:00
PGMPContent.ipdl Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald 2017-02-23 11:51:00 +13:00
PGMPDecryptor.ipdl Bug 1342822 - Backed out changeset 70bc7d4e8512 (bug 1338924). r=gerald 2017-02-27 13:58:27 +13:00
PGMPService.ipdl Bug 1352924 - Block creation of new GMPs once parent process begins shutdown. r=gerald 2017-04-03 11:08:06 +12:00
PGMPStorage.ipdl
PGMPTimer.ipdl
PGMPVideoDecoder.ipdl
PGMPVideoEncoder.ipdl
README.txt
moz.build Bug 1315850 - Add ChromiumAdapter which we can use instead of WidevineAdapter. r=gerald 2017-03-13 16:59:34 +13:00
mozIGeckoMediaPluginChromeService.idl
mozIGeckoMediaPluginService.idl

README.txt

This directory contains code supporting Gecko Media Plugins (GMPs). The GMP API is not the same thing as the Media Plugin API (MPAPI).