866385 Commits

Author SHA1 Message Date
Randell Jesup
55cad8d48f Bug 1847298: IPC constructor cleanup r=nika,padenot,dom-storage-reviewers,necko-reviewers,cookie-reviewers,asuth,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D185472
2023-12-08 15:56:39 +00:00
Jonathan Sudiaman
25237524ed Bug 1851447 - Add search for recent browsing r=fxview-reviewers,fluent-reviewers,flod,sclements,kcochrane
Slightly different from the previous search revisions. In this case, rather than having their own search boxes, the recent browsing components share a single search box located within the parent element. Thus, `fxview-search-textbox-query` event listeners are added/removed from the //parent// component rather than the components themselves.

Differential Revision: https://phabricator.services.mozilla.com/D195596
2023-12-08 15:56:08 +00:00
Randell Jesup
a4d904b15e Bug 1866954: avoid copying a Refptr in ForEachGlobalTeardownObserver r=saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D194844
2023-12-08 15:29:42 +00:00
Tim Huang
4624c5077d Bug 1865790 - Part 2: Add a test to ensure that suspicious fingerprinter data is aggregated into the fingerprinter category on about:protection. r=anti-tracking-reviewers,pbz
Differential Revision: https://phabricator.services.mozilla.com/D194864
2023-12-08 15:24:21 +00:00
Tim Huang
57fb93348d Bug 1865790 - Part 1: Aggregate suspicious fingerprinter number to fingerprinter category on the protection dashboard. r=anti-tracking-reviewers,pbz
This patch makes the protection dashboard recognize the suspicious
fingerprinter ID in the ContentBlockingLog and aggregate the number to
the fingerprinter category.

Differential Revision: https://phabricator.services.mozilla.com/D194863
2023-12-08 15:24:21 +00:00
Tim Huang
91771148f1 Bug 1859247 - Part 2: Add tests. r=anti-tracking-reviewers,pbz
Differential Revision: https://phabricator.services.mozilla.com/D194135
2023-12-08 15:24:20 +00:00
Tim Huang
2b1d8980eb Bug 1859247 - Part 1: Introducing SUSPICIOUS_FINGERPRINTERS_ID to nsITrackingDBService. r=anti-tracking-reviewers,pbz
This patch introduces a new category SUSPICIOUS_FINGERPRINTERS_ID to the
nsITrackingDBService. We record this category when we detect suspicious
fingerprinting behaviors.

Differential Revision: https://phabricator.services.mozilla.com/D194134
2023-12-08 15:24:20 +00:00
Jihye Hong
467850b5a0 Bug 1785541 - Remove unnecessary meta annotations on linux for /css/css-contain/content-visibility/content-visibility-030.html r=emilio
There is a meta annotation for content-visibility-030.html on linux, but the test works completely now.
This patch removes the unnecessary meta annotations

Differential Revision: https://phabricator.services.mozilla.com/D193758
2023-12-08 15:17:46 +00:00
Cathie Chen
6e8972fb17 Bug 1866566 - When CSS animaiton is not associated with an owning element, content-visibility does not hide it, r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D195560
2023-12-08 15:10:30 +00:00
Ryan VanderMeulen
f747c52e5a Bug 1868908 - Upgrade to SQLite 3.44.2. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D195835
2023-12-08 13:05:02 +00:00
Kershaw Chang
7d4f130840 Bug 1866739 - Make HTTP upload throughput keyed by request size, r=acreskey
Differential Revision: https://phabricator.services.mozilla.com/D194729
2023-12-08 12:35:40 +00:00
Nicolas B. Pierron
0c6f31929b Bug 1868798 - Explicitly convert characters to avoid sign-extension. r=arai
Differential Revision: https://phabricator.services.mozilla.com/D195810
2023-12-08 12:33:00 +00:00
Ben Hearsum
2f526e5cdc Bug 1868944 - pin android emulator version in toolchain tasks r=gbrown! CLOSED TREE
This is not really the best fix - ultimately the pinned version should go in a task definition somewhere, I think, and we should even consider pinning in https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/android.py and pinning for even non-Taskcluster users (as we do for the NDK, cmdline tools, etc.)

