Граф коммитов

38 Коммитов

Автор SHA1 Сообщение Дата
Kartikaya Gupta ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Chris Pearce 0f1f90f2c1 Bug 1383580 - Pad estimated CDM frame sizes. r=gerald
The new video decoder in CDM version 1.4.8.970 seems to calculate its frame size
as about 1.5X of the optimal size. So increase our estimate of CDM video frame
buffer sizes by more than that so that our pre-allocated buffers should be big
enough to accomodate the allocations that the CDM requests.

This means we should be more likely to avoid the slow fallback path where we
have to transfer frames from the CDM to the content process using the non-shmem
path.

MozReview-Commit-ID: 6PT8XVCAL3E

--HG--
extra : rebase_source : a27793b033c4f50f6e15d874558dc50e1410c8be
2017-07-24 16:56:24 +12:00
Chris Pearce ab9e4db6d1 Bug 1383580 - Add an explicit message to increase CDM-Firefox shmem pool. r=gerald
The strategy we were using to expand the pool of shmems we use to shuffle video
frames between the CDM and content processses is to increase the size of the
pool if the content process receives a video frame in a non-shmem. However the
CDM process will send a frame in a non-shmem if none of the shmems in the pool
are big enough to fit the frame the CDM produces. This happens if we
underestimate the size required for video frames. This causes the
ChromiumCDMParent to increase the number of shmems in the pool every time we
rate switch, until we eventually hit the limit of 50, whereupon playback fails.

So we need to disambiguate between these two cases; the first being we have a
pool of shmems, but they're the wrong size, the second being our shmems are the
right size, but we've run out and we need to expand the shmem pool. The only
place where we know this is in the CDM process. So this commit adds a new
message to PChromiumCDM through which the ChromiumCDMChild can report to the
parent that it needs more shmems in the pool.

The new Widevine CDM has a new video decoder which allocates video frames less
optimally than the previous, which causes us to hit this more often in Nightly.
Our telemetry also indicates we hit this rarely in Beta with the old CDM.

MozReview-Commit-ID: LoSvVhxHQxn

--HG--
extra : rebase_source : 6c7201a74dbf202d0ef8c2269292a80a7ad95dff
extra : source : 57cf5455fd14ef0b68b61f914146ff942b5ca4a0
2017-07-24 12:57:40 +12:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Jean-Yves Avenard 0ac3f1c5b4 Bug 1374774: P1. Move H264 methods into H264 code. r=gerald
HasSPS, ExtractExtraData and CompareExtraData have nothing to do with the handling of annex B format. They are raw H264 related methods.

It will also prevent in the following change to have cycling references between two headers.

MozReview-Commit-ID: FCs5aU4GcTU

--HG--
extra : rebase_source : a96fe0c70416d38690b0c2f1dee567b0b025e947
2017-06-22 14:36:11 +02:00
Sebastian Hengst 261b25bf86 Backed out changeset 0d953ca28add (bug 1374774) for bustage at media/libstagefright/binding/H264.cpp(205). 'ptr' not declared. r=backout on a CLOSED TREE 2017-06-24 00:49:18 +02:00
Jean-Yves Avenard abaade7f70 Bug 1374774: P1. Move H264 methods into H264 code. r=gerald
HasSPS, ExtractExtraData and CompareExtraData have nothing to do with the handling of annex B format. They are raw H264 related methods.

It will also prevent in the following change to have cycling references between two headers.

MozReview-Commit-ID: FCs5aU4GcTU

--HG--
extra : rebase_source : b204723cdbb599d4f0a227871ed28f5da39e9cff
2017-06-22 14:36:11 +02:00
Chris Pearce abac85f1d9 Bug 1372080 - Reorder frames decoded by Widevine CDM. r=jya
The next version of the Widevine CDM (970) has a new H.264 decoder and it does
not appear to be outputing frames it decodes in presentation order, so we need
to reorder the frames output by the CDM.


MozReview-Commit-ID: HMsQVN3NCIU

--HG--
extra : rebase_source : 68ef406556087434fa12b72ae5ed5c2e1bce2b64
2017-06-12 17:47:05 +12:00
Chris Pearce e5bb59cbdf Bug 1366639 - Add telemetry to track max number of PChromiumCDM video frame shmems. r=francois,gerald
This will enable us to pre-allocate the correct number of shared memory buffers
that we pre-allocate for sending video frames between the CDM and Gecko. That
means we won't need to take the slow path to recover from underestimating how
many shmems we need.



