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

162 Коммитов

Автор SHA1 Сообщение Дата
Jeff Gilbert d517313a40 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 e0c536d241 Backed out changeset f155cf6af343 (bug 1697670) for bustage on gfxUtils.cpp. CLOSED TREE 2021-03-17 02:41:15 +02:00
Jeff Gilbert 7d9b571b77 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
alwu 80632b032f Bug 1684126 - part1 : modify `mTime` and `mOriginalTime` together. r=padenot,bryce
In AudioData, we use `mOriginalTime` to store the original start time before trimming, which should keep sync to `mTime` if data hasn't been trimmed before. Otherwise, if they are not equal, it would cause a problem when handling trimming.

For example.
If audio data's time is X, original time is X-1 and duration is T. When MDSM performs seeking, it would use (X + T) as trimming window's end time. However, in `AudioData::SetTrimWindow()`, original time + duration (X - 1 + T) would be less than the trimming end time, which causes an error.

Differential Revision: https://phabricator.services.mozilla.com/D100825
2021-01-12 14:14:01 +00:00
alwu b8c6ef7b92 Bug 1685215 - 'AdjustForStartTime()' should only exist on decoded data type. r=padenot
`AdjustForStartTime()` is only used for decoded data type in order to adjust their start time to zero, such as `VideoData` and `AudioData`.

However, some other types inherited from `MediaData` don't need that function. Eg. `MediaRawData`, so it's not necessary to put it on the `MediaData`, we should move that function to `VideoData` and `AudioData` separately.

Differential Revision: https://phabricator.services.mozilla.com/D100846
2021-01-11 08:13:12 +00:00
Paul Adenot 78d06fb142 Bug 1668598 - Don't use the word 'size' to mean a number of elements in MediaData.h. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D92429
2020-10-06 10:24:00 +00:00
Bryce Seager van Dyk 6e2d1d8482 Bug 1618529 - Store clear crypto subsample info in uint32 rather than uint16. r=jolin
This avoids us risking an overflow when we convert encrypted media with
subsamples to AnnexB (since that conversion can grow the clear sizes of the
sample). See the test in the preceding patch for an example of how and why this
happens.

Differential Revision: https://phabricator.services.mozilla.com/D92300
2020-10-05 18:17:06 +00:00
Paul Adenot bbc8ba8d2b Bug 1566389 - Allow removing elements at the end of an AlignedAudioBuffer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91776
2020-10-05 15:42:55 +00:00
Noemi Erli d5e42c4c4e Backed out 7 changesets (bug 1566389) for causing bustages in FFmpegAudioDecoder.cpp
Backed out changeset 748e0d854d86 (bug 1566389)
Backed out changeset dd68ca2ed329 (bug 1566389)
Backed out changeset 820744dbc7d1 (bug 1566389)
Backed out changeset 89378e240d00 (bug 1566389)
Backed out changeset 6d36dae2ca8f (bug 1566389)
Backed out changeset ec4e0024ab8d (bug 1566389)
Backed out changeset 0fe64b836e24 (bug 1566389)
2020-10-05 18:23:37 +03:00
Paul Adenot 685a360493 Bug 1566389 - Allow removing elements at the end of an AlignedAudioBuffer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91776
2020-10-05 13:10:39 +00:00
Butkovits Atila 4f41db1dfa Backed out 7 changesets (bug 1566389) for bustage at FFmpegAudioDecoder.cpp. CLOSED TREE
Backed out changeset 116644341a76 (bug 1566389)
Backed out changeset a3bedd49288d (bug 1566389)
Backed out changeset 8db398c91c5a (bug 1566389)
Backed out changeset 498a7c9cbc5f (bug 1566389)
Backed out changeset 19a04bdb5344 (bug 1566389)
Backed out changeset 8390ea4677a1 (bug 1566389)
Backed out changeset 085b748cfbaf (bug 1566389)
2020-10-01 22:43:04 +03:00
Paul Adenot c7bf74d2f1 Bug 1566389 - Allow removing elements at the end of an AlignedAudioBuffer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D91776
2020-10-01 13:57:55 +00:00
Jean-Yves Avenard f5d2605aa7 Bug 1648309 - P4. Add ArrayOfRemoteAudioData and use it. r=mjf,padenot
An ArrayOfRemoteAudioData pack all its AudioData objects into a single Shmem.
This Shmem will be-reused by the remote decoder over and over.
When used with webaudio, this reduces the number of memory allocation from 100 to 1 for each remote decoder.