But this is the safest, quickest fix for the immediate term.

Differential Revision: https://phabricator.services.mozilla.com/D195914
2023-12-08 19:29:16 +00:00
Mozilla Releng Treescript
7a4dbf4053 no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
ach -> d63e5a8e3eb18633c9f35464ade08a8c2625094a
af -> ada477babaf0ce75ae73f1ebb4afb48e6e63d502
an -> 234fd31465034c32fa203926fc0757f8140e2da5
ar -> d8b655774337764a32074c0a4a7f5a458f4848f6
ast -> a98f1ffa9dec081f53d0dd870ceb73274cb56c10
az -> 13d5144a7c913281d19b153fe01d6ce2f9dee820
be -> 965befb339d58c3110ee41804a94e0b91c7bf79b
bg -> 08864b20c26bfe420b0eeaae882fce544c950344
bn -> 4cabfe884c8176747e62edc864808e2e3f47e05b
br -> d1c60f4e21986774e5467bf293b265d2a8eb17d2
brx -> 7e47d3693f47d33afbe54933d8a9b0e607fd1cf8
bs -> 086aed6675473b4d550a7bb4f1886241b5de8b75
ca -> 3d713768e7b8670ca1072e2d9368fd80c5eb13cb
ca-valencia -> 5a6c7a9a4ea6e2018aa92bde991ee62c0b3d378a
cak -> 025b47f13f5d3850a3e874681b5713b2acc63a82
ckb -> b8219c0dcebe6d15905f8e46d5aa560aaafe3795
cs -> e7bac56ed20ce7e4f4b210529a8d9d655d9aca1f
cy -> 2f4f6eb7205adb9737dd576c7a492369fa79d05c
da -> b8b2297990ab6e5bc6196420c70ec0e85ad10610
de -> 2f52a7bf3b3115505615386581093bfd47336b3d
dsb -> 210b4e51437627a5262f46f98bb14987da84e973
el -> ac973d42f99c5411ad86623de0bb663d7c3fcb0c
en-CA -> dfe226d20b54a856ca1642926fe5024e37f0eaea
en-GB -> f6fa901b3cb5cfcfbdb1e59648a340f80b362dd7
eo -> 447405c93507febd501292de20558c0bf3fdd409
es-AR -> 0d896ccd97d06f77706480fa66c98034417ca9ec
es-CL -> cf130ff4215a937e27aefd2387b6d9f3f729bc1f
es-ES -> 104d1a57d90e2e928416eea8acf279b227e89cc7
es-MX -> a027bec3005d664683e1bc026a76e35e3a2df3a9
et -> 2880b7218e9b9e66a79cf6d1433ce169dc816f0b
eu -> 36148d289fd2e0ed171309cede316027ed22f9b2
fa -> e42a69f6dd04276bf9535a652262ee9a61245a10
ff -> 8a827dbc73aa25005ab7902c12623aabdc4a5962
fi -> 299a2a2e67bab7aa4a521357b8957d68f4ccb0fd
fr -> 313e3605f29390912ec70cb7346425f05870a765
fur -> c617117748adeaf3181b496f2169048c2f7a3c59
fy-NL -> ae696e9d7c76ab9f93d240cb7c5e51699abc40f8
ga-IE -> 7e37b4a64bd81aa8a1680a94d0a5b74be83ee601
gd -> 4dff5073376f0a3de5918814274e5ba7e9eb054b
gl -> f01dd71e20851483cc37528cd0087d47724129f8
gn -> 846f2942f05e5abf279ab9b13d7612e3e5ee94ad
gu-IN -> c1960d0cafab70e0233b7bf751c94db96128a7fc
he -> 9f7c2adf4475479592335f5198250f1d6b2fb615
hi-IN -> 45f2c91293ec1ba92bebee48ad23d236400c0dfd
hr -> 38fafffcaeb47db285ae2995da5e1138ecb61afb
hsb -> b169b60d1479c56b8fdd8ac13ac66e8a159fb9af
hu -> 33b5ab318b8c7e808294d1e7e906a82b242240b8
hy-AM -> 15d8fc8f02327d573475358daef8204c060d6ede
hye -> 1117a0a1ddd4f951e60da16c8ef4feba934291d8
ia -> bd3334f8df69cc1642299f20538c77b8d7fad562
id -> 29892c0c73ea842570b97a04ad060ab07cc63a56
is -> 77adf2f05e2fab167ce30bfec0dfa2bf036d5f4a
it -> f60793d071fd88a1639c81f48e0decfa75b0aa7b
ja -> 226f10f612a6eb9d3c1b2b5a5cec385125f4c780
ja-JP-mac -> 7aa01495dcda5cabe9560f23ea4a6d2399e20757
ka -> 3c070973ff36ee5a5f9c0981318ee11f06eb1eba
kab -> b7bef9de9b4fa7e9591b909c1276d85e24efc0b5
kk -> bc4d859fbdf1fa1962933bb90a1585b7199667d0
km -> 06c4009c073fb9ada89e2b5680c5d2b60a099d1d
kn -> a4133437b36e7275f39547e578251d186fbfa530
ko -> c6d5b8cbd5350781d164b2368191dcdccf867861
lij -> 165e72fd9c87245953b545aca330fe225228a626
lo -> a36c35c01752151b91dee93b26cd229db1deddae
lt -> 5e45dd9f8099f5d8b904424718958becdd0460b8
ltg -> e3610e14c02e543a90cda78daebf33a89c63db51
lv -> f14e8a761d7a255551c820a92bade1adbfe7b7ce
mk -> d8a9385015dbacde58b874432abd7a8d39b3b037
mr -> 24ecb20417ecd8e73102ae76a44974df4c09eb47
ms -> f783e29cd2221c9ecfa38476f8e5933a56530a78
my -> 13d6e11d61faaef74261b602223cc9b082dca77d
nb-NO -> 45dc3442aa371f826b5985ee5954e515ddf0832b
ne-NP -> d16f2c5e24733289463582f8cad5829baa8ca8b4
nl -> 829f80c8792784d74974999acc7eeac6f57cadc8
nn-NO -> c32ab48948f64e3efa7cb32615665e53a7b3de09
oc -> 2ad590c143c7e6263ca6d28f6833a438064925ac
pa-IN -> 47c8eaa7325e6b7a196312af7b34fddfd2460771
pl -> 6544cb40e08ad6cd0b6e2508a318b6cad29d50f6
pt-BR -> e418e200aceaaf77a0d89b2530376e5261e626f5
pt-PT -> d954f5963d344eb6dfc58dba4171465f11fd0828
rm -> 8b87ecc589e0815067de142cc9be238a095ce2d3
ro -> 21e14990e3fd2f023cca557b92e9171e42217ba9
ru -> 744a9c2994371a4a299684f5273392b0df90001c
sat -> 30267fb39011d81dc4841599867f6f3ef9d3105e
sc -> 8c0503593c54b994b404aa93d8ad43a516f538dc
sco -> 83ec2b0acc980788b8ad6e2e35671fa723397e81
si -> 9e54e86567f2505a0d45de14be635d6069e6e51b
sk -> 9fc804ef115cde32f675028e98d63d7f72aca2d2
skr -> d8b58da6687347c1c9823397c83bb589033be67f
sl -> 2d65b3e42e68109cc9fc92d5056555ef37d62173
son -> 1e5161324126f417348ed3310ffb253ad00ad151
sq -> d2c98b4dc06d9ae76ae10e6d1c49eee04ff1cbd2
sr -> d75c50f9bd93d6653a491f5034b83d97686f9ce6
sv-SE -> 52a90f59e55e6477607dfc005fe0c5eeb816d447
szl -> c7d3ddb5ae3522175ce046dcc91d6ab1a1cd8d6a
ta -> dd287a2d0a7a5960d7dfb1e484b9b3a8e2d30051
te -> 51bc29bfe02f5be35a25a68fcbc4c362d76c7268
tg -> 7c7beccfa47ad2f5da8537086c88cdb464106062
th -> 2660d22a58d20e9342439e9254314c1399ae790e
tl -> 070b7529c67ee14ce41bb5e7f6815091bb8fd8ce
tr -> 68ff953bb7d70d40e38aa89e2ced0961111e3f28
trs -> 924a8d2b79f2a65f9a06fb7d5bad219f689653c7
uk -> cf4fa1336ac755a5d6823086e88be99c852668d2
ur -> d95cd0e0f4b1d9f2a5cca980311bc6fd265e4222
uz -> 7fddc5882f90b8be3aae5b2546ee9089235f95ca
vi -> 80fe32756ee2469300dcc7ccacbfdd2b7cff07a2
xh -> 8f324ae4ce46fa9616c735126c81688ae72f57c5
zh-CN -> 8ce8dcc54ecb76e9a420c60df135711e5b424cac
zh-TW -> f6ee49dadc5a6f354631d7eb7fdc44be544094c9
2023-12-08 19:03:54 +00:00
Emilio Cobos Álvarez
7e4a4b1c6b Bug 1868552 - More precisely maintain XUL behavior on macOS.
MANUAL PUSH: Somewhat-straightforward orange fix in CLOSED TREE
2023-12-08 19:30:47 +01:00
Stanca Serban
ac6b124e79 Merge mozilla-central to autoland on a CLOSED TREE 2023-12-08 17:38:27 +02:00
Stanca Serban
1cc99991d8 Backed out changeset ad72b273da7f (bug 1856732) for causing bc failures in browser_canvas_randomization.js. CLOSED TREE 2023-12-08 16:52:18 +02:00
Emilio Cobos Álvarez
633cce158c Bug 1868552 - Refactor nsIContent::IsFocusable for clarity. r=masayuki
Make it be output-only, not having that confusing in-out tab-index
parameter that is special for XUL to become focusable with
-moz-user-focus: normal. Instead, do that explicitly in
nsIFrame::IsFocusable().

