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

18549 Коммитов

Автор SHA1 Сообщение Дата
John Lin 0c108876a0 Bug 1662507 - don't use mEncoder outside webrtc.org thread. r=jya
Dispatching the `MediaDataEncoder::Encode()` invocation is not really
necessary because the callback is desinated to run in task queue anyway.
Also make `Shutdown()` wait for completion to make sure resource is
released before next allocation.

Differential Revision: https://phabricator.services.mozilla.com/D97027
2021-01-07 14:26:10 +00:00
Michael Froman 56e67b321d Bug 1681025 - don't call GetDtlsTransport on transceiver if RTCRtpReceiver has been shutdown. r=ng
Differential Revision: https://phabricator.services.mozilla.com/D100952
2021-01-07 15:57:41 +00:00
Andreas Pehrson 8da798d630 Bug 1673526 - Simplify send track recreation condition. r=bwc
Differential Revision: https://phabricator.services.mozilla.com/D98354
2021-01-07 10:56:38 +00:00
Andreas Pehrson 7a80c84f43 Bug 1663736 - Also check mSinks for explicitly removed sinks. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D99463
2021-01-07 10:15:10 +00:00
Kartik Gautam 7ae6aea145 Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D100484
2021-01-07 08:53:08 +00:00
Sylvestre Ledru b58ddc19df Bug 1519636 - Reformat recent changes to the Google coding style r=andi
Updated with Debian clang-format version 11.0.1-1

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D100934
2021-01-06 17:17:23 +00:00
Daniel Holbert 31c970eb51 Bug 1685364: Add ifdef guard around some AV1-specific code, to fix --disable-av1 build bustage. r=alwu
Differential Revision: https://phabricator.services.mozilla.com/D100949
2021-01-06 20:41:44 +00:00
Paul Adenot 924465d3c7 Bug 1681772 - Put an hard-coded but non-empty label for audio devices on Android. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D100929
2021-01-06 18:17:02 +00:00
Jean-Yves Avenard 5c7a830260 Bug 1681043 - P6. Remove no longer necessary workaround. r=alwu,bryce
The WMFDecoderModule now uses a crash guard around the loading of the VP9/VP8 MFT. We don't want to always assume that we have a VPx decoder in the GPU process in particular, as it will only be true if a HW decoder is available.

Differential Revision: https://phabricator.services.mozilla.com/D100309
2021-01-06 08:33:35 +00:00
Jean-Yves Avenard 6f1544075f Bug 1681043 - P5. Recalculate decoder capabilities if CanUseHardwareVideoDecoding changes. r=alwu,bryce
Not the most elegant, but reworking the PDMFactory to be fully re-initialized would be a significant change, as only the WMFDecoderModule requires it we take some shortcuts.

Differential Revision: https://phabricator.services.mozilla.com/D100308
2021-01-06 08:33:28 +00:00
Jean-Yves Avenard 3631cb632e Bug 1681043 - P4. Stop checking on gfxVars::CanUseHardwareVideoDecoding on mac. r=alwu
gfxVars::CanUseHardwareVideoDecoding is often set after the first use of the PDMFactory; in this case this would disable HW VP9 decoding for the entire session of the browser.

This value will always end up being true on macOS, so ignore its value in the static Init method.

Differential Revision: https://phabricator.services.mozilla.com/D100307
2021-01-06 08:33:20 +00:00
Jean-Yves Avenard dfb40277e0 Bug 1681043 - P3. Retrieve decoding capabilities in GPU or RDD process and pass it to content. r=alwu,bryce
Upon starting the RDD and GPU process; we check their decoding capabilities and send it to the parent process. It will then broadcast this information to all content children so that RemodeDecoderModule::Supports can return if a codec is supported or not.

Differential Revision: https://phabricator.services.mozilla.com/D100306
2021-01-06 09:05:31 +00:00
Jean-Yves Avenard 50a06cc6c5 Bug 1681043 - P2. Don't reject outright support for a GPU decoder if compositor isn't known. r=alwu,bryce
When calling PDM::SupportsMimeType not enough information is provided for the PDM to categorically state that a codec isn't supported.