Differential Revision: https://phabricator.services.mozilla.com/D91539
2020-09-29 05:02:40 +00:00
Jean-Yves Avenard 2c63e2e5b0 Bug 1648309 - P2. Add RemoteArrayOfByteBuffer and ArrayOfRemoteMediaRawData objects. r=padenot,mjf
Those two objects can be used to pack multiple array of objects into a minimal amount of shmem.

An ArrayOfRemoteByteBuffer will take at most a single shmem and perform a single memory allocation..
Similarly, an ArrayOfMediaRawData will pack multiple MediaRawData in at most 3 shmems (one for each array of bytes a MediaRawData contains).

They are designed to work in combination with a ShmemPool which will own each of the allocated Shmem and so can be re-used over and over.

Differential Revision: https://phabricator.services.mozilla.com/D91537
2020-09-29 04:39:14 +00:00
Paul Adenot 2f461c2326 Bug 1662805 - Replace instantaneous audibility decisions for MediaStream and regular playback with the AudibilityMonitor. r=pehrsons
Depends on D89634

Differential Revision: https://phabricator.services.mozilla.com/D89635
2020-09-15 09:00:57 +00:00
Cristina Coroiu d85babf17b Backed out 5 changesets (bug 1662805) for multiple failures, e.g. bc failures at dom/media/mediacontrol/tests/browser_media_control_non_eligible_media.js on a CLOSED TREE
Backed out changeset 820eb655de3d (bug 1662805)
Backed out changeset 23c90dd335b1 (bug 1662805)
Backed out changeset eff66444dc68 (bug 1662805)
Backed out changeset caeffea29d80 (bug 1662805)
Backed out changeset 2f8f9799d1f3 (bug 1662805)
2020-09-14 14:44:34 +03:00
Paul Adenot f07e869482 Bug 1662805 - Replace instantaneous audibility decisions for MediaStream and regular playback with the AudibilityMonitor. r=pehrsons
Depends on D89634

Differential Revision: https://phabricator.services.mozilla.com/D89635
2020-09-14 09:41:26 +00:00
Simon Giesecke dea5b543db Bug 1653335 - Remove uses of MakeSpan in return statements. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D83812
2020-08-07 07:42:50 +00:00
Bryce Seager van Dyk ac666e8dcb Bug 1643375 - Remove VideoData::YCbCrBuffer::Plane::mOffset. r=alwu
Because we store each plane's data pointer we don't need to store a separate
offset, we can just roll that offset into the pointer for that plane.

This helps remove a lot of code where we're not using the offset anyway, and in
the Chromium CDM case we simply roll the offset into our data pointer.

Differential Revision: https://phabricator.services.mozilla.com/D78320
2020-06-11 23:04:55 +00:00
Simon Giesecke f7f5462a4b Bug 1626570 - Improve handling of copying arrays in dom/media/. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D73627
2020-05-05 11:38:10 +00:00
Chris Peterson bb98712768 Bug 1594529 - Replace MOZ_MUST_USE with [[nodiscard]] in dom/media. r=bryce
Depends on D72565

Differential Revision: https://phabricator.services.mozilla.com/D72566
2020-04-27 15:18:07 +00:00
Simon Giesecke 88ead5d627 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/media. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D65178