Also, call it IsFocusableWithoutStyle(), since that's what it is.

Differential Revision: https://phabricator.services.mozilla.com/D195644
2023-12-08 11:34:06 +00:00
Narcis Beleuzu
f7764889b4 Backed out changeset 71b6060b6015 (bug 1863914) for causing Bug 1868934. a=backout 2023-12-08 13:18:52 +02:00
Narcis Beleuzu
cc338968d0 Backed out changeset 71b6060b6015 (bug 1863914) for causing Bug 1868934 2023-12-08 13:18:52 +02:00
Tom Schuster
20cc3bf2c1 Bug 1856732 - WebExtensions should not be subject to random canvas noise for fingerprint resistance. r=timhuang,gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D195239
2023-12-08 10:56:37 +00:00
sotaro
ad62e8302d Bug 1868929 - Code clean up around AsyncImagePipelineManager::UpdateImageKeys() r=gfx-reviewers,lsalzman
The change removes dependency on WebRenderImageHost and RemoteTextureInfoList in AsyncImagePipelineManager::UpdateImageKeys().

Differential Revision: https://phabricator.services.mozilla.com/D195842
2023-12-08 10:51:30 +00:00
Mike Hommey
5568a9df4c Bug 1868959 - Fix unused variable in nsSocketTransportService::DoPollIteration. r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D195856
2023-12-08 10:44:48 +00:00
Otto Länd
a97998200e Bug 1867459: apply code formatting via Lando
# ignore-this-changeset
2023-12-08 10:47:01 +00:00
Mike Hommey
b7bb7390ba Bug 1867459 - Avoiding silently dismissing uses of CPU_ARCH. r=firefox-build-system-reviewers,sergesanspaille
In many cases, using CONFIG["CPU_ARCH"] will silently do the unexpected
thing now that it doesn't exist anymore. In case there are in-flight
patches using it, it's better to avoid those causing subtle problems
after a rebase by making most uses of the variable throw an exception.

