Commit Graph

282 Commits

Author SHA1 Message Date
Brad Werth
ea61d5c181 Bug 1768824 Part 2: Set macOS transfer functions independently of colorSpace. r=media-playback-reviewers,alwu
This creates a helper function in a new class gfxMacUtils that makes the
software and hardware decoders use the same logic. The new class was
necessary because gfxUtils is included in many files that don't include
CoreFoundation headers and would hit namespace collision if it was included
there.

Differential Revision: https://phabricator.services.mozilla.com/D146735
2022-05-31 23:06:16 +00:00
Brad Werth
9b4b73f4ad Bug 1764618 Part 2: Make macOS software decode respect transfer functions. r=media-playback-reviewers,gfx-reviewers,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D143838
2022-04-22 22:10:18 +00:00
Emilio Cobos Álvarez
db1f38b1aa Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 15:24:40 +00:00
criss
de079e5758 Backed out 2 changesets (bug 1758702) for causing build bustages. CLOSED TREE
Backed out changeset 3e00d9203851 (bug 1758702)
Backed out changeset 66625baf0875 (bug 1758702)
2022-03-17 15:21:31 +02:00
Emilio Cobos Álvarez
98d4173361 Bug 1758702 - Allow ThreadSafeWeakPtr<IncompleteType> to work. r=glandium
This will be used to avoid problematic includes from WorkerPrivate.h,
and it matches the behavior of RefPtr<> and WeakPtr<>.

Differential Revision: https://phabricator.services.mozilla.com/D140658
2022-03-17 12:15:20 +00:00
Randell Jesup
855202c183 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 18:47:08 +00:00
Noemi Erli
16f5f5f2b9 Backed out changeset 12a59e5a50bf (bug 1207753) for causing build bustage CLOSED TREE 2022-03-16 18:32:51 +02:00
Randell Jesup
a98b1f8218 Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 16:16:14 +00:00
Butkovits Atila
01197944a0 Backed out changeset a68ee4b09f92 (bug 1207753) for causing Hazard bustages. CLOSED TREE 2022-03-16 14:38:14 +02:00
Randell Jesup
fe15f2115d Bug 1207753 - Add MOZ_UNANNOTATED to all Mutexes/Monitors r=nika,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D140849
2022-03-16 12:01:14 +00:00
Lee Salzman
37b46af14d Bug 1757067 - Explicitly specify chroma subsampling scheme for YCbCr data. r=jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139656
2022-03-10 09:24:15 +00:00
smolnar
aa6117776f Backed out changeset 36c6350bc7d1 (bug 1757067) for causing build bustages in gfx/gl/GLBlitHelperD3D.cpp CLOSED TREE 2022-03-10 10:10:10 +02:00
Lee Salzman
5f3ba19f78 Bug 1757067 - Explicitly specify chroma subsampling scheme for YCbCr data. r=jgilbert,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D139656
2022-03-10 07:48:53 +00:00
Lee Salzman
1b6e9ef767 Bug 1750858 - Respect mPicSize in WebRender. r=sotaro
This makes WR properly handle mPicSize when RenderBufferTextureHost is used.
The main change is that we need to take care to pass in display().Size() from
the descriptor, and then further use that to carefully limit the size of the
CbCr texture, as it doesn't necessarily maintain an appropriate half-sized
scale with respect to the Y texture if it is padded.

Given that mPicSize should now actually work, we should no longer need any
of the previous mCroppedSize mechanisms that were added to work around this,
and so they are removed in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D139267
2022-02-22 17:56:30 +00:00
alwu
73005a6bcb Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-25 02:44:59 +00:00
Butkovits Atila
76a312eddf Backed out 5 changesets (bug 1713276) for causing reftest failures at color_quads/720p.png.bt709.bt709.pc.yuv420p10.vp9.webm. CLOSED TREE
Backed out changeset 9ac49fde0e53 (bug 1713276)
Backed out changeset 21a1cb173d50 (bug 1713276)
Backed out changeset d8e319535a01 (bug 1713276)
Backed out changeset 0a1be4875045 (bug 1713276)
Backed out changeset b2676297c6ff (bug 1713276)
2022-01-22 23:14:05 +02:00
alwu
c0c41cc61e Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-22 17:25:22 +00:00
Cristian Tuns
c178ff5013 Backed out 4 changesets (bug 1713276) on suspicion of causing wpt failure in canvas + video test CLOSED TREE
Backed out changeset f4ca14151598 (bug 1713276)
Backed out changeset 52fdcd1dc5ed (bug 1713276)
Backed out changeset 5503198fc6b2 (bug 1713276)
Backed out changeset 002c71e3c3f7 (bug 1713276)
2022-01-21 04:26:22 -05:00
alwu
f0da420157 Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-20 23:53:10 +00:00
Norisz Fay
0c059a17e8 Backed out 4 changesets (bug 1713276) for causing build bustage and wpt failures CLOSED TREE
Backed out changeset cee073e045a3 (bug 1713276)
Backed out changeset 9a47b267032e (bug 1713276)
Backed out changeset 3d88e393a0cb (bug 1713276)
Backed out changeset f8814abefa20 (bug 1713276)
2022-01-20 11:39:56 +02:00
alwu
6e9e28ebe4 Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-20 05:50:54 +00:00
Narcis Beleuzu
4f154a6e3b Backed out 4 changesets (bug 1713276) for bustages on FFmpegVideoDecoder.cpp . CLOSED TREE
Backed out changeset 12a9f3fad481 (bug 1713276)
Backed out changeset cdc8216b3f18 (bug 1713276)
Backed out changeset b23498172031 (bug 1713276)
Backed out changeset 13ce7037ff27 (bug 1713276)
2022-01-20 07:26:12 +02:00
alwu
bf37a911cf Bug 1713276 - part1 : allocate shmem for ffmpeg to store decoded data directly. r=stransky,gfx-reviewers,sotaro,jgilbert,media-playback-reviewers
This implements a customized buffer allocator for ffmpeg decoder to allow it to store decoded data on shmem, so decoded data can be shared with the compositor process without doing extra copy.