--HG--
extra : moz-landing-system : lando
2020-03-04 15:39:20 +00:00
John Lin aeb8b64dbe Bug 1509316 - p1: move composite listening out of VideoData/VideoSink. r=jya,mattwoodrow
On Android, decoded buffers need to be send back to MediaCodec in order to be
rendered and/or recycled. The current mechanism introduced in bug 1299068 only
works for playback(VideoData/VideoSink) but not WebRTC(VideoFrame/VideoOutput).
Move the callback to SurfaceTextureImage because VideoData and VideoFrame both
own that when using MediaCodec, and move the notification to VideoFrameContainer
for both VideoSink and VideoOutput pass frames there for compositing.

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

--HG--
extra : moz-landing-system : lando
2019-10-09 23:08:12 +00:00
Dorel Luca c18b81f79f Backed out 3 changesets (bug 1509316) for MDA failures on dom/media/tests/mochitest/test_peerConnection_captureStream_canvas_2d.html
Backed out changeset d64c35b9c211 (bug 1509316)
Backed out changeset 817f14af91f0 (bug 1509316)
Backed out changeset b4bee18bb499 (bug 1509316)
2019-09-27 23:31:51 +03:00
John Lin 01cc36b53b Bug 1509316 - p1: move composite listening out of VideoData/VideoSink. r=jya,mattwoodrow
On Android, decoded buffers need to be send back to MediaCodec in order to be
rendered and/or recycled. The current mechanism introduced in bug 1299068 only
works for playback(VideoData/VideoSink) but not WebRTC(VideoFrame/VideoOutput).
Move the callback to SurfaceTextureImage because VideoData and VideoFrame both
own that when using MediaCodec, and move the notification to VideoFrameContainer
for both VideoSink and VideoOutput pass frames there for compositing.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 03:01:49 +00:00
Jean-Yves Avenard 577b826128 Bug 1543359 - P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
When unknown, we rely on the picture height and assume that anything less than 720p is 601 and 709 otherwise. It's not perfect but it's the best we can do.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 08:45:39 +00:00
Jean-Yves Avenard bb8acbc1f9 Bug 1543359 - P1. Add mColorRange info to YCbCrBufferData. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D27210

--HG--
extra : moz-landing-system : lando
2019-07-26 08:45:37 +00:00
Narcis Beleuzu e84980d8b1 Backed out 15 changesets (bug 1543359) for wrench bustages on image.rs . CLOSED TREE
Backed out changeset 548006270186 (bug 1543359)
Backed out changeset c9585e9d9f3c (bug 1543359)
Backed out changeset 1c7ca95a2a9b (bug 1543359)
Backed out changeset d742d80b892f (bug 1543359)
Backed out changeset 210eee703fd9 (bug 1543359)
Backed out changeset 4eb933d55d88 (bug 1543359)
Backed out changeset fb9b71ed9f4b (bug 1543359)
Backed out changeset 98b968443458 (bug 1543359)
Backed out changeset a85bd4691bea (bug 1543359)
Backed out changeset b576317853e9 (bug 1543359)
Backed out changeset 095bca5c9b1a (bug 1543359)
Backed out changeset 48eb0ebf9f2e (bug 1543359)
Backed out changeset b22b0eb708b8 (bug 1543359)
Backed out changeset 52187d9320b1 (bug 1543359)
Backed out changeset fa6792c1c2e8 (bug 1543359)
2019-07-26 11:40:33 +03:00
Jean-Yves Avenard d6adb6b604 Bug 1543359 - P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
When unknown, we rely on the picture height and assume that anything less than 720p is 601 and 709 otherwise. It's not perfect but it's the best we can do.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 06:14:30 +00:00
Jean-Yves Avenard b7d2623f93 Bug 1543359 - P1. Add mColorRange info to YCbCrBufferData. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D27210