Differential Revision: https://phabricator.services.mozilla.com/D195158
2023-12-08 10:43:59 +00:00
Mike Hommey
619672a8e4 Bug 1867459 - Replace CPU_ARCH with TARGET_CPU. r=firefox-build-system-reviewers,sergesanspaille
Differential Revision: https://phabricator.services.mozilla.com/D195157
2023-12-08 10:43:59 +00:00
Jon Coppeard
38f8a07e4e Bug 1868530 - Lower parallel marking thresholds following recent improvements r=sfink
These thresholds were chosen based on local benchmarking results.

In general all macOS systems I've tested perform great and the 4MB threshold is
because none of the benchmarks I used have a heap smaller than that.

Recent Windows and Linux results are also better than previously although not
as good as macOS.

I haven't done any more Android benchmarking recently so I'm using the same
value as for Linux. We're not going to enable this on Android without specific
performance work there first.

For reference, according to telemetry about 10% of our GCs have < 1MB heap size
(the minimum size captured by telemetry). A 4MB threshold excludes 11.4% of
GCs, 8MB 14.3% and 16MB 24% of GCs.

Differential Revision: https://phabricator.services.mozilla.com/D195629
2023-12-08 10:30:02 +00:00
Dão Gottwald
27bac7a37a Bug 1868931 - Repaint XUL checkbox and radio for active state too. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D195851
2023-12-08 09:49:12 +00:00
Stanca Serban
b57f879b5e Backed out changeset 54e35266f616 (bug 1866412) for causing bp-nu bustages in RenderD3D11TextureHost.cpp. CLOSED TREE 2023-12-08 11:00:31 +02:00
Nipun Shukla
9790c3e9af Bug 1852133 - Fixed --backgroundtask backgroundupdate automatic restart after staging r=bytesized,application-update-reviewers,mossop,nalexander,nika
Differential Revision: https://phabricator.services.mozilla.com/D187710
2023-12-08 07:17:15 +00:00
Edgar Chen
1b518042e4 Bug 1777448 - Part 2: Suppress the paste context menu when the clipboard data originates from a same-origin page; r=nika
And don't allow new request being associated with existing pending request if
the requests are from different origin.