As ffmpeg decoder needs a special alignment which will be larger than the actual image, we would need to crop the planes by telling plane descriptor correct place size in order to display image correctly.

Otherwise, showing a larger image causes visible incorrect border on the right and bottom of the actual image.

This will help improve the performance of software decoding while using ffmpeg and ffvpx, which is about h264 and vpx on Linux, vpx on Windows and MacOS.

Inaddition, Here is a result [1] showing that how much improvement using shmem can help.

[1] https://bit.ly/3dy4rya

Differential Revision: https://phabricator.services.mozilla.com/D130220
2022-01-20 04:11:48 +00:00
Kelsey Gilbert
4d978ff74d Bug 1746111 - (Re)serialize WebRTC frame SurfaceDescriptorBuffers for convert-and-upload on WebGLParent. r=gfx-reviewers,nika,lsalzman
Also generally de-inline (WebGLParent::TexImage not DispatchCommand)
TexImage(SurfaceDescriptor).

Differential Revision: https://phabricator.services.mozilla.com/D132851
2021-12-15 01:54:21 +00:00
Andrew Osmond
e4154e740e Bug 1711061 - Part 13. Remove the now unused ImageContainer and related code for images. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126606
2021-11-27 11:47:40 +00:00
Sandor Molnar
5c9a4c3ee8 Backed out 13 changesets (bug 1711061) on devs request. CLOSED TREE
Backed out changeset c4f073f7e3a3 (bug 1711061)
Backed out changeset aced4b672fb4 (bug 1711061)
Backed out changeset 3687e798f665 (bug 1711061)
Backed out changeset 7b471990ea86 (bug 1711061)
Backed out changeset 1014a95f540e (bug 1711061)
Backed out changeset a37b3091281d (bug 1711061)
Backed out changeset 96a0ef35881b (bug 1711061)
Backed out changeset 38890cc266fb (bug 1711061)
Backed out changeset be73004c0850 (bug 1711061)
Backed out changeset b964576ae53d (bug 1711061)
Backed out changeset d453c5219255 (bug 1711061)
Backed out changeset 0145b538175b (bug 1711061)
Backed out changeset 41ba2e2a2d13 (bug 1711061)
2021-10-29 00:36:30 +03:00
Andrew Osmond
6f78d74523 Bug 1711061 - Part 13. Remove the now unused ImageContainer and related code for images. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126606
2021-10-27 01:24:36 +00:00
Sandor Molnar
8213f51c9d Backed out 13 changesets (bug 1711061) for causing browser-chrome failures in test/performance/browser_startup_images. CLOSED TREE
Backed out changeset 5988220f56b8 (bug 1711061)
Backed out changeset cb7721d7ce49 (bug 1711061)
Backed out changeset 343746ffae73 (bug 1711061)
Backed out changeset 000940244dcf (bug 1711061)
Backed out changeset 27565d5ae08d (bug 1711061)
Backed out changeset f3b2379d971b (bug 1711061)
Backed out changeset d4b3d0fa1771 (bug 1711061)
Backed out changeset 9af5b3f2225f (bug 1711061)
Backed out changeset da992effeff1 (bug 1711061)
Backed out changeset 6b2bc6c16b9f (bug 1711061)
Backed out changeset ac2792d42be2 (bug 1711061)
Backed out changeset cb00177e655e (bug 1711061)
Backed out changeset 8d5261184226 (bug 1711061)
2021-10-26 18:04:34 +03:00
Andrew Osmond
97afb5cf52 Bug 1711061 - Part 13. Remove the now unused ImageContainer and related code for images. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D126606
2021-10-26 13:28:27 +00:00
Jon Bauman
454a3081f4 Bug 1696045 - Add AVIF telemetry for unimplemented features and performance. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D123378
2021-08-24 22:34:32 +00:00
Sandor Molnar
3fef199c23 Backed out changeset d0f659f7ea9b (bug 1696045) for causing gtest failures in image/decoders/nsAVIFDecoder. CLOSED TREE 2021-08-24 21:27:20 +03:00
Jon Bauman
03bfd5fc9c Bug 1696045 - Add AVIF telemetry for unimplemented features and performance. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D123378
2021-08-24 17:20:02 +00:00
Matt Woodrow
20ab8cde7a Bug 1653902 - Allocate a buffer for BuildSurfaceDescriptorBuffer using the computed destination layout. r=jbauman
Differential Revision: https://phabricator.services.mozilla.com/D111595
2021-04-19 04:24:43 +00:00
Jeff Gilbert
d96ec16c35 Bug 1697670 - Remove gfx::YUVColorSpace::UNKNOWN. r=mstange
Replace with Maybe<YUVColorSpace> where still needed.