MozReview-Commit-ID: Q4mX2rYMz3

--HG--
extra : rebase_source : f9573cfbf4e65013803b46c0909be2c68566e512
2017-05-22 15:03:00 +12:00
Kris Maglione b588cdc5bb Bug 1361900: Part 1 - Make CDMProxy.h compatible with mozilla::Result. r=JamesCheng
MozReview-Commit-ID: DiO7IPFYKbE

--HG--
extra : rebase_source : 500e32854c50e2381fd9de3a3533611be1426329
extra : source : 9e3064aec4bb16542f9cc93a89f7a257b6716a98
2017-05-12 12:08:43 -07:00
Sebastian Hengst 7b52c82b67 Backed out changeset 9e3064aec4bb (bug 1361900) for crashing Marionette's test_timeouts.py TestTimeouts.test_reset_timeout on Linux debug with e10s. r=backout 2017-05-13 18:56:06 +02:00
Kris Maglione 49ed37ac3d Bug 1361900: Part 1 - Make CDMProxy.h compatible with mozilla::Result. r=JamesCheng
MozReview-Commit-ID: DiO7IPFYKbE

--HG--
extra : rebase_source : defeef269706ba81ee35272818e468e3ae0b2b19
2017-05-12 12:08:43 -07:00
Chris Pearce 873955b81f Bug 1360389 - Have ChromiumCDMParent inform CDMProxy of shutdown. r=gerald
The ChromiumCDMParent is informed of the shutdown of its plugin, so we can
use that to inform the CDMProxy that its connection to the CDM has been
severed. This means we shutdown cleanly if the browser closes while playing.

MozReview-Commit-ID: HphQ2exu1gj

--HG--
extra : rebase_source : ff9ee3699915e8b7527570e839eb3bb0a0ab46bc
2017-04-28 12:02:14 +12:00
Chris Pearce 5fe1464d84 Bug 1357133 - Recover from incorrectly guessing the CDM's shmem sizes. r=gerald
We are pre-allocating shmems in the content process for use by the CDM in the
GMP process. We guess the size of shmem required. However if we guess wrong,
currently we always end up taking the non-shmem path for video frames to
return to the content process, which results in us sending another shmem
(of the wrong size) to the CDM, and this continues until we hit the limit
on the number of shmems that we tolerate the CDM asking for.

So in this patch, I change our behaviour to detect when we're allocating
shmems that are too small, whereupon we purge the existing shmems and switch
to allocating them at the size being requested by the CDM.

This means we recover from incorrectly guessing the size of shmems required
by the CDM. The overhead of an incorrect guess should be one video frame
transferred via the nsTArray path.


MozReview-Commit-ID: 8o1s7FI2UBd

--HG--
extra : rebase_source : 0612d199686278612e8c58dc97e96a9304ea3ee9
2017-04-28 08:55:28 +12:00
Carsten "Tomcat" Book e1e203f1f5 Merge mozilla-central to autoland 2017-04-27 16:36:41 +02:00
Chris Pearce ce7bb69227 Bug 1358373 - Handle underestimating how many shmems the CDM needs to return decoded video frames to Gecko. r=gerald
The CDM process can't allocate shmems itself because it's sandboxed, so we
pre-allocate shmems in the content process and send them to the GMP process for
the CDM to use. Some sites seem to have encoded their content in such a way as
to cause the CDM to allocate and hang onto more frames than we pre-allocate; so
we run out of shmems in the GMP process, and the CDM can't allocate further
buffers to return output, and we fail.

So change the ChromiumCDMChild to allocate non-shmem-backed buffers if it runs
out of shmems, and return the result to the content process as an nsTArray.
Upon receiving that, the parent will send an extra shmem to the child, to
hopefully avoid the slow path again.

Also increase media.eme.chromium-api.video-shmems to 4, so that we're less
likely to hit this slow path in the wild. I've seen that Lightbox.co.nz and
Microsoft's EME test-drive require 4 shmems.

MozReview-Commit-ID: ISQYDkTj5uY

--HG--
extra : rebase_source : 92870f1adc7ae68e58b15443e4223012bdf0e39a
2017-04-26 15:46:09 +12:00
Iris Hsiao c43c229375 Backed out changeset 0b8bf5cb743f (bug 1358373) for build bustage. a=backout
CLOSED TREE