This patch also set proper principal to nsItransferable for clipboard write in
various cases,
- Copy image via context menu.
- Copy current selection via keyboard shortcut or context menu.
- Data is provided by script when copy operation is triggered via keyboard
  shortcut or context menu.
- Clipboard data is put via async clipboard.

Depends on D190761

Differential Revision: https://phabricator.services.mozilla.com/D190796
2023-12-08 07:08:42 +00:00
Edgar Chen
35aaa07f46 Bug 1777448 - Part 1: Don't not show paste contextmenu for background tab; r=nika,hsivonen
Displaying the paste context menu for background tabs can be surprising and
confusing for users, so we reject the request and don't allow it being associated
with existing pending request.

Depends on D190405

Differential Revision: https://phabricator.services.mozilla.com/D190761
2023-12-08 07:08:42 +00:00
Mozilla Releng Treescript
037e46eae3 no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
be -> a987a199b188741362f2aee1d8d36da205ad29e5
de -> c107164125a981471aba4d91cb3c2f888a3aa5c6
fr -> 291daa70da0caa8ca3de1e5f6e468c5483f9357c
pa-IN -> 2599784e811461a880ac4b303fd8ed962fe7f8bd
sk -> 1292e9074e7d90388981e7fd4697011d3eb365d6
sv-SE -> 9c6190729dd6692246b43a9ba41d78c5ffe08c38
2023-12-08 07:00:29 +00:00
Otto Länd
7f61406aa0 Bug 1860899: apply code formatting via Lando
# ignore-this-changeset
2023-12-08 06:22:54 +00:00
Chun-Min Chang
b78568c9c3 Bug 1860899 - Activate FFmpegVideoEncoder only if its preference is set r=media-playback-reviewers,padenot
This patch creates a `media.ffmpeg.encoder.enabled` pref for enabling
FFmpegVideoEncoder with defualt value set to `false`, so
FFmpegVideoEncoder won't be activated in the webrtc cases.

