Get all the statistics in one call, under the same mutex, and extract from them the decoded and total frames. The individual getters were previously used, created uncertainty since they lock the mutex separately.
Differential Revision: https://phabricator.services.mozilla.com/D75096
This patch will do :
- add test cases
- introduce the test-only notification `media-displayed-metadata-changed` when the event source updates its metadata
The advantage of doing so :
- increase test coverage
Differential Revision: https://phabricator.services.mozilla.com/D72501
This patch will do :
- play media from different frame, rather than alway playing media from the main frame
The advantage of doing so :
- to make the media session in child frame become the active media session because that can only be the context with the audio focus
Differential Revision: https://phabricator.services.mozilla.com/D72500
This patch will do :
- remove out-of-date test that uses the previous implementation of determining the active media session
The advantage of doing so :
- prevent the failure causing by out-of-date test
Differential Revision: https://phabricator.services.mozilla.com/D72499
This patch will do :
- listen to the playback change from the event source directly
The advantage of doing so :
- more close to the real situation because the event source is where we decide the information that should be displayed the virtual control interface
Differential Revision: https://phabricator.services.mozilla.com/D72498
This patch will do :
- postpone the timing of activating the media controller. Activate the controller after it first time becomes audible.
The advantage of doing so :
- prevent setting incorrect media metadata before the controller becomes audible
---
More details about this change :
The active media session would be chose after the context owns the audio focus. Therefore, if we would like to get the correct metadata from the media session, we should postpone the timimg of activate controller and wait until we decide the active media session then we can get the correct metadata.
Differential Revision: https://phabricator.services.mozilla.com/D72497
This patch will do :
- using the audio focus to decide which media session is the active media session. That is a recommend way of the spec [1].
The advantage of doing so :
- prevent to routing media control keys to incorrect media session
- prevent showing the incorrect metadata on the virtual control interface
[1] https://w3c.github.io/mediasession/#active-media-session
Differential Revision: https://phabricator.services.mozilla.com/D72496
This patch will do :
- introduce a concept `audio focus` among different contexts within a tab
- determine the audio focus owner when the context becomes audible or the owner destroys
The advantage of doing so :
- the audio focus helps us to decide the active media session that would be implemented in the following part
More details:
When there are serveral contexts playing at the same time within a tab, we would like to determine an audible context from them to represent the tab, and that is the `audio focus` we mean in this bug.
Differential Revision: https://phabricator.services.mozilla.com/D72495
This patch will do :
- rename `MediaSessionController` to `MediaStatusManager`
- move `MediaStatusManager.*` to the folder under `mediacontrol`
- update the comment for `MediaStatusManager`
The advantage of doing so :
- increase the readability
More details :
We've extended the responsibility of `MediaSessionController` and it now handle a broader concept of media related status, not just media session related. Therefore, renaming it to precisely represent o its responsibility.
Differential Revision: https://phabricator.services.mozilla.com/D73493
This patch will do :
- rename variables and remove unnecessary spaces
The advantage of doing so :
- increase the readability
Differential Revision: https://phabricator.services.mozilla.com/D73491
This patch will do :
- create an interface `IMediaController` including only control related methods
The advantage of doing so :
- It's clear to use `IMediaController` as the only surface to control media
- explictly restrict which functions are available which can avoid using control related functions on those situations
Differential Revision: https://phabricator.services.mozilla.com/D73490
This patch will do :
- make all functions which are used to update information from the content process become a part of `IMediaInfoUpdater`
The advantage of doing so :
- It's clear to use `IMediaInfoUpdater` as the only surface to update the media related status
- explictly restrict which functions are available which can avoid using control related functions on those situations
Differential Revision: https://phabricator.services.mozilla.com/D73489
This patch will do :
- move the logic of determining `actual playback state` to `MediaSessionController`
The advantage of doing so :
- increate the cohesion of `MediaSessionController` because it should be the class to determine the final playback status, not `MediaController`
Differential Revision: https://phabricator.services.mozilla.com/D73488
This patch will do :
- move the instance of `MediaPlaybackStatus` to the `MediaSessionController` to allow `MediaSessionController` handle all media related status
The advantage of doing so :
- encapsulate all media related status details to `MediaSessionController` and simplify the code in `MediaController`
Differential Revision: https://phabricator.services.mozilla.com/D73487
This patch will do :
- implement a new class `MediaPlaybackStatus` to handle the detail of modifying different media status counter
The advantage of doing so :
- encapsulate the low level details to the delegate and simplify the code in `MediaController`
- help us maintain separated media status for each different context within a tab
- using `MediaPlaybackStatus` can fix the problem of not `IsAudible()` being able to represent the actual audible state of media controller
Differential Revision: https://phabricator.services.mozilla.com/D73486
This patch will do :
- make `NotifyMediaPlaybackChanged` and `NotifyMediaAudibleChanged` accept one more paramter that indicates where those update come from
The advantage of doing so :
- we would use that to maintain separated media status for each different context in the future patch.
Differential Revision: https://phabricator.services.mozilla.com/D72471
DestroyMediaTrack() is called only on Unlink or destruction of the AudioDestinationNode.
If there are no references to the AudioDestinationNode, then the graph's last stream
will be destroyed and the graph will shut down itself.
Differential Revision: https://phabricator.services.mozilla.com/D74812