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

1236 Коммитов

Автор SHA1 Сообщение Дата
alwu 7db6ce8171 Bug 1621166 - part2 : do not stop media control for media being used in PIP mode. r=MeFisto94
The media element being used in the PIP mode would always display on the screen even if the the tab it belongs to is in the background, so users would have high chance to interact with it again. Therefore, we don't want to start a stop-timer to cancel media control for that element.

Differential Revision: https://phabricator.services.mozilla.com/D67381

--HG--
extra : moz-landing-system : lando
2020-03-19 18:15:33 +00:00
alwu 86fbf04461 Bug 1621166 - part1 : add a method to know if media element is being used in PIP mode. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D67380

--HG--
extra : moz-landing-system : lando
2020-03-19 21:01:12 +00:00
Chris Fronk d5b004443b Bug 1143478 - Rename mozilla::Pair to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64511

--HG--
rename : mfbt/Pair.h => mfbt/CompactPair.h
extra : moz-landing-system : lando
2020-03-17 12:42:12 +00:00
Alex Chronopoulos 9fb4eecd46 Bug 1617915 - Expose output device id when MediaTrackGraph is created. r=padenot
In order to be able to change the audio output device, the device id is exposed to the constructor of MediaStreamGraph. Any component that gets/creates an MTG will be able to provide the device id in order to determine the desired output device. If the provided device id is null the default device will be used.

Differential Revision: https://phabricator.services.mozilla.com/D64133

--HG--
extra : moz-landing-system : lando
2020-03-16 12:56:20 +00:00
shindli b02b3a6e1a Backed out changeset a08637fb30c8 (bug 1143478) for causing bustages in /builds/worker/checkouts/gecko/ipc/mscom/Registration.cpp CLOSED TREE
--HG--
rename : mfbt/CompactPair.h => mfbt/Pair.h
2020-03-11 14:30:54 +02:00
Chris Fronk a27e438c2d Bug 1143478 - Rename mozilla::Pair to CompactPair. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D64511

--HG--
rename : mfbt/Pair.h => mfbt/CompactPair.h
extra : moz-landing-system : lando
2020-03-11 12:18:13 +00:00
alwu 7dc5318e3b Bug 1617033 - part8 : add an eligible media duration value to filter out notification sound. r=chunmin
Intercepting media control keys would also come up with the virtual control interface in most of platforms, and for the notification sound we don't want either to show the interface or control them.

Currently we use 3s as a threshold to filter those short duration media which are possible to be a notification sound.

Differential Revision: https://phabricator.services.mozilla.com/D64478

--HG--
extra : moz-landing-system : lando
2020-03-06 17:52:15 +00:00
alwu 00f2d0c596 Bug 1617033 - part4 : add a timer to stop listening to media control key events. r=chunmin
This patch is used to prevent intercepting media keys from other applications which should really receive media keys. For example, if user finishes watching a video but doesn't close that tab, and switch to other tasks. Then if they have other applications which are playing music, when they press media keys, the application which should receive media keys should be those background music app, not Firefox.

Therefore, if the media has been paused for a while, then that might indicate that user won't need to control this media anymore. Therefore, we create a timer, which default expire time is 60s, to stop listening media control key events for those kinds of media. But if the media starts again during this period, we would destroy timer and continue to control that media.

Differential Revision: https://phabricator.services.mozilla.com/D63918

--HG--
extra : moz-landing-system : lando
2020-03-06 17:47:58 +00:00
alwu c1a25664ec Bug 1617033 - part3 : add comment to explicitly mention some functions should only be used after starting listener. r=chunmin
Differential Revision: https://phabricator.services.mozilla.com/D63916

--HG--
extra : moz-landing-system : lando
2020-03-06 17:46:44 +00:00
alwu ef135def22 Bug 1617033 - part2 : only update audible state after starting listener successfully. r=chunmin
It's useless to update the audible state before starting listening to the media control keys event, so we make it consistent with other functions which could only be used after starting the listener.

As the audible change could happen before we start the listener, we have to manually update audible state to the controller after we start the listener.

Differential Revision: https://phabricator.services.mozilla.com/D63943