Depends on D195739

Differential Revision: https://phabricator.services.mozilla.com/D195740
2023-12-08 06:17:15 +00:00
Chun-Min Chang
c98c0a84e5 Bug 1860899 - Init FFVPX lib on any thread r=media-playback-reviewers,karlt,padenot
This patch allows linking FFVPX library on any thread.

Depends on D195381

Differential Revision: https://phabricator.services.mozilla.com/D195739
2023-12-08 06:17:15 +00:00
Chun-Min Chang
7b4506c4f6 Bug 1860899 - Allow encoder only when ffmpeg >= 58 r=media-playback-reviewers,padenot
Since the current Encode API is implemented by the modern APIs
introduced in ffmpeg 58, the encoder functionalities should be limited
by the version accordingly.

Depends on D195380

Differential Revision: https://phabricator.services.mozilla.com/D195381
2023-12-08 06:17:15 +00:00
Chun-Min Chang
5a47507ca9 Bug 1860899 - Add a function to get error message r=media-playback-reviewers,padenot
This patch impelements a function to get an error message from an error
code.

Depends on D195379

Differential Revision: https://phabricator.services.mozilla.com/D195380
2023-12-08 06:17:14 +00:00
Chun-Min Chang
774332a868 Bug 1860899 - Implement Drain based on modern APIs r=media-playback-reviewers,padenot
This patch implements drain function based on avcodec_send_frame and
avcodec_receive_packet, similar to what Encode function did.
Thus, it only works when ffmpeg version is at least 58.

It's worth mentioning that the encoder cannot continue encoding once it
enters draining mode, due to API limitation. Users need to encode data
after draining are encouraged to create a new encoder.

Still, the alternative does exist. If AV_CODEC_CAP_ENCODER_FLUSH is set
in the AVCodec's capabilities of the AVCodecContext, then
`avcodec_flush_buffers` can be used to flush or drain all the encoded
data without explicitly entering draining mode, instead of sending a
NULL to the `avcodec_send_frame`. However, since this flag is not set
when using the libvpx encoder (at least on my machine), this approach is
put to the backlog.

With the Drain implementation, the patches so far can be tested with the
additional tests below:
1. MediaDataEncoderTest.VP8Encodes
2. MediaDataEncoderTest.VP9Encodes

via the following command:
```
MOZ_LOG="FFmpegVideo:5" ./mach gtest MediaDataEncoderTest.*
```

Those tests can check the sanity of Encode() and Drain().

Depends on D195378

Differential Revision: https://phabricator.services.mozilla.com/D195379
2023-12-08 06:17:14 +00:00
Chun-Min Chang
8356887c66 Bug 1860899 - Add a blank ProcessDrain r=media-playback-reviewers,padenot
Depends on D195377

Differential Revision: https://phabricator.services.mozilla.com/D195378
2023-12-08 06:17:13 +00:00
Chun-Min Chang
0df6c7080b Bug 1860899 - Implement AVPacket-to-MediaRawData conversion r=media-playback-reviewers,padenot
This patch completes the encoding functionality. It implements a
function copying AVPacket's data to a MediaRawData. Accordingly, the
main encode function can return the encoded data properly.

Depends on D195620

Differential Revision: https://phabricator.services.mozilla.com/D195377
2023-12-08 06:17:13 +00:00
Chun-Min Chang
7b580de1f2 Bug 1860899 - Handle RGB-type images in Encode r=media-playback-reviewers,padenot
This patch enables the encoding of RGB-type images.

Depends on D195328

Differential Revision: https://phabricator.services.mozilla.com/D195620
2023-12-08 06:17:13 +00:00
Chun-Min Chang
f85991b668 Bug 1860899 - Implement Encode based on modern APIs r=media-playback-reviewers,padenot
This patch partially implements the encoding. The following patches will
complete it. This patch focuses on how to send the given VideoData to
the underlying encoder, receive the encoded results, then convert them
into the expected format. To outline the whole process in this patch, a
dummy function is added to convert the encoded results into the expected
output format, MediaRawData, without implementation. It will be done in
the following patch.