--HG--
extra : amend_source : f6fd0c93b8b1ff9cc111cc4bc7776dd8e2a383d0
2017-04-27 10:10:47 +08:00
Chris Pearce ecfe3c34c4 Bug 1358373 - Handle underestimating how many shmems the CDM needs to return decoded video frames to Gecko. r=gerald
The CDM process can't allocate shmems itself because it's sandboxed, so we
pre-allocate shmems in the content process and send them to the GMP process for
the CDM to use. Some sites seem to have encoded their content in such a way as
to cause the CDM to allocate and hang onto more frames than we pre-allocate; so
we run out of shmems in the GMP process, and the CDM can't allocate further
buffers to return output, and we fail.

So change the ChromiumCDMChild to allocate non-shmem-backed buffers if it runs
out of shmems, and return the result to the content process as an nsTArray.
Upon receiving that, the parent will send an extra shmem to the child, to
hopefully avoid the slow path again.

Also increase media.eme.chromium-api.video-shmems to 4, so that we're less
likely to hit this slow path in the wild. I've seen that Lightbox.co.nz and
Microsoft's EME test-drive require 4 shmems.

MozReview-Commit-ID: ISQYDkTj5uY

--HG--
extra : rebase_source : 4beba0212411a0f5867feb506bbf732f5a934fa9
2017-04-26 15:46:09 +12:00
JW Wang 80c9f230f3 Bug 1359715 - let functions in MediaData.h take TimeUnit instead of int64_t. r=kaku
We want to replace the use of int64_t for microseconds by TimeUnit
whenever possible since int64_t is ambiguous which could be microseconds
or milliseconds.

MozReview-Commit-ID: LRz9d4yKBYJ

--HG--
extra : rebase_source : 1f73f1f338142b3183491d04726821a881ccabbe
extra : intermediate-source : 88e167b7b06303d10d92cd5317502f405d1c553e
extra : source : 98deb30ec93d395f9951f5fc488170ae35e29675
2017-04-24 17:33:05 +08:00
Gerald Squelart 5d664e32ad Bug 1355506 - Ensure the ChromiumCDMProxy stays alive until the parent has completed its Shutdown(). r=cpearce
MozReview-Commit-ID: 4D0kw0U55JO

--HG--
extra : rebase_source : 42f8b4e4fec2e652987c0d3dc68c83d061de3981
2017-04-20 17:05:03 +12:00
JW Wang 302d82c85a Bug 1356530 - Change the type of MediaData::mTime to TimeUnit since int64_t is ambiguous. r=kaku
MozReview-Commit-ID: 4bVeqIuWO2O

--HG--
extra : rebase_source : d504ac15a6dc59ad42f3ab80faf23f629d74315f
extra : intermediate-source : 6e52995b6c8146451d98dffc62f6907755dc856e
extra : source : 82d2649cdafb5a6389f6858c23578811933580c9
2017-04-14 17:13:36 +08:00
JW Wang 6359124d70 Bug 1355756. P3 - let CreateAndCopyData() and its friends take TimeUnit for duration. r=gerald
MozReview-Commit-ID: ES0on9VCuu3

--HG--
extra : rebase_source : 8d3e80ec2e1923587b5865516a16bfff9009397d
extra : intermediate-source : 3e59c61b1ccef78e3e8fe52791d7104aade7930c
extra : source : 46fd639ea6a2219bbed70f6555a2acf03ec01a7a
2017-04-12 17:46:09 +08:00
JW Wang 464497b945 Bug 1355756. P1 - change the type of MediaData::mDuration to TimeUnit. r=gerald
MozReview-Commit-ID: 3d4bUYtSuMI

--HG--
extra : rebase_source : 94c821b6d381421035e6a12cbe038436055c5822
extra : intermediate-source : 9a06beffc736486f47b9cf05e7f482e726d53068
extra : source : fdbdcd5c1474f04dc1dbde66fcf3a9ecec953053
2017-04-12 17:27:34 +08:00
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
Chris Pearce fb5a8a3e0d Bug 1351953 - Send Data to CDM for decrypt and or decode in shmems. r=gerald
MozReview-Commit-ID: 2UdGimoOLKr

--HG--
extra : rebase_source : 04879d8c1639bf6f14cebc6031d8cc23e05e567a
2017-03-27 13:19:38 +13:00
Chris Pearce caac622c6d Bug 1315850 - Implement CDM persistent sessions. r=gerald
This is required for the browser clearing persistence tests to pass.

MozReview-Commit-ID: Ai9qc6Ds1IG