Only  creating the decoder successfully matters and the PDMFactory only uses the value returned by Support as a hint to further query the PDM.

Without this change WMFDecoderModule::SupportsMimeType in the GPU process would always return false as it doesn't know yet the KnownCompositor.

Differential Revision: https://phabricator.services.mozilla.com/D100305
2021-01-06 08:32:59 +00:00
Jean-Yves Avenard db79f94d4f Bug 1681043 - P1. Create method to launch RDD process early. r=alwu
We can launch the RDD process early now that it is a fully asynchronous process and doesn't block anything.

This will allow to retrieve the decoding capabilities of the RDD process right away.

Calling this method will actually be handled in bug 1684991 once blockers are sorted (tests and sandbox)

Differential Revision: https://phabricator.services.mozilla.com/D100304
2021-01-06 08:53:38 +00:00
Byron Campen [:bwc] 0c10fa6898 Bug 1680771: Use a real LoadInfo for WebrtcTCPSocket, ensure we use that LoadInfo's CookieJarSettings for our DNS/proxy lookup, and remove a flag that was breaking http proxy support for webrtc. r=timhuang,mjf
Differential Revision: https://phabricator.services.mozilla.com/D99362
2021-01-05 12:59:41 +00:00
Andreas Pehrson 1df5aff0c0 Bug 1601799 - Use a SharedDummyTrack for graph access in DecodedStream. r=karlt
When enabling our MediaTrack implementation (which we don't plan to by default,
NB) and disabling all audio tracks and unselecting all video tracks while having
an active captureStream leads to having no output tracks in DecodedStream.

In this case, DecodedStream doesn't know which graph to use for creating the
intermediary tracks it feeds data to. We don't want to resort to the default
graph either, since two graphs on different clocks could then race each other.

With this patch we plumb down a SharedDummyTrack from the media element where
the captureStream was triggered, through MediaDecoder, to DecodedStream. The
SharedDummyTrack guarantees to keep the graph alive, and holds the graph used
for the output tracks.

Differential Revision: https://phabricator.services.mozilla.com/D99822
2021-01-05 07:43:34 +00:00
Andreas Pehrson a37786a190 Bug 1601799 - Allow running DecodedStream without output tracks. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D99821
2021-01-04 14:35:09 +00:00
Andreas Pehrson 8689b6a97e Bug 1601799 - Add mochitest for disabled MediaTracks with mozCaptureStream. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D99820
2021-01-04 14:35:10 +00:00
Oleg Skoromnik 7f10fee971 Bug 1684655 - Remove unused parameters left after Bug 1443511. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D100625
2021-01-04 12:25:16 +00:00
Mihai Alexandru Michis f8a41209af Backed out 6 changesets (bug 1681043) for causing multiple failures.
CLOSED TREE

Backed out changeset ea075101dc94 (bug 1681043)
Backed out changeset 64d8abe2104d (bug 1681043)
Backed out changeset 5ecb208a85d3 (bug 1681043)
Backed out changeset 9319fdd0389c (bug 1681043)
Backed out changeset 25a015e84cc4 (bug 1681043)
Backed out changeset e8fac91d4012 (bug 1681043)
2021-01-04 07:43:08 +02:00
Jean-Yves Avenard ea48adf8c2 Bug 1681043 - P6. Remove no longer necessary workaround. r=alwu,bryce
The WMFDecoderModule now uses a crash guard around the loading of the VP9/VP8 MFT. We don't want to always assume that we have a VPx decoder in the GPU process in particular, as it will only be true if a HW decoder is available.

Differential Revision: https://phabricator.services.mozilla.com/D100309
2021-01-03 23:24:35 +00:00
Jean-Yves Avenard 19f9c7de4d Bug 1681043 - P5. Recalculate decoder capabilities if CanUseHardwareVideoDecoding changes. r=alwu,bryce
Not the most elegant, but reworking the PDMFactory to be fully re-initialized would be a significant change, as only the WMFDecoderModule requires it we take some shortcuts.

