This patch implements how to use MediaController to control corresponding media in content processes.
Differential Revision: https://phabricator.services.mozilla.com/D38145
--HG--
extra : moz-landing-system : lando
We implement some helpful functions in MediaControlUtils which can be used to notify controller when media starts/stops playing or become audible/inaudible.
For now, we can temporarily notify these changes in AudioChannelService where we have already known when media has these kinds of status changing.
Differential Revision: https://phabricator.services.mozilla.com/D38144
--HG--
extra : moz-landing-system : lando
We don't want to enable audio competing by default, so hide this feature behind a static pref.
Differential Revision: https://phabricator.services.mozilla.com/D38143
--HG--
extra : moz-landing-system : lando
In order to support audio competing among different tabs, we implement a new class AudioFocusManager.
AudioFocusManager is used to assign the audio focus to different requester and decide which requester can own audio focus when audio competing happens.
When the audio competing happens, the last request would be a winner who can still own the audio focus, and all the other requesters would lose the audio focus.
Now MediaController is the onlt requester, it would request the audio focus when it becomes audible and revoke the audio focus when the controller is no longer active.
Differential Revision: https://phabricator.services.mozilla.com/D38142
--HG--
extra : moz-landing-system : lando
In order to have a centralized audio control in the parent process, we create two new classes here.
* MediaController
MediaController is a class used to control certain amount of media in the content process. Every controller corresponds to a browsing context.
For example, TabMediaController would correspond to the top level browsing context, which mean it can control all media in the specific tab.
* MediaControlService
As there might be multiple tabs playing audio, so there would be multiple controllers. MediaControlService is a place to manage all of them, you can access specific controller through MediaControlService by providing controller ID.
Everytime a controller becomes active, which means there is a media starts in corresponding browsing context, then controller would be added into the list of the MediaControlService. And it would be removed from the list when the media in corresponding browsering context stopped.
Differential Revision: https://phabricator.services.mozilla.com/D38141
--HG--
extra : moz-landing-system : lando
It would cause an assertion failure when OutputStreamManager was released on
main thread. It could be wrapped in an nsMainThreadPtrHandle instead, but that's
exactly what mPrincipalHandle is, so we can use that for both needs.
Differential Revision: https://phabricator.services.mozilla.com/D40789
--HG--
extra : moz-landing-system : lando
1. ShmemPool.cpp is now built for --disable-webrtc builds.
2. ShmemPool no longer uses the gCamerasParentLog logger, it
uses its own logger.
3. ShmemPool log macros were updated with a SHMEMPOOL_ prefix
to avoid undef-ing other log macros.
Differential Revision: https://phabricator.services.mozilla.com/D40722
--HG--
extra : moz-landing-system : lando
Create an event in MediaFormatReader the will signal to the HTMLMediaElement to initiate a new storing according to the latest VideoInfo. Also when the application is shutting down, trigger a new storing early enough, before all the events are disconnected.
Differential Revision: https://phabricator.services.mozilla.com/D38316
--HG--
extra : moz-landing-system : lando
Make use of the new DecoderBenchmark class in MediaCapabilities instead of the old Benchmark mechanism.
Differential Revision: https://phabricator.services.mozilla.com/D38315
--HG--
extra : moz-landing-system : lando
Create a class that gets the video properties and the frame statistics, calculates the score in percentage for that video playback, creates a key string according to video properties and trigger the storage of the score.
The video properties used are the resolution, the frame rate and the bitdepth.
For the key, a range of levels has been created for each property and the video is categorised on the closest levels. The key consists of the various levels like: "ResolutionLevel5-FrameRateLevel1-8bit".
Finaly, it uses the IPDL protocol to store the pair of the score and the key.
Differential Revision: https://phabricator.services.mozilla.com/D38314
--HG--
extra : moz-landing-system : lando
The database is accessible from the parent process due to to the sandbox thus it is required an IPDL protocol that will transfer the queries and the results
Differential Revision: https://phabricator.services.mozilla.com/D38313
--HG--
extra : moz-landing-system : lando
This patch implements how to use MediaController to control corresponding media in content processes.
Differential Revision: https://phabricator.services.mozilla.com/D38145
--HG--
extra : moz-landing-system : lando
We implement some helpful functions in MediaControlUtils which can be used to notify controller when media starts/stops playing or become audible/inaudible.
For now, we can temporarily notify these changes in AudioChannelService where we have already known when media has these kinds of status changing.
Differential Revision: https://phabricator.services.mozilla.com/D38144
--HG--
extra : moz-landing-system : lando
We don't want to enable audio competing by default, so hide this feature behind a static pref.
Differential Revision: https://phabricator.services.mozilla.com/D38143
--HG--
extra : moz-landing-system : lando
In order to support audio competing among different tabs, we implement a new class AudioFocusManager.
AudioFocusManager is used to assign the audio focus to different requester and decide which requester can own audio focus when audio competing happens.
When the audio competing happens, the last request would be a winner who can still own the audio focus, and all the other requesters would lose the audio focus.
Now MediaController is the onlt requester, it would request the audio focus when it becomes audible and revoke the audio focus when the controller is no longer active.
Differential Revision: https://phabricator.services.mozilla.com/D38142
--HG--
extra : moz-landing-system : lando
In order to have a centralized audio control in the parent process, we create two new classes here.
* MediaController
MediaController is a class used to control certain amount of media in the content process. Every controller corresponds to a browsing context.
For example, TabMediaController would correspond to the top level browsing context, which mean it can control all media in the specific tab.
* MediaControlService
As there might be multiple tabs playing audio, so there would be multiple controllers. MediaControlService is a place to manage all of them, you can access specific controller through MediaControlService by providing controller ID.
Everytime a controller becomes active, which means there is a media starts in corresponding browsing context, then controller would be added into the list of the MediaControlService. And it would be removed from the list when the media in corresponding browsering context stopped.
Differential Revision: https://phabricator.services.mozilla.com/D38141
--HG--
extra : moz-landing-system : lando
If webm is disabled or not compiled in, the video assert would fail if trying
to record a video track -- we'd only have an ogg/opus encoder.
Differential Revision: https://phabricator.services.mozilla.com/D40648
--HG--
extra : moz-landing-system : lando
This hasn't been needed since the last larger refactor of DecodedStream
(bug 1423241), but got incorporated wrongly with bug 1493613.
When DecodedStream is Stop()ed and then Start()ed, a track is added to the graph
with a playout position starting at 0, and mStartTime is set to the starting
position, i.e., the seeked position in case of a seek or 0 if decoding from the
start of a file.
Hence, the reported position by DecodedStream should be mStartTime plus the last
reported output time of the tracks.
mStreamTimeOffset was offseting the tracks' reported output time further, so
DecodedStream was reporting a too large number.
Differential Revision: https://phabricator.services.mozilla.com/D40626
--HG--
extra : moz-landing-system : lando
If the encoded frame is a keyframe, we should also mark the MediaRawData which would contain the data from this encoded frame as a keyframe.
Differential Revision: https://phabricator.services.mozilla.com/D40465
--HG--
extra : moz-landing-system : lando
As we are not going to modify the CodecSpecific, it should keep const when we forward it.
Differential Revision: https://phabricator.services.mozilla.com/D40464
--HG--
extra : moz-landing-system : lando
We don't have a contraint for using PlatformEncoderModule in the specific thread only, so we should use thread-safe refcounting for it, like PlatformDecoderModule.
Differential Revision: https://phabricator.services.mozilla.com/D40463
--HG--
extra : moz-landing-system : lando
This removes all telemetry which expired in Firefox 69 or earlier, with the
exceptions of the following, which we plan to renew:
* AUDIO_TRACK_SILENCE_PROPORTION
* MEDIA_AUTOPLAY_WOULD_BE_ALLOWED_COUNT
* MEDIA_AUTOPLAY_WOULD_NOT_BE_ALLOWED_COUNT
* MEDIACACHESTREAM_LENGTH_KB
* MEDIA_MKV_CANPLAY_REQUESTED
* MEDIA_PAGE_COUNT
* MEDIA_PAGE_HAD_MEDIA_COUNT
* VIDEO_DROPPED_FRAMES_PROPORTION
* VIDEO_PLAY_TIME
* VIDEO_HIDDEN_PLAY_TIME
* VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE
* VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE
* VIDEO_INTER_KEYFRAME_AVERAGE_MS
* VIDEO_INTER_KEYFRAME_MAX_MS
* VIDEO_SUSPEND_RECOVERY_TIME_MS
* VIDEO_VP9_BENCHMARK_FPS
* WEB_AUDIO_BECOMES_AUDIBLE_TIME
* WEBVTT_TRACK_KINDS
Differential Revision: https://phabricator.services.mozilla.com/D37313
--HG--
extra : moz-landing-system : lando
This removes all telemetry which expired in Firefox 69 or earlier, with the
exceptions of the following, which we plan to renew:
* AUDIO_TRACK_SILENCE_PROPORTION
* MEDIA_AUTOPLAY_WOULD_BE_ALLOWED_COUNT
* MEDIA_AUTOPLAY_WOULD_NOT_BE_ALLOWED_COUNT
* MEDIACACHESTREAM_LENGTH_KB
* MEDIA_MKV_CANPLAY_REQUESTED
* MEDIA_PAGE_COUNT
* MEDIA_PAGE_HAD_MEDIA_COUNT
* VIDEO_DROPPED_FRAMES_PROPORTION
* VIDEO_PLAY_TIME
* VIDEO_HIDDEN_PLAY_TIME
* VIDEO_HIDDEN_PLAY_TIME_PERCENTAGE
* VIDEO_INFERRED_DECODE_SUSPEND_PERCENTAGE
* VIDEO_INTER_KEYFRAME_AVERAGE_MS
* VIDEO_INTER_KEYFRAME_MAX_MS
* VIDEO_SUSPEND_RECOVERY_TIME_MS
* VIDEO_VP9_BENCHMARK_FPS
* WEB_AUDIO_BECOMES_AUDIBLE_TIME
* WEBVTT_TRACK_KINDS
Differential Revision: https://phabricator.services.mozilla.com/D37313
--HG--
extra : moz-landing-system : lando