--HG--
extra : rebase_source : 80c2133e26742410fda983e3c18c35736fc013d0
2017-03-09 19:09:43 +13:00
Chris Pearce bf0e67458a Bug 1315850 - Shutdown ChromiumCDMParent. r=gerald
MozReview-Commit-ID: E82ETFS90eH

--HG--
extra : rebase_source : 6f0d72f76e313b55f7c905d5878c63b8d7292b1b
2017-03-09 17:34:18 +13:00
Chris Pearce 4c421503a8 Bug 1315850 - Shutdown CDMVideoDecoder. r=jya
This severs the ChromiumCDMVideoDecoder's connection with the CDM. The CDM process
will shutdown when the MediaKeys also severs its connection.

MozReview-Commit-ID: Aqc4y5Nxjvc

--HG--
extra : rebase_source : 5a2f77ffe84f9b99b4668520c838b29a428578d3
2017-03-08 10:20:33 +13:00
Chris Pearce dbc1c7bcdf Bug 1315850 - Implement CDM video decoder drain. r=jya
MozReview-Commit-ID: 5RbrWyLglRf

--HG--
extra : rebase_source : 3f9636503523f0c6effab15fa89cce25a961a0b4
2017-03-07 16:37:21 +13:00
Chris Pearce abcd1aee62 Bug 1315850 - Implement CDM video decoder flush. r=jya
MozReview-Commit-ID: 3CzwfOCXGP

--HG--
extra : rebase_source : 8ee1ae28a36779484717c6b105ef7730dd1896b3
2017-02-14 22:42:26 +13:00
Chris Pearce 6f73601a0b Bug 1315850 - Implement video decoding through CDM. r=jya
At this stage, I store video frames in memory in nsTArrays rather than in
shmems just so we can get this working. Once this is working, I'll follow up
with patches to switch to storing all large buffer traffic between the CDM and
other processes in shmems.

I'm not planning on preffing this new CDM path on until that's in place.

MozReview-Commit-ID: LSTb42msWQS

--HG--
extra : rebase_source : b7f162515a1a32b2c344c11d0fa5c7004cec2e15
2017-03-09 11:32:15 +13:00
Chris Pearce a181e5dc64 Bug 1315850 - Initialize video decoder. r=jya
MozReview-Commit-ID: 559SP0ECldq

--HG--
extra : rebase_source : b6d499cafef2d6a6558b0db703b60320dea67803
2017-03-09 18:17:50 +13:00
Chris Pearce 4961ac416a Bug 1315850 - Send decrypt operations to Chromium CDM. r=gerald
We still use the same EMEDecryptor MediaDataDecoder as is used by the existing
EME decrypting path.

MozReview-Commit-ID: 3pXPjChctLb

--HG--
extra : rebase_source : 67575a02290ddb871510dd88f59fdab77658b3ce
2017-03-09 11:31:07 +13:00
Chris Pearce ed269500ea Bug 1315850 - Add more logging to Chromium CDM actors. r=gerald
MozReview-Commit-ID: 2DcprLAE1bg

--HG--
extra : rebase_source : b7de793c7676ace43d34a9556ef803e1bd3df239
2017-03-09 11:42:12 +13:00
Chris Pearce a8a6db3db7 Bug 1315850 - Connect MediaKeys.createSession to Chromium CDM. r=gerald
MozReview-Commit-ID: AzvypvetoOL

--HG--
extra : rebase_source : cf303b0d792dfd86f1056529eb4c081d84fc2e82
2016-11-30 14:51:18 +13:00
Chris Pearce 0c935efca9 Bug 1315850 - Handle sending and receiving key session messages. r=gerald
MozReview-Commit-ID: 6hLPFLFRD5I

--HG--
extra : rebase_source : 0931d65116bf0c499933efc58cae97b275b0ba85
2017-03-08 16:41:06 +13:00
Chris Pearce a987efe1ed Bug 1315850 - Implement ChromiumCDMProxy initialization. r=gerald
This means the MediaKeys is able to create a CDM.

MozReview-Commit-ID: 94Xc7sCLhH3

--HG--
extra : rebase_source : 914db1f04e0770776ae25c7b8bdc59e729fe78d0
2017-03-09 11:29:45 +13:00
Chris Pearce e140103fca Bug 1315850 - Add PChromiumCDM.ipdl for Widevine CDM. r=gerald
The implementations of this protocol will be stubbed out in later patches.

MozReview-Commit-ID: 622CB1BOoR9

--HG--
extra : rebase_source : b796bfb4c0d0d2872787043e3b9fc83a0e6b09ea
2017-02-23 11:51:00 +13:00