--HG--
extra : moz-landing-system : lando
2020-03-06 17:46:07 +00:00
alwu ddbd4e27df Bug 1617033 - part1 : start listening to the event after media becomes audible. r=chunmin
When media is not audible yet, or it's inaudible at all (maybe it's used as a background video or GIF-like image), or the media is in the tab which has been muted totally, we don't want to use media control to control those media, so we should postpone starting listening to the media control keys for them event until they become audible.

Once they become audible, we would keep control them all the time even if they become inaudible again.

Differential Revision: https://phabricator.services.mozilla.com/D63915

--HG--
extra : moz-landing-system : lando
2020-03-06 17:45:29 +00:00
Alastor Wu dcb5adabb7 Bug 1577890 - part8 : remove fennec media control related logic from HTMLMediaElement r=baku
Those suspend and resume related logic were used for implemeting media control and audio focus on Fennec. After removing those things, the only purpose of `AudioChannelAgentCallback` would be muting and unmuting media element from audio channel (eg. clicking sound indicator to mute/unmute tab)

Differential Revision: https://phabricator.services.mozilla.com/D65264

--HG--
extra : moz-landing-system : lando
2020-03-05 06:17:08 +00:00
Alastor Wu afd7e10439 Bug 1577890 - part7 : remove 'computedSuspended' which is a testing-only attribute. r=baku
This attribute is used to expose the internal suspend state of media element to see if we set `SUSPENDED_PAUSE` and `SUSPENDED_PAUSE_DISPOSABLE` correctly. As we don't use those suspend state anymore and have removed the related tests, no need to keep this attribute anymore.

Differential Revision: https://phabricator.services.mozilla.com/D65263

--HG--
extra : moz-landing-system : lando
2020-03-05 06:17:48 +00:00
Alastor Wu e3f41d5cf0 Bug 1577890 - part2 : remove 'media-playback-resumed' notification. r=baku
`media-playback-resumed` was a notification we used on Fennec to indicate media playback state changes and we should update the UI button on the virtual control interface. As it's not being used by anyone since we deprecate Fennec, we can remove all related code.

Differential Revision: https://phabricator.services.mozilla.com/D65258

--HG--
extra : moz-landing-system : lando
2020-03-05 06:09:59 +00:00
Alastor Wu 4c509693cc Bug 1618717 - stop and clear the listener during CC unlink process. r=bryce
At the time CC unlink happens, we would no longer need to listen to the media control key events. Therefore, we should remember to stop and clear the listener to avoid its any method ran after CC.

Differential Revision: https://phabricator.services.mozilla.com/D64787

--HG--
extra : moz-landing-system : lando
2020-02-28 23:39:29 +00:00
Andrew McCreight 4babb2b5ab Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 17:39:15 +00:00
Ciure Andrei 00dd87f6f4 Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG--
extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
2020-02-27 07:05:19 +02:00
Andrew McCreight b197e1f783 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 04:43:48 +00:00
Kris Maglione c31aa68fb4 Bug 1535617: Part 2 - Clear weak references for most cycle collected objects on unlink. r=mccr8
This covers most cycle collected objects which support weak references, but
not the ones which inherit from a cycle collected class and don't do any cycle
collection on their own.

Differential Revision: https://phabricator.services.mozilla.com/D63962

--HG--
extra : moz-landing-system : lando
2020-02-25 19:44:39 +00:00
Simon Giesecke aaf6cb4e75 Bug 1617628 - Hide nsBaseHashtable Put overloads in nsRefPtrHashtable subclass. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63899

--HG--
extra : moz-landing-system : lando
2020-02-25 17:03:36 +00:00
Simon Giesecke 1ed2ba9764 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/html. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63171

--HG--
extra : moz-landing-system : lando
2020-02-20 16:19:15 +00:00
Simon Giesecke b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
shindli 91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Boris Zbarsky 9b0b56bfc7 Bug 1612213 part 3. Switch Promise::RejectWithDOMException consumers to new convenience methods. r=smaug,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D61269

--HG--
extra : moz-landing-system : lando
2020-02-03 20:37:32 +00:00
alwu 7bfc3e2bf5 Bug 1611031 - always trigger corespending controller method when receving media control key events. r=chunmin
The check here was used to prevent calling play or pause during playing or pausing.

However, according to the spec [1], even if media session is playing, we would still want to trigger its play action handler when play action happens. So we should forward all media control key events to the content, not to block any of them.

[1] https://w3c.github.io/mediasession/#handle-media-session-action

Differential Revision: https://phabricator.services.mozilla.com/D60918