In addition, this patch only addresses YUV/NV images. Handling of
RGB-type images will be addressed in the next patch.

Most notably, the encoding code here is based on avcodec_send_frame and
avcodec_receive_packet, which were introduced in FFmpeg 58. If the
ffmpeg version is smaller than 58, the encoder returns error for now
(The encode implementation for older ffmpeg is tracked in bug 1868253).

Depends on D195057

Differential Revision: https://phabricator.services.mozilla.com/D195328
2023-12-08 06:17:12 +00:00
Chun-Min Chang
fdc5aa543d Bug 1860899 - Add a function to allocate/free AVFrame r=media-playback-reviewers,padenot
This patch creates two functions to initialize and uninitialize the
AVFrame that will be fed to the underlying encoder as an input.

Depends on D195056

Differential Revision: https://phabricator.services.mozilla.com/D195057
2023-12-08 06:17:12 +00:00
Chun-Min Chang
f138104ec5 Bug 1860899 - Add a blank ProcessEncode r=media-playback-reviewers,padenot
Depends on D194914

Differential Revision: https://phabricator.services.mozilla.com/D195056
2023-12-08 06:17:11 +00:00
Chun-Min Chang
f43dd6d072 Bug 1860899 - Open/Close AVCodecContext in Init()/Shutdown() r=media-playback-reviewers,padenot
avcodec_open2 is not thread-safe until version 60 [1]. Besides, even it
claims to be thread-safe now, data race can appear in situations [2, 3].
To accommodate order FFmpeg versions, opening/closing the AVCodecContext
in a critical section is the simplest way to avoid data race issues.

The following related tests:
1. MediaDataEncoderTest.VP8Create
2. MediaDataEncoderTest.VP8Inits
3. MediaDataEncoderTest.VP9Create
4. MediaDataEncoderTest.VP9Inits

can be run via below command:
```
MOZ_LOG="FFmpegVideo:5" ./mach gtest MediaDataEncoderTest.*
```

[1] ebf1d0f4bb
[2] https://ffmpeg.org/pipermail/ffmpeg-devel/2022-January/290914.html
[3] https://ffmpeg.org/pipermail/ffmpeg-devel/2022-January/thread.html#290914

Depends on D194913

Differential Revision: https://phabricator.services.mozilla.com/D194914
2023-12-08 06:17:11 +00:00
Chun-Min Chang
da10c89087 Bug 1860899 - Set AVCodecContext by VideoConfig values r=media-playback-reviewers,padenot
This patch maps the VideoConfig's member values to AVCodecContext's
member values.

Depends on D194912

Differential Revision: https://phabricator.services.mozilla.com/D194913
2023-12-08 06:17:11 +00:00
Chun-Min Chang
4ee938a8be Bug 1860899 - Add conversions from encoder's pixel format to avcodec's pixel format r=media-playback-reviewers,padenot
Depends on D194581

Differential Revision: https://phabricator.services.mozilla.com/D194912
2023-12-08 06:17:10 +00:00
Chun-Min Chang
85161b16b3 Bug 1860899 - Bring template-typed config in FFmpegVideoEncoder r=media-playback-reviewers,padenot
This patch add a VideoConfig member into FFmpegVideoEncoder. Since
VideoConfig is a template, its associated type is introduced into
FFmpegVideoEncoder's template.

Depends on D194580

Differential Revision: https://phabricator.services.mozilla.com/D194581
2023-12-08 06:17:10 +00:00
Chun-Min Chang
398bee4aa4 Bug 1860899 - Allocate/Free AVCodecContext in Init()/Shutdown() r=media-playback-reviewers,padenot
This patch partially implements Init() and Shutdown() to allocate and
release the AVCodecContext respectively. These two functions will be
exectued on the platform's encoder task queue specified in the given
CreateEncoderParams. Thus, the allocated AVCodecContext is a task-queue
only member variable.

Depends on D193952

Differential Revision: https://phabricator.services.mozilla.com/D194580
2023-12-08 06:17:09 +00:00