Differential Revision: https://phabricator.services.mozilla.com/D107938
2021-03-19 00:58:23 +00:00
Csoregi Natalia
6e069b9d57 Backed out changeset f155cf6af343 (bug 1697670) for bustage on gfxUtils.cpp. CLOSED TREE 2021-03-17 02:41:15 +02:00
Jeff Gilbert
4c70738177 Bug 1697670 - Remove gfx::YUVColorSpace::UNKNOWN. r=mstange
Replace with Maybe<YUVColorSpace> where still needed.

Differential Revision: https://phabricator.services.mozilla.com/D107938
2021-03-16 23:25:54 +00:00
Simon Giesecke
dc4d3c6894 Bug 1634281 - Use nsTHashMap for nsBaseHashtable/nsDataHashtable uses with RefPtr data type. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D105963
2021-03-09 11:39:36 +00:00
Jeff Gilbert
a315d0bc8f Bug 1640607 - Send SurfaceDescriptors for GPU blitting for video-to-webgl. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D101061
2021-01-14 01:23:06 +00:00
Chun-Min Chang
7e93245784 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
Simon Giesecke
5efd1faf25 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Kris Taeleman
bcdec8105d Bug 1656987 - Change WeakPtr to ThreadSafeWeakPtr. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D90748
2020-09-21 18:14:47 +00:00
Emilio Cobos Álvarez
7c14a23719 Bug 1665373 - Stop using nsCountedRef in the image container classes. r=aosmond
Instead, use NS_ReleaseOnMainThread. This requires exactly the same number of
special-cases, but let me know if you instead want a separate
MainThreadSurfaceRef which implements RefPtrTraits and releases on the main
thread or something...

Depends on D90398

Differential Revision: https://phabricator.services.mozilla.com/D90399
2020-09-16 15:13:51 +00:00
Matt Woodrow
908df2a465 Bug 1653409 - Upload software decoded video directly to IOSurface on OSX. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D85105
2020-08-04 01:18:14 +00:00
Matt Woodrow
bf3bac9774 Bug 1653166 - Add rotation support to computed reference frames and use them for <video>. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D85104
2020-08-04 01:15:04 +00:00
Emilio Cobos Álvarez
47634b1c9e Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Jean-Yves Avenard
05adafa9ef Bug 1637500 - P2. Rename methods as they are not always dealing with "threads". r=froydnj
Before P1, GetCurrentThreadSerialEventTarget would have always returned the same data as NS_GetCurrentThread, making the comment incorrect Now it will properly return the running TaskQueue if any.

This change of name more clearly exposes what they are doing, as we aren't always dealing with threads directly; but a nsISerialEventTarget

Differential Revision: https://phabricator.services.mozilla.com/D80354
2020-06-23 05:05:36 +00:00
Martin Stransky
6f3e3bc7bf Bug 1645704 [Wayland] Rename WaylandDMABufSurface to DMABufSurface at gxf, r=sotaro
Differential Revision: https://phabricator.services.mozilla.com/D79637
2020-06-21 13:59:17 +00:00
Bryce Seager van Dyk
bc97d7211c Bug 1643143 - Touch up doc comment and diagram for PlanarYCbCrImage. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D78144
2020-06-03 21:43:25 +00:00
sotaro
5fe2750020 Bug 1618429 - Add RecycleAllocator support to ImageContainer for RDD process r=nical
Differential Revision: https://phabricator.services.mozilla.com/D64508
2020-03-11 10:52:48 +00:00
Simon Giesecke
83e48517da Bug 1613985 - Use default for equivalent-to-default constructors/destructors in gfx. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D65288
2020-03-04 15:39:20 +00:00