Bug 1510424/D13135 remove them from Windows along with Android by mistake.
This patch also moves some code to separate Android only logic from other
platforms to avoid making similar mistakes.
Differential Revision: https://phabricator.services.mozilla.com/D59248
--HG--
extra : moz-landing-system : lando
Based on the main controller's play state to set the correct playback state to the event source.
Differential Revision: https://phabricator.services.mozilla.com/D58261
--HG--
extra : moz-landing-system : lando
Implement a class `ControllerManager` to wrap the details of how to select the main controller, which would also be used to monitor main controller's play state change.
Differential Revision: https://phabricator.services.mozilla.com/D58260
--HG--
extra : moz-landing-system : lando
We use `PlaybackState` to replace `boolean` which can clearly indicate what controller's current state is and introduce a new method `PlayStateChangedEvent()` which can be used to monitor the play state change of the media controller.
Differential Revision: https://phabricator.services.mozilla.com/D58174
--HG--
extra : moz-landing-system : lando
Since we would like to use `PlaybackState` in MediaController, we move it out from `MediaEventSource` and put it in `MediaControl.h`, which makes more sense because it actually represents media controller's playback state.
In addition, modify `ePlayed` to `ePlaying` and add one new state `eStopped`.
Differential Revision: https://phabricator.services.mozilla.com/D59100
--HG--
extra : moz-landing-system : lando
Prior to this patch we prevented permission requests firing if the code was
executed in a parent process. This makes sense for e10s, as only content
processes should do so. However, if we're in non-e10s mode then the single
process we run the code in is considered a parent process for the purpose of our
check and we don't fire the request.
This patch changes the check to not send the request if we're specifically in an
e10s parent process.
Differential Revision: https://phabricator.services.mozilla.com/D59404
--HG--
extra : moz-landing-system : lando
The window will be supplied in the recording-device-events notification and mediaCaptureWindowState will be called on each window in turn.
Differential Revision: https://phabricator.services.mozilla.com/D56569
--HG--
extra : moz-landing-system : lando
When media element is inactive, asking MDSM to seek is actually useless, because all the data we decode won't be showed to user. In addition, we have to store extra pending events for `seeking` and `seeked`, which might result in memory overflow if the inactive page is calling `seek()` all the time.
Therfore, we should delay all seeking tasks while media is inactive, and perform the latest seeking task when media becomes active.
Differential Revision: https://phabricator.services.mozilla.com/D58918
--HG--
extra : moz-landing-system : lando
After XPCOM is shutdown, `sBrowsingContext` would be released, so using `BrowsingContext::Get()` would cause crash. Therefore, after shutdown XPCOM, we should not access browsing context.
Differential Revision: https://phabricator.services.mozilla.com/D59079
--HG--
extra : moz-landing-system : lando
It's possible that `self` is the last pointer holding the media cache, so we have to ensure releasing `self` on main thread because media cache should always be destroyed on main thread only.
Differential Revision: https://phabricator.services.mozilla.com/D58900
--HG--
extra : moz-landing-system : lando
This removes various unused `#include "nsAutoPtr.h"` in `xpcom/`. Additionally
adds a few includes to the media stack.
Differential Revision: https://phabricator.services.mozilla.com/D58282
--HG--
extra : moz-landing-system : lando
Using JSON.stringify in dom/tests/mochitest/chrome/test_clonewrapper.xhtml might not be the best solution, because
the testObject contains ImageData objects.
Differential Revision: https://phabricator.services.mozilla.com/D58645
--HG--
extra : moz-landing-system : lando
Java callback runs on Android binder thread and can be preempted by
encoder task queue so that ProcessOutput() is queued after
ProcessShutdown(). Discard the output when that happens.
Differential Revision: https://phabricator.services.mozilla.com/D55759
--HG--
extra : moz-landing-system : lando
Use `MediaControlKeysEventHandler` to handle the control keys event, which can always find corresponding controlled media if there are some.
Differential Revision: https://phabricator.services.mozilla.com/D57575
--HG--
extra : moz-landing-system : lando
Introduce `ControlledMediaState` to media controller, so now we can now how many controlled media are playing, which allow us to update `mIsPlaying` correctly.
Differential Revision: https://phabricator.services.mozilla.com/D57574
--HG--
extra : moz-landing-system : lando
Modify IPC method to support notify `ControlledMediaState` to the media controller, and remove the previous implementation.
Differential Revision: https://phabricator.services.mozilla.com/D57572
--HG--
extra : moz-landing-system : lando
Implement class `ContentMediaController` that is used to dispatch media controls key events to those media which would like to be controlled.
`ContentMediaController` is inherited from two classes, `MediaControlAgent` and `MediaControlKeysEventHandler`. The former one is used for controlled media, the controlled media can register itself to `MediaControlAgent` to receive events and do corresponding operations depending on the event type. The latter one is used to handle events sent from chrome process and dispatch them to the corresponding controlled media.
Differential Revision: https://phabricator.services.mozilla.com/D57570
--HG--
extra : moz-landing-system : lando
On macOS 10.12.1+, we use `MediaPlayer` library, which has better media key integration, to replace the implementation of `CG EventLoop`.
Differential Revision: https://phabricator.services.mozilla.com/D46890
--HG--
extra : moz-landing-system : lando
The sample we got from demuxer are all guaranteed to be valid because they are returned in a `SamplesHolder`, which has assertion to make sure all samples appended are valid [1].
`ProcessFrame()` might be a possible place where we incorrectly change sample from valid to invalid, because we modify sample's time and duration there. Therefore, adding an assertion to make sure all samples are still valid.
[1] https://searchfox.org/mozilla-central/source/dom/media/MediaDataDemuxer.h#103-106
Differential Revision: https://phabricator.services.mozilla.com/D58393
--HG--
extra : moz-landing-system : lando
We have no plan to use those functions, so remove them in order to keep code clean.
Differential Revision: https://phabricator.services.mozilla.com/D58172
--HG--
extra : moz-landing-system : lando
When a function returning a pointer, returning a raw pointer is enough. The callers should use `RefPtr` to store this pointer explicitly if they do need to add a refcounting.
In addition, using `RefPtr` in the parameter cannot prevent anything as well.
Differential Revision: https://phabricator.services.mozilla.com/D58171
--HG--
extra : moz-landing-system : lando
We have no plan to use those functions, so remove them in order to keep code clean.
Differential Revision: https://phabricator.services.mozilla.com/D58172
--HG--
extra : moz-landing-system : lando
When a function returning a pointer, returning a raw pointer is enough. The callers should use `RefPtr` to store this pointer explicitly if they do need to add a refcounting.
In addition, using `RefPtr` in the parameter cannot prevent anything as well.
Differential Revision: https://phabricator.services.mozilla.com/D58171
--HG--
extra : moz-landing-system : lando
Remove the security.sandbox.gmp.mac.earlyinit pref now that GMP early sandbox init is the default on release.
Remove the old unused code paths for initializing the GMP sandbox later during process startup (only used when security.sandbox.gmp.mac.earlyinit=false).
Differential Revision: https://phabricator.services.mozilla.com/D54968
--HG--
extra : moz-landing-system : lando
Remove the security.sandbox.rdd.mac.earlyinit pref now that RDD early sandbox init is the default on release.
Remove the old unused code paths for initializing the RDD sandbox later during process startup (only used when security.sandbox.rdd.mac.earlyinit=false).
Differential Revision: https://phabricator.services.mozilla.com/D54967
--HG--
extra : moz-landing-system : lando
Inheriting from `nsISupports` is too complicated if we just want to support refcounting. Instead, we can use `NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING` to declare `Add/RemoveRef()` as pure virtual functions in order to create ref-counted abstract classes.
Differential Revision: https://phabricator.services.mozilla.com/D57714
--HG--
extra : moz-landing-system : lando
We handle media control key events differently from normal key events, and at this point we haven't finished the implementation of capturing media control key events on each platform. Therefore, create a method to generate platform-independent events in order to help testing.
Differential Revision: https://phabricator.services.mozilla.com/D57911
--HG--
extra : moz-landing-system : lando