Differential Revision: https://phabricator.services.mozilla.com/D100308
2021-01-03 23:24:07 +00:00
Jean-Yves Avenard ec7856abd7 Bug 1681043 - P4. Stop checking on gfxVars::CanUseHardwareVideoDecoding on mac. r=alwu
gfxVars::CanUseHardwareVideoDecoding is often set after the first use of the PDMFactory; in this case this would disable HW VP9 decoding for the entire session of the browser.

This value will always end up being true on macOS, so ignore its value in the static Init method.

Differential Revision: https://phabricator.services.mozilla.com/D100307
2021-01-03 23:23:34 +00:00
Jean-Yves Avenard ff614fdaa3 Bug 1681043 - P3. Retrieve decoding capabilities in GPU or RDD process and pass it to content. r=alwu,bryce
Upon starting the RDD and GPU process; we check their decoding capabilities and send it to the parent process. It will then broadcast this information to all content children so that RemodeDecoderModule::Supports can return if a codec is supported or not.

Differential Revision: https://phabricator.services.mozilla.com/D100306
2021-01-03 23:21:54 +00:00
Jean-Yves Avenard 1781f8be7f Bug 1681043 - P2. Don't reject outright support for a GPU decoder if compositor isn't known. r=alwu,bryce
When calling PDM::SupportsMimeType not enough information is provided for the PDM to categorically state that a codec isn't supported.

Only  creating the decoder successfully matters and the PDMFactory only uses the value returned by Support as a hint to further query the PDM.

Without this change WMFDecoderModule::SupportsMimeType in the GPU process would always return false as it doesn't know yet the KnownCompositor.

Differential Revision: https://phabricator.services.mozilla.com/D100305
2021-01-03 23:20:25 +00:00
Jean-Yves Avenard a68d444ad0 Bug 1681043 - P1. Launch RDD process early. r=alwu
We can launch the RDD process early now that it is a fully asynchronous process and doesn't block anything.

This will allow to retrieve the decoding capabilities of the RDD process right away.

Ideally, we should have been able to start the RDD process at the same time as the GPU process; however setting up the RDD sandbox is dependent of having mozilla::SandboxBroker::GeckoDependentInitialize() called first ; and it is called in the most awkward of places; so finding a place suitable for all platforms gets affected.
For now we will ensure it's been started around the time the first content process is started.

Differential Revision: https://phabricator.services.mozilla.com/D100304
2021-01-03 23:20:38 +00:00
Cosmin Sabou 2978aa00a3 Backed out changeset dbed1cdf588f (bug 1684173) for mochitest plain and devtools failures. a=backout DONTBUILD 2020-12-28 00:43:51 +02:00
Kartik Gautam 775cdec032 Bug 1684173 - Add newline character at end of files when missing r=sylvestre
Depends on D100443

Differential Revision: https://phabricator.services.mozilla.com/D100484
2020-12-27 11:43:41 +00:00
Nico Grunbaum 198e61d242 Bug 1679084 - fix default H264 channels in RTPMAP;r=drno
Differential Revision: https://phabricator.services.mozilla.com/D97898
2020-12-08 07:16:22 +00:00
Sylvestre Ledru 4c0c328c0a Bug 1683840 - Fix some array-parameter errors found by gcc 11 r=necko-reviewers,dragana
I am aware they are third party code. pushing to keep a trace

Differential Revision: https://phabricator.services.mozilla.com/D100323
2020-12-24 12:41:28 +00:00
alwu df9c134aa6 Bug 1683788 - add telemetry probe for the audio competition. r=bryce
If multiple audible tabs play at the same time, we call it as `Audio Competition`.

When the audio competition happens, there are several possibilities

(1) ignore that and keep multiple tabs playing at the same time
(2) user manually handles that by pausing or muting audible playing tabs, remaining only an audible playing tab
(3) user enables audio focus management, so gecko would pause them and only allow one audible tab playing at a time

By collecting these situations, we can know the details of how user would react for the audio compeition.

In addition, we also collect the situation where no audio competition happens, in order to know whether the audio competition is common to users.