--HG--
extra : moz-landing-system : lando
2020-01-24 21:31:34 +00:00
alwu c2d2ecbd96 Bug 1595603 - part2 : delay seeking task when media is inactive r=bryce
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
2020-01-09 17:10:08 +00:00
alwu 25786bc918 Bug 1595603 - part1 : remove duplicate parameter and rename variable r=bryce
Two parameters in `SuspendOrResumeElement()` are acutally the same, they are both related with `IsActive()`, so using one parameter is enough.
In addition, we only suspend or resume element by checking element's active state, so rename `mPausedForInactiveDocumentOrChannel` to `mSuspendedForInactiveDocument` which fits the actual situation more.

Differential Revision: https://phabricator.services.mozilla.com/D58749

--HG--
extra : moz-landing-system : lando
2020-01-09 06:10:02 +00:00
alwu 2d2b857325 Bug 1571493 - part3 : notify media state and audible state changes. r=chunmin
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
2020-01-03 01:34:34 +00:00
alwu f5053f5850 Bug 1571493 - part2 : use 'MediaControlAgent' in media element. r=chunmin
We create `MediaControlEventListener` to register itself to the `MediaControlAgent` that is an event source, so that we can receive the media control event from the evnet source and operate media according to different types of event.

 `MediaControlEventListener` is also used to notify controlled media state to the media controller. When media first starts playing, or leaves bfcache and  has created listener before, we would notify `eStarted`. Notify `eStopped` when media destroys, or enter bfcache and has created listener before. When media's playing state changes, we would notifty `ePlayed` or `ePaused` depeding on media's `mPaused`.

Differential Revision: https://phabricator.services.mozilla.com/D57571

--HG--
extra : moz-landing-system : lando
2020-01-03 01:20:01 +00:00
Alastor Wu 6305f6935f Bug 1588138 - reset blessed state when media aborting current load. r=bryce
This patch is used to change the blessed state for media element under `click-to-play` blocking autoplay policy, which only allows play invocation called from user input handler, eg. `onclick`.

When media aborts current load, we should regard it as a new media. One example is on Youtube they always reuse same media element but replace its url for different video. Therefore, we should reset media's blessed state so that the media with new url can be blocked again.

Differential Revision: https://phabricator.services.mozilla.com/D57192

--HG--
extra : moz-landing-system : lando
2019-12-18 04:11:12 +00:00
Andrew McCreight 058daef5d2 Bug 1603879 - Add a memory reporter for HTMLMediaElement::mPendingEvents. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D57376

--HG--
extra : moz-landing-system : lando
2019-12-17 02:55:15 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
alwu 92b6033d47 Bug 1593843 - part10 : ask for the play permission when creating media element. r=bryce
For media element, as the spec requires that we should know the whether it can be allowed to play when we call `media.play()` [1], which means that we should get the result before the play invocation.

Therefore, we request for the play permission when we create media element.

Differential Revision: https://phabricator.services.mozilla.com/D52438

--HG--
extra : moz-landing-system : lando
2019-11-25 11:00:14 +00:00
alwu 54b8cc7893 Bug 1593843 - part8 : move helper functions out from 'AutoplayPolicy'. r=bryce
Move helper functions out from `AutoplayPolicy`, makes us clearly know which one could really be used to determine the blocking autoplay result. It also give other classes an ability to use those helper functions if they have a need.

Differential Revision: https://phabricator.services.mozilla.com/D52432

--HG--
extra : moz-landing-system : lando
2019-11-25 11:00:13 +00:00
Noemi Erli 23395b20e2 Backed out 13 changesets (bug 1593843) for bustages in Logging.h CLOSED TREE
Backed out changeset b6e3fa6363bd (bug 1593843)
Backed out changeset 3db512256b0d (bug 1593843)
Backed out changeset f67081ea84ee (bug 1593843)
Backed out changeset ad02bb934459 (bug 1593843)
Backed out changeset 1a79176d3f7b (bug 1593843)
Backed out changeset 486c8562b816 (bug 1593843)
Backed out changeset 0d4313c436c5 (bug 1593843)
Backed out changeset 0c7e831d11bf (bug 1593843)
Backed out changeset 02ac8c39f46d (bug 1593843)
Backed out changeset 80895462dddf (bug 1593843)
Backed out changeset 4ab855869725 (bug 1593843)
Backed out changeset 5a24fc933cd6 (bug 1593843)
Backed out changeset f1c50ee60a78 (bug 1593843)
2019-11-23 05:18:17 +02:00
alwu 6d90addd24 Bug 1593843 - part10 : ask for the play permission when creating media element. r=bryce
For media element, as the spec requires that we should know the whether it can be allowed to play when we call `media.play()` [1], which means that we should get the result before the play invocation.