--HG--
extra : moz-landing-system : lando
2019-07-26 06:10:37 +00:00
Cosmin Sabou ae7e8fbf55 Backed out 14 changesets (bug 1543359) for causing build bustages. CLOSED TREE
Backed out changeset 87c99ef85813 (bug 1543359)
Backed out changeset cd0afc5758ba (bug 1543359)
Backed out changeset 101ac87ff017 (bug 1543359)
Backed out changeset 348e748e3451 (bug 1543359)
Backed out changeset d9e937f5caf4 (bug 1543359)
Backed out changeset 2f4eb6501552 (bug 1543359)
Backed out changeset 0d316ef8c668 (bug 1543359)
Backed out changeset bf238b58c694 (bug 1543359)
Backed out changeset 496f206d03d6 (bug 1543359)
Backed out changeset 7c3a1f23baa8 (bug 1543359)
Backed out changeset 90fff717198b (bug 1543359)
Backed out changeset b2ce591ca398 (bug 1543359)
Backed out changeset a63968f077e3 (bug 1543359)
Backed out changeset ca660ab1e0c1 (bug 1543359)
2019-07-26 07:39:11 +03:00
Jean-Yves Avenard 84900ae6ff Bug 1543359 - P13. Let the video decoder determines the default colorspace if unknown. r=mattwoodrow
When unknown, we rely on the picture height and assume that anything less than 720p is 601 and 709 otherwise. It's not perfect but it's the best we can do.

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

--HG--
extra : moz-landing-system : lando
2019-07-26 04:26:56 +00:00
Jean-Yves Avenard ad13a81d3e Bug 1543359 - P1. Add mColorRange info to YCbCrBufferData. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D27210

--HG--
extra : moz-landing-system : lando
2019-07-22 07:24:09 +00:00
alwu 424b48c982 Bug 1563949 - part2 : add 'AppendSample' to assert that a sample should always be valid r=jya
We don't want to have a sample with invalid time, duration, end time or end timecode, so add a diagnostic assertion to check. And will handle invalid sample for demuxers in next patch.

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

--HG--
extra : moz-landing-system : lando
2019-07-19 20:16:26 +00:00
alwu 7cea87585a Bug 1563949 - part1 : add function 'GetEndTimeCode'. r=jya
We already have function `GetEndTime()`, so it's good to have a similar function `GetEndTimeCode()` so that we won't have to calculate end time code by ourselves.

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

--HG--
extra : moz-landing-system : lando
2019-07-18 11:03:28 +00:00
alwu 6e61f3513b Bug 1540748 - part2 : add warning for negative adjusted time. r=jolin
As the purpose of adjusting time is to make the start of the playback to align to zero, so the result should not be negative.

However, we can't always ensure the demuxed start time is correct, the decoded first frame sample time might be different with the time demuxer provides.

Even if we try to update the start time when we get the first decoded sample, there is still a problem because a decoder might return samples with different order, which means the first frame the decoder returns is probably not a real first frame.

Therefore, using warning to help us knows how many this situaion would be.

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

--HG--
extra : moz-landing-system : lando
2019-04-29 21:44:06 +00:00
Cosmin Sabou b756e6d007 Backed out 2 changesets (bug 1540748) for causing more crashes (bug 1547604). a=backout
Backed out changeset 57b12599afe2 (bug 1540748)
Backed out changeset 8c9fc50e48c2 (bug 1540748)
2019-04-29 12:55:04 +03:00
Alastor Wu 31a6a91d20 Bug 1540748 - part2 : add warning for negative adjusted time. r=jolin
As the purpose of adjusting time is to make the start of the playback to align to zero, so the result should not be negative.

However, we can't always ensure the demuxed start time is correct, the decoded first frame sample time might be different with the time demuxer provides.

Even if we try to update the start time when we get the first decoded sample, there is still a problem because a decoder might return samples with different order, which means the first frame the decoder returns is probably not a real first frame.

Therefore, using warning to help us knows how many this situaion would be.

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

--HG--
extra : moz-landing-system : lando
2019-04-26 22:30:06 +00:00
shindli ff6b6815f1 Backed out 2 changesets (bug 1540748) for causing perma assertion failure !mTime.IsNegative(), at /builds/worker/workspace/build/src/dom/media/MediaData.h:303 CLOSED TREE
Backed out changeset d8cb636260a0 (bug 1540748)
Backed out changeset 27bcf73686ed (bug 1540748)
2019-04-24 21:07:15 +03:00
Alastor Wu 57885dc99c Bug 1540748 - part2 : adjusted time should always be non-negative. r=jolin
As the purpose of adjusting time is to make the start of the playback to align to zero, so the result should not be negative.

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

--HG--
extra : moz-landing-system : lando
2019-04-24 15:05:39 +00:00
Jean-Yves Avenard 3ae43eb506 Bug 1493898 - P6. Move YUVColorSpace definition in the gfx namespace. r=mattwoodrow.
YUVColorSpace is inseparable from the bit depth as the matrix coefficients to be calculated need the bit depth information.

So let's put the two types together. gfx namespace also makes more sense as that's where we find IntRect, IntSize and other.

The extent of the changes highlight how much similar data structures are duplicated across the code, to the point it's scary.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 12:41:33 +00:00
Alastor Wu f076a8ece9 Bug 1540740 - part2 : using TimeUnit as input parameter for 'AdjustForStartTime()'. r=jya
There is no need to cast to `TimeUnit` to `int64` and then cast to `TimeUnit` again.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 17:32:54 +00:00
alwu aebb6d8617 Bug 1540740 - part1 : let the return value of 'AdjustForStartTime()' to tell whether the adjustment is succeeded r=jya
Now the caller of `AdjustForStartTime()` should check the return value to know whether the adjustment is succeeded.

If the error happens the caller should handle it and return an error.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 20:43:00 +00:00
Jean-Yves Avenard 04019bde46 Bug 1530322 - P3. Add temporary diagnostics. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D21173

--HG--
extra : moz-landing-system : lando
2019-02-26 09:10:04 +00:00
Narcis Beleuzu 06e372323d Backed out 3 changesets (bug 1530322) for bustages on Assertions.h . CLOSED TREE
Backed out changeset 65870fec6eea (bug 1530322)
Backed out changeset d5159dfc6d86 (bug 1530322)
Backed out changeset 68fd0947b767 (bug 1530322)
2019-02-26 09:39:14 +02:00
Jean-Yves Avenard 120c38f502 Bug 1530322 - P3. Add diagnostics. r=gerald
Depends on D21172

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

--HG--
extra : moz-landing-system : lando
2019-02-26 06:39:57 +00:00
Jean-Yves Avenard 68176b56c7 Bug 1524890 - P13. [MSE] Mark frames as truncated when needed. r=bryce
There's two cases to handle.
1- A Frame isn't entirely contained between appendWindowStart and appendWindowEnd
2- A new frame is appended which overlaps partially an existing frame.

To achieve this we tweak the start time and duration of the sample added (case 1), or the frame about to be partially covered (case 2). We then set a flag that will indicate to the decoder that the decompressed frame will have to be truncated.

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

--HG--
extra : moz-landing-system : lando
2019-02-22 09:21:05 +00:00
Jean-Yves Avenard 4377bd3b8b Bug 1524890 - P11. Remove duration from AudioData construction parameter. r=bryce
It can be determined from the size of the buffer and the number of audio frames. Additionally, it ensures that the duration of the frame is always exactly what the AudioData contains.

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

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:47 +00:00
Jean-Yves Avenard ca21a59533 Bug 1524890 - P10. Add AudioData::SetTrimWindow. r=bryce
Don't re-create a new trimmed AudioData when we want to remove some content. This remove the need for some copies.

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

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:32 +00:00
Jean-Yves Avenard 7f3801ebd7 Bug 1524890 - P8. Rely on buffer length to calculate the number of frames. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D20166

--HG--
extra : moz-landing-system : lando
2019-02-22 09:19:00 +00:00