Differential Revision: https://phabricator.services.mozilla.com/D100292
2020-12-24 02:42:56 +00:00
Jean-Yves Avenard cdb7b9878d Bug 1674315 - Fix logic error to determine if playback succeeded. r=alwu,bryce
Differential Revision: https://phabricator.services.mozilla.com/D100315
2020-12-23 18:15:50 +00:00
Karl Tomlinson 6c9560fd42 Bug 1679735 require recent user gesture for getDisplayMedia() r=jib
Previous behavior was to allow requests if the user has ever interacted with
the window.  This patch changes from sticky activation to transient
activation.

WindowContext is used rather than Document for the
HasValidTransientUserGestureActivation() test because user activation is a
property of the Window/global.

The error reported when WindowContext is null is the same as that for missing
transient activation, which is keeping the existing behavior.
https://searchfox.org/mozilla-central/rev/66547980e8e8ca583473c74f207cae5bac1ed541/dom/base/Document.cpp#15806
i.e. a missing WindowContext is still treated as missing transient activation.

Differential Revision: https://phabricator.services.mozilla.com/D98275
2020-12-09 22:19:01 +00:00
Bryce Seager van Dyk f7949b6a83 Bug 1683789 - Fix typo in WmfDecoderModuleMarkerAndLog function. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D100342
2020-12-23 14:38:51 +00:00
alwu e77464e77c Bug 1613672 - return `NS_ERROR_DOM_MEDIA_CANCELED` to indicate that track buffer manager has been detached from the demuxer. r=jya
When we shutdown `MediaSourceDecoder`, it would trigger a shutdown for `MDSM` and a detaching for media source.

In the previous one, that would eventually shutdown `MediaFormatReader` via tasks going through different threads (main->MDSM->MFR's supervisor).

In the latter one, it would eventually detach the `TrackBufferManager` from the `MediaSourceTrackDemuxer`. (main->Demuxer's supervisor)

As these two tasks running in different threads, and the latter usually get finished before the former one, which would result in `MediaSourceTrackDemuxer` no longer being able to get a sample.

When that happens, the reader hasn't been shutdown yet, so it's still holding track demuxers and keeps requesting data from them. Then demuxers would return error because their corresponding track managers have been detached.

The reader would report the demuxing error to the console, but that's acutally not a fatal error, because in this situation the reader is going to be shutdown soon. Therefore, return `NS_ERROR_DOM_MEDIA_CANCELED` to allow MFR to treat this error differently.

Differential Revision: https://phabricator.services.mozilla.com/D100153
2020-12-22 06:06:04 +00:00
alwu 7b9e967b43 Bug 1683016 - listen to display playback change before calling video's `play()` r=bryce
Call `waitUntilDisplayedPlaybackChanged()` first to ensure that we won't miss the event. In addition, add more logs in order to help diagnosing issue if timeout happens again.

Differential Revision: https://phabricator.services.mozilla.com/D100277
2020-12-22 16:44:56 +00:00
Alastor Wu 5a96f35156 Bug 1671626 - part2 : set metadata on nowPlayingInfo. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D100077
2020-12-21 18:09:16 +00:00
Alastor Wu 0bcbe2eae9 Bug 1671626 - part1 : remove `MediaPlayerWrapper`. r=spohl
As now the lowest version SDK we use for developing would be 10.12, so we don't need to this wrapper anymore and can import `MediaPlayer` directly.

Differential Revision: https://phabricator.services.mozilla.com/D97223
2020-12-21 18:10:30 +00:00
Alexis Beingessner d0ab79ff63 Bug 1682938 - fixup ReverbInputBuffer's writeIndex. r=karlt
Differential Revision: https://phabricator.services.mozilla.com/D100024
2020-12-21 17:10:29 +00:00
Bryce Seager van Dyk 0f3a7c7723 Bug 1680310 - Gracefully handle functions running after we Shutdown in RemoteDecoderManagerChild. r=jya
RemoteDecoderManagerChild has a number of functions that may be called
asynchronously. Many such functions assert that they can get the manager thread
and that they are on that thread. However, if we've already shutdown, the thread
they fetch will be null. Since we can enter shutdown while async executions of
these functions are pending, we may fail our asserts.

To avoid this, we instead check if the manager thread is null in these
functions, if so, we assume we're in shutdown and bail. If the thread is not
null, we continue as before and assert we are running on the thread as expected.

Differential Revision: https://phabricator.services.mozilla.com/D99824
2020-12-21 15:03:01 +00:00
Byron Campen [:bwc] a4b9ffa581 Bug 1681943: Remember how extmap was negotiated for later use in reoffers. r=mjf
Differential Revision: https://phabricator.services.mozilla.com/D100049
2020-12-18 17:59:07 +00:00
Simon Giesecke 9758d919eb Bug 1583109 - Use StringJoin(Append) where easily possible. r=nika
Bug 1583109 introduced new function templates StringJoin and StringJoinAppend.
These are now used to replace several custom loops across the codebase that
implement string-joining algorithms to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D98750
2020-12-17 14:58:18 +00:00
Masatoshi Kimura 3424a95ee0 Bug 1682103 - Make nsContentPolicyType a CEnum type. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D99580
2020-12-16 11:36:47 +00:00
Csoregi Natalia d8c9489b13 Backed out changeset 16d174e7c342 (bug 1583109) for bustage on nsReadableUtils.h. CLOSED TREE 2020-12-16 22:51:26 +02:00
Simon Giesecke 72babae175 Bug 1583109 - Use StringJoin(Append) where easily possible. r=nika
Bug 1583109 introduced new function templates StringJoin and StringJoinAppend.
These are now used to replace several custom loops across the codebase that
implement string-joining algorithms to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D98750
2020-12-16 19:38:23 +00:00
Simon Giesecke 29c054ab83 Bug 1679987 - Removed unused includes of nsCharSeparatedTokenizer.h. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D99877
2020-12-16 19:09:58 +00:00
Bryce Seager van Dyk 5c6194a73d Bug 1671246 - Use a union to pass NodeId in GMP. r=jbauman,ipc-reviewers,nika
Passing a union here allows us to reuse code and trim some code which was
duplicated to handle the different NodeId formats. This also consolidates the
former `NodeId` and `NodeIdData` structures into a new structure (working name
`NodeIdParts`) which represents parts that will later be converted to a string
based NodeId.

Differential Revision: https://phabricator.services.mozilla.com/D93569
2020-12-16 16:15:01 +00:00
Chun-Min Chang b7811b117b Bug 1654462 - Add alpha support in nsAVIFDecoder r=jbauman
This patch implements the transparency support for AVIF image files.

To convert the decoded YCbCr and Alpha data to RGBA, a function named
`ConvertYCbCrAToARGB` is created to do this job in the following
procedure:

ConvertYCbCrAToARGB:
  If the layout of the YCbCr is I420
    Calling libyuv::I420AlphaToARGB
  Else
    Fill RGB data converted by ConvertYCbCrToRGB in ARGB buffer first
    Insert the alpha data to ARGB buffer

On the other hand, this patch refactors the nsAVIFDecoder a bit to make
the lifetime of the parsed data and decoded image data clearer. They
won't live longer than Parser object and {Dav1d, AOM}Decoder object.
This should improve the code readability.

This patch also adds a transparent image test (TransparentAVIFTestCase)
to check the FLAG_HAS_TRANSPARENCY is posted or not. The test image file
`transparent.avif` is from Bug 1654462.

Differential Revision: https://phabricator.services.mozilla.com/D98951
2020-12-16 01:27:14 +00:00
Kartik Gautam f7ffcd09fb Bug 1679758 - Remove trailing empty lines r=sylvestre,marionette-reviewers,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D99595
2020-12-15 10:34:54 +00:00
alwu 202cc5ddae Bug 1682118 - do not check audible state at 'onactivated'. r=chunmin
In D98829, we change the condition of activating a controller, so we have to modify this test as well because now the controller doesn't guarantee it's already audible when gets activated.

Differential Revision: https://phabricator.services.mozilla.com/D99722
2020-12-15 00:52:29 +00:00