Therefore, we request for the play permission when we create media element.

Differential Revision: https://phabricator.services.mozilla.com/D52438

--HG--
extra : moz-landing-system : lando
2019-11-22 21:27:09 +00:00
alwu f789ab1d90 Bug 1593843 - part8 : move helper functions out from 'AutoplayPolicy'. r=bryce
Move helper functions out from `AutoplayPolicy`, makes us clearly know which one could really be used to determine the blocking autoplay result. It also give other classes an ability to use those helper functions if they have a need.

Differential Revision: https://phabricator.services.mozilla.com/D52432

--HG--
extra : moz-landing-system : lando
2019-11-22 09:17:35 +00:00
Andreas Pehrson df720f22d1 Bug 1592289 - Implement mute/unmute events for media element capture. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D52818

--HG--
extra : moz-landing-system : lando
2019-11-20 15:24:34 +00:00
Andreas Pehrson 67229e8a27 Bug 1592287 - Remove ended captureStream tracks and fire "removetrack" on MediaStream. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D52816

--HG--
extra : moz-landing-system : lando
2019-11-20 15:24:10 +00:00
Andreas Pehrson ef3f8a0e39 Bug 1593739 - Create a dedicated Unlink path for mSrcStream. r=bryce
Unlink of mSrcStream used to rely on EndSrcMediaStreamPlayback to unhook
everything. That method does more than necessary however, and if anything in it
creates a strong reference to the media element, we risk a leak.

This patch takes what's necessary to unhook from EndSrcMediaStreamPlayback and
runs it explicitly from Unlink, to avoid anything unnecessary being run as well.

Differential Revision: https://phabricator.services.mozilla.com/D51906

--HG--
extra : moz-landing-system : lando
2019-11-19 16:29:41 +00:00
Bogdan Tara 26742ff1c1 Backed out changeset 100092ccffcd (bug 1593739) for RefPtr mda perma-failures CLOSED TREE 2019-11-19 00:56:40 +02:00
Andreas Pehrson daeeabf1da Bug 1593739 - Create a dedicated Unlink path for mSrcStream. r=bryce
Unlink of mSrcStream used to rely on EndSrcMediaStreamPlayback to unhook
everything. That method does more than necessary however, and if anything in it
creates a strong reference to the media element, we risk a leak.

This patch takes what's necessary to unhook from EndSrcMediaStreamPlayback and
runs it explicitly from Unlink, to avoid anything unnecessary being run as well.

Differential Revision: https://phabricator.services.mozilla.com/D51906

--HG--
extra : moz-landing-system : lando
2019-11-18 16:44:46 +00:00
Noemi Erli 513f38c497 Backed out changeset 0f20566c7b2f (bug 1593739) for causing assertion in StateWatching.h CLOSED TREE 2019-11-15 14:07:06 +02:00
Andreas Pehrson a91244fa43 Bug 1593739 - Shut down the watch manager during Unlink to prevent future notify tasks. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D51906

--HG--
extra : moz-landing-system : lando
2019-11-15 09:39:15 +00:00
Andreas Pehrson 3f1d369bbf Bug 1302379 - Remove FinishedOnInactive hack from DOMMediaStream. r=jib
It is no longer needed with captured tracks' lifetimes spanning across seek
operations.

Differential Revision: https://phabricator.services.mozilla.com/D52051

--HG--
extra : moz-landing-system : lando
2019-11-13 22:40:16 +00:00
Andreas Pehrson 8d201eb310 Bug 1172394 - Hinge UpdateReadyStateInternal off watchables instead of direct updates. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D52047

--HG--
extra : moz-landing-system : lando
2019-11-13 22:39:55 +00:00
Andreas Pehrson 30c47c82ac Bug 1172394 - Use tail dispatching instead of mSrcStreamTracksAvailable. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D52046

--HG--
extra : moz-landing-system : lando
2019-11-13 22:39:58 +00:00