This overrides the colorspace of hardware decoded videos to specify the monitor's color space, to prevent CoreAnimation from doing conversion.
This probably isn't the right long term answer, but it matches our current rendering and readback code paths.
A note for the future: IOSurfaceSetValue/IOSurfaceCopyValue silently fail if the IOSurface is 'in use'.
Differential Revision: https://phabricator.services.mozilla.com/D85355
This patch uses IPDL's return feature to ensure that the memory
reporter manager won't wait for a report from a child process
that has already exited.
This fixes a memory reporter hang that can happen if a child process
exits during a memory report, when the parent half of the actor is
being held alive. (If the parent half of the actor is not being held
alive, then mMemoryReportRequest will be naturally cleared when it
goes away.)
This was happening frequently on Windows Fission AWSY because that test
does a minimize memory right before it attempts to get a memory report,
and the preallocated content process exits when it sees a message to
minimize memory.
Differential Revision: https://phabricator.services.mozilla.com/D85499
The next patch converts the memory reporting architecture to use the "returns"
feature of IPDL, and mozilla::ipc::RejectCallback does not have a return
type, so this patch removes the return value.
FinishReportingCallback::Callback() needs to remain an XPCOM method
that returns NS_OK because it is called from JS during testing.
Differential Revision: https://phabricator.services.mozilla.com/D85498
C++17 guarantees that "In a function-call expression, the expression that names the function is sequenced before every argument expression and every default argument."
The order of operations in the expression s now guaranteed, we can remove the comment and the workaround.
Differential Revision: https://phabricator.services.mozilla.com/D85676
We can't create a media decoder on a decoder taskqueue, as this could lead to deadlocks should a decoder attempt to dispatch a synchronous runnable.
Differential Revision: https://phabricator.services.mozilla.com/D85544
Historically, the MediaThreadType::PLAYBACK was used just for that; the MediaDecoderReader and exclusively for playback content.
This is no longer the case ; it's used in multiple places, and not just with playback: webrtc, webaudio, benchmark etc.
The primary use of the "PLAYBACK" thread was to distinguish from the "PLATFORM_DECODER" one as they dispatch synchronous tasks from one to the other, and we must ensure they don't share the same threadpool.
CONTROLLER is more fitting here, as this is how it's typically used: a controller thread manage the decoder threads.
Additionally, we remove the MTG_CONTROL one as it's not used.
Differential Revision: https://phabricator.services.mozilla.com/D85543
When DMABufSurfaceWrapper is added to nsTArray, a temporary local DMABufSurfaceWrapper object is created. When the temporary
object is deleted after the adding, associated dmabuf data is released which leads to rendering artifact during VA-API video playback.
As a fix in this patch we create DMABufSurfaceWrapper 'in-place' at nsTAttay.
We also disable DMABufSurfaceWrapper class copy and assignment constructors to avoid similar potential issues.
Differential Revision: https://phabricator.services.mozilla.com/D85152
Add an event handler `onactivated/ondeactivated` and a readonly attribute `isActive` on the media control webidl interface, and they can be used in testing and the future plan of supporting media hub.
Differential Revision: https://phabricator.services.mozilla.com/D85229
Changed error message to unlocalized in the callback and in the promise rejection in case an error occurs in audio decoding.
Also deleted localized strings and NoAudio bacause it is not used.
Differential Revision: https://phabricator.services.mozilla.com/D81337
The condition in the if is changed because the minus operation could overflow.
The declaration of sampleRate has been moved to its next use because its first value was never used.
Differential Revision: https://phabricator.services.mozilla.com/D81550
The URL specifying the track image should be loaded without any
user-specific data like cookie headers, or HTTP Auth credentials.
Differential Revision: https://phabricator.services.mozilla.com/D83695
The duplicated util helpers between WindowsSMTCProvider and
MPRISServiceHandler could be merged and moved to MediaControlUtils
Differential Revision: https://phabricator.services.mozilla.com/D82806
CLOSED TREE
We don't need these macros anymore, for two reasons:
1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
and friends.
2. clang now warns for the "temporary that should have been a declaration" case.
The extra requirements on class construction also show up during debug tests
as performance problems.
This change was automated by using the following sed script:
```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d
# Remove individual macros, carefully.
{
# We don't have to worry about substrings here because the closing
# parenthesis "anchors" the match.
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;
# Remove the longer identifier first.
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}
# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```
and running:
```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```
Differential Revision: https://phabricator.services.mozilla.com/D85168
We don't need these macros anymore, for two reasons:
1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
and friends.
2. clang now warns for the "temporary that should have been a declaration" case.
The extra requirements on class construction also show up during debug tests
as performance problems.
This change was automated by using the following sed script:
```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d
# Remove individual macros, carefully.
{
# We don't have to worry about substrings here because the closing
# parenthesis "anchors" the match.
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;
# Remove the longer identifier first.
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}
# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```
and running:
```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```
Differential Revision: https://phabricator.services.mozilla.com/D85168
We want to modify our current behavior from "resuming all media" to "resuming latest paused media" when pressing `play` media key.
The reason of doing that is because that give us better user experience, espeically on Facebook. Chrome has been taking this approach, so we want to follow this strategy. The test in D84879 can help to understand this scenario.
Differential Revision: https://phabricator.services.mozilla.com/D85118
Currently, we treat `pause` and `stop` equally, but `stop` is actully implying more meaning, which should stop controlling media entirely. Therefore, we would pause media and stop controlling it when receiving `stop`.
In addition, removing pause state checking, because it wouldn't happen anything to call `play()` and `pause()` if media is already playing or paused.
Differential Revision: https://phabricator.services.mozilla.com/D84875
This usually fails due to sandbox policy.
When the sandbox is disabled, the realtime promotion can result in SIGKILL
if/when script runs too long. This can be re-introduced when thread demotion
is moved to a thread that is not blocked on script, which may be part of
the solution to https://bugzilla.mozilla.org/show_bug.cgi?id=1628198.
Depends on D84941
Differential Revision: https://phabricator.services.mozilla.com/D84942
so that this happens even when the content sandbox is not enabled.
CubebUtils::InitLibrary() is called during ContentProcess::Init(), before the
event loop is run in XRE_InitChildProcess().
Differential Revision: https://phabricator.services.mozilla.com/D84941
This removes the need to do some conversions and simplifies the code a little.
Drive by remove an assert which is already covered by a switch statement
containing a MOZ_ASSERT_UNREACHABLE in ChromiumCDMParent.
Differential Revision: https://phabricator.services.mozilla.com/D84432