Commit Graph

1535 Commits

Author SHA1 Message Date
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
285ab3ee11 Bug 1540748 - part1 : Android decoder should throw an error when the decoded sample's time is smaller than the time of first demuxed sample. r=jolin
Considering that the audio sample's time is always increased, the decoded sample's time decoder returns should always be equal or larger than its demuxed time.

When the decoded sample's time is smaller than the time of first demuxed sample, that time would probably cause a problem so we should  throw an error for that.

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

--HG--
extra : moz-landing-system : lando
2019-04-25 21:47:53 +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
4e0420416f Bug 1540748 - part1 : Android decoder should throw an error when the decoded sample's time is smaller than the time of first demuxed sample. r=jolin
Considering that the audio sample's time is always increased, the decoded sample's time decoder returns should always be equal or larger than its demuxed time.

When the decoded sample's time is smaller than the time of first demuxed sample, that time would probably cause a problem so we should  throw an error for that.

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

--HG--
extra : moz-landing-system : lando
2019-04-24 15:16:58 +00:00
Michael Froman
62655b5d62 Bug 1515497 - pt 1 - eliminate fall back to av1 decoding on content process when RDD enabled. r=bryce
If the RDD process is enabled and fails to start properly for some reason,
make sure we cannot accidentally fall back to decoding AV1 on the content
process.

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

--HG--
extra : moz-landing-system : lando
2019-04-19 21:11:25 +00:00
Jean-Yves Avenard
51d9f4be53 Bug 1540581 - P18. Move destination texture type choice to the D3D11 texture allocator. r=mattwoodrow
It allows for more readable code, not having to store multiple times different storage type across multiple objects.

Now each class does one task and only deal with a single texture data type.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 12:39:12 +00:00
Jean-Yves Avenard
2ca0f1b548 Bug 1540581 - P12. Pass YUV colorspace information with WMF decoder. r=bryce,mattwoodrow.
Differential Revision: https://phabricator.services.mozilla.com/D26467

--HG--
extra : moz-landing-system : lando
2019-04-11 12:38:51 +00:00
Jean-Yves Avenard
1dc7e8e498 Bug 1540581 - P11. Handle colorspace correctly with D3D11 images. r=mattwoodrow,nical
Differential Revision: https://phabricator.services.mozilla.com/D26466

--HG--
extra : moz-landing-system : lando
2019-04-11 12:38:49 +00:00
Jean-Yves Avenard
b8abb07619 Bug 1540581 - P10. Pass colorspace data with first VP9 frame seen. r=bryce
The info would only be passed after the 2nd keyframe

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

--HG--
extra : moz-landing-system : lando
2019-04-11 12:37:38 +00:00
Jean-Yves Avenard
92b211930c Bug 1540581 - P8. Set decoding format back to NV12 and set colorspace. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D26062

--HG--
extra : moz-landing-system : lando
2019-04-11 12:37:16 +00:00
Jean-Yves Avenard
0bb575734a Bug 1540581 - P3. Add methods to extract color space and color depth from SPS NAL. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D26056

--HG--
extra : moz-landing-system : lando
2019-04-11 12:36:10 +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
Jean-Yves Avenard
14fac11637 Bug 1493898 - P5. Add Colorspace and YUV range data to VideoInfo. r=bryce
And read the info from the VP9 bytestream.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 12:41:23 +00:00
Jean-Yves Avenard
09b5578692 Bug 1493898 - P3. Don't downsample 10/12 bits AOM images. r=bryce
All compositors support 10/12 bits images now.
Additionally, add BT2020 support to AOM decoder.

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

--HG--
extra : moz-landing-system : lando
2019-04-11 12:40:59 +00:00
Jean-Yves Avenard
1da8a6804f Bug 1493898 - P2. Add BT2020 support to decoders. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D25343

--HG--
extra : moz-landing-system : lando
2019-04-11 12:40:50 +00:00
Matt Woodrow
5afd2f3dd1 Bug 1538969 - Report an opaque surface format for AndroidSurfaceTextureData when it's being used for an opaque video. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D25185

--HG--
extra : moz-landing-system : lando
2019-04-10 08:08:22 +00:00
Cosmin Sabou
fa2d5b1cec Backed out 3 changesets (bug 1538969) for wpt reftests failures on transform3d-backface-visibility-001.
Backed out changeset c8e85a802c77 (bug 1538969)
Backed out changeset 911386e724bc (bug 1538969)
Backed out changeset 2332a2fb02fa (bug 1538969)

--HG--
extra : amend_source : 6f1ed1f9f2e978ab6c52a03cde73b225ff09448b
2019-04-09 08:52:20 +03:00
Matt Woodrow
34ec34f8a9 Bug 1538969 - Report an opaque surface format for AndroidSurfaceTextureData when it's being used for an opaque video. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D25185

--HG--
extra : moz-landing-system : lando
2019-04-09 03:16:09 +00:00
John Lin
2441080e34 Bug 1542440 - Recycle sample directly rather than through CodecProxy. r=jya
mJavaDecoder is invalid after the decoder is shut down and should never
be used.

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

--HG--
extra : moz-landing-system : lando
2019-04-08 09:16:20 +00:00
Sylvestre Ledru
03c8e8c2dd Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:41:42 +00:00
John Lin
e86d5d39e0 Bug 1540036 - p2: Check buffer and codec state before processing buffers. r=jya
HandleOutput() runs on Android binder thread pool and could be preempted
by RemoteDateDecoder task queue. That means ProcessOutput() could be scheduled
after ProcessShutdown() or ProcessFlush(). When that happens, aBuffer is no
long valid and should never be processed, and aSample can be
recycled immediately.
Also assert preconditions of buffers received from Java callbacks.

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

--HG--
extra : moz-landing-system : lando
2019-04-05 21:01:56 +00:00
Csoregi Natalia
ba58e936bd Backed out changeset 4ad80127f89f (bug 1519636) for bustage on MarkupMap.h and nsAccessibilityService.cpp. CLOSED TREE 2019-04-05 09:48:19 +03:00
Sylvestre Ledru
d1c1878603 Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 21:36:16 +00:00
Narcis Beleuzu
24dbe577a5 Backed out changeset 389b6bbd76db (bug 1519636) for bustages on MarkupMap.h . CLOSED TREE 2019-04-05 00:27:56 +03:00
Sylvestre Ledru
399dbd28fe Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan
clang-format-8 upstream had some improvements wrt macros
See: https://reviews.llvm.org/D33440
This is why the diff is bigger than usual

# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-04-04 20:12:23 +00:00
Alex Chronopoulos
df730bd21e Bug 1540231 - Stop dispatching a task to the TaskQueue when we are already in it. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D25576

--HG--
extra : moz-landing-system : lando
2019-04-01 22:05:48 +00:00
Sylvestre Ledru
ef0bfc3822 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-03-31 15:12:55 +00:00
John Lin
c668fd7d06 Bug 1308405 - p4: Separate buffer from sample object. r=snorp
To prevent new buffer object from being created per frame, either
Sample.CREATOR has to keep track of all buffers from every remote codec,
or the client must memorize seen buffers and avoid asking for them again
and again. The former saves client code from modifications but complicates
the implementation of Sample, a data structure class, while the latter
requires changes to client code but avoid overcomplicating Sample.CREATOR
implementation.

The 2nd approach is taken:
- move SampleBuffer out of Sample, and update clients accordingly
- add a new IPC method for clients to get the buffers only when needed

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

--HG--
extra : moz-landing-system : lando
2019-03-28 18:06:23 +00:00
John Lin
f5eaaf3299 Bug 1308405 - p1: Recycle input buffer info. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D24587

--HG--
extra : moz-landing-system : lando
2019-03-28 18:04:55 +00:00
Jean-Yves Avenard
92b55dddb6 Bug 1538508 - P3. Add options to scan all frames for SPS/PPS change. r=bryce
While not required in the two examples provided, should those streams change resolution and continue to use the same type of bytstreams we would miss the changes as the keyframe never contains the new SPS/PPS NALs.

So we add an option to handle this case, so we can separate the cases where this could be needed without regressing bug 1469257

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

--HG--
extra : moz-landing-system : lando
2019-03-27 11:03:23 +00:00
Jean-Yves Avenard
c1838d082f Bug 1538508 - P2. Don't limit search for SPS/PPS on keyframe only. r=bryce
We limited the search for a SPS/PPS change to keyframe only in bug 1469257.
However this causes issues if the first frame containing a SPS/PPS isn't a keyframe.

We also need to error on content with no SPS/PPS as to inform the caller that something is amiss. Such content was invalid to start with.

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

--HG--
extra : moz-landing-system : lando
2019-03-27 11:02:07 +00:00
Andreea Pavel
ef6f8bfbc1 Backed out 3 changesets (bug 1538508) for assertion failure at IPCMessageUtils.h on a CLOSED TREE
Backed out changeset 2fc1fe023957 (bug 1538508)
Backed out changeset ff707483b5d4 (bug 1538508)
Backed out changeset 8a573000a49d (bug 1538508)
2019-03-27 08:32:40 +02:00
Jean-Yves Avenard
a98680f98b Bug 1538508 - P3. Add options to scan all frames for SPS/PPS change. r=bryce
While not required in the two examples provided, should those streams change resolution and continue to use the same type of bytstreams we would miss the changes as the keyframe never contains the new SPS/PPS NALs.

So we add an option to handle this case, so we can separate the cases where this could be needed without regressing bug 1469257

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

--HG--
extra : moz-landing-system : lando
2019-03-27 02:50:08 +00:00
Jean-Yves Avenard
8555e8b380 Bug 1538508 - P2. Don't limit search for SPS/PPS on keyframe only. r=bryce
We limited the search for a SPS/PPS change to keyframe only in bug 1469257.
However this causes issues if the first frame containing a SPS/PPS isn't a keyframe.

We also need to error on content with no SPS/PPS as to inform the caller that something is amiss. Such content was invalid to start with.

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

--HG--
extra : moz-landing-system : lando
2019-03-27 02:47:37 +00:00
Bryce Van Dyk
8def97eeab Bug 1538253 - VPXDecoder::IsCompatible checks subsampling x members for equality. r=jya
We had a stray `&&` where a `==` should have been.

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

--HG--
extra : moz-landing-system : lando
2019-03-25 19:37:39 +00:00
Bryce Van Dyk
64a99b218e Bug 1537675 - Ensure reads in VPXDecoder.cpp happen in correct order. r=jya
Function arguments may not evaluate in order, as such, this ensures width is read
before height from VP9 streams.

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

--HG--
extra : moz-landing-system : lando
2019-03-22 12:24:44 +00:00
Alex Chronopoulos
cbb81ed136 Bug 1536783 - Use two tile threads in dav1d decoder for performance improvement. r=TD-Linux
Differential Revision: https://phabricator.services.mozilla.com/D24331

--HG--
extra : moz-landing-system : lando
2019-03-21 20:37:46 +00:00
Jean-Yves Avenard
2060818e84 Bug 1533252 - P4. Serialize all the video MediaCapabilities queries. r=pehrsons
Differential Revision: https://phabricator.services.mozilla.com/D23653

--HG--
extra : moz-landing-system : lando
2019-03-15 13:54:19 +00:00
Jean-Yves Avenard
7e095aad11 Bug 1533252 - P3. Rename LocalAllocPolicy into SingleAllocPolicy. r=pehrsons
It's more descriptive with what it actually does.

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

--HG--
extra : moz-landing-system : lando
2019-03-15 13:35:53 +00:00
Jean-Yves Avenard
cbf34767dd Bug 1533252 - P2. Make LocalAllocPolicy inherit from AllocPolicy. r=pehrsons
Despite its name and apparent use LocalAllocPolicy could only handle a single call to Alloc() at a time which was okay due to how it was used by the MediaFormatReader.

However, we do want to handle multiple calls to Alloc().

These changes allow to perform simultaneous requests and have them be processed one at a time serially.

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

--HG--
extra : moz-landing-system : lando
2019-03-15 13:35:42 +00:00
Jean-Yves Avenard
bbdbe29869 Bug 1533252 - P1. Extract LocalAllocPolicy from MFR. r=pehrsons
So we can re-use it later.

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

--HG--
extra : moz-landing-system : lando
2019-03-15 13:55:12 +00:00
Jean-Yves Avenard
84716a0281 Bug 1305340 - Enable low-latency decoding on Windows 10 and later. r=pehrsons
Chrome has had it enabled for years, we had disabled it originally due to crashes seen on Windows 7.

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

--HG--
extra : moz-landing-system : lando
2019-03-15 12:26:59 +00:00
Jean-Yves Avenard
c5e1eb15d6 Bug 1521370 - Ensure WMF PDM is always initialized on the right thread. r=mattwoodrow,gerald.
And only do it once.

Depends on D22874

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

--HG--
extra : moz-landing-system : lando
2019-03-13 06:16:52 +00:00
Jean-Yves Avenard
1d2b1aedfe Bug 1521370 - Remove unused method. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D22624

--HG--
extra : moz-landing-system : lando
2019-03-13 01:50:41 +00:00
Jean-Yves Avenard
dfa04f21b3 Bug 1521370 - Add crash guard around VPX decoder creation. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D21477

--HG--
extra : moz-landing-system : lando
2019-03-13 02:36:08 +00:00
Jean-Yves Avenard
3113118c4a Bug 1534893 - Don't attempt to display an invalid TimeUnit. r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D23273

--HG--
extra : moz-landing-system : lando
2019-03-13 06:58:35 +00:00
David Major
56ea434680 Bug 1528074 - Translate MSVC warning flags to clang spelling where supported r=froydnj
clang-cl only acts on five MSVC warning flags: 7219c7e9af/clang/include/clang/Driver/CLCompatOptions.td (L188-L197)

With MSVC now unsupported, most -wdNNNN have no effect and can be removed.

This patch converts the five supported warnings to their clang spellings, as preparation for a subsequent patch that will remove all remaining `[/-]w[edo][0-9]{4}`.

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

--HG--
extra : moz-landing-system : lando
2019-03-11 01:39:42 +00:00
Jean-Yves Avenard
d63e3b0ef0 Bug 1521370 - Always assume we can decode vp8/vp9. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D21478

--HG--
extra : moz-landing-system : lando
2019-03-05 15:01:38 +00:00
Gurzau Raul
cdf9392948 Merge inbound to mozilla-central. a=merge 2019-03-01 15:01:31 +02:00
Gurzau Raul
6b94d177d1 Merge mozilla-central to inbound. a=merge CLOSED TREE 2019-03-01 09:28:28 +02:00
Jean-Yves Avenard
51e5ab32af Bug 1531500 - Fix HE-AAC with WMF decoder. r=cpearce
The rate changes after decoding the first sample to what was indicated in the container. The code to handle that case was incorrectly removed in bug  1530234

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

--HG--
extra : moz-landing-system : lando
2019-03-01 00:54:32 +00:00
Lee Salzman
f5b37f6034 Bug 1530471 - remove SkiaGL Canvas2D functionality r=jrmuizel
Depends on D21050

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

--HG--
extra : moz-landing-system : lando
2019-02-28 14:58:19 +00:00
Jean-Yves Avenard
2acc7de1f6 Bug 1530234 - P2. Don't recalculate audio sample start time. r=bryce
The WMF audio decoder recalculated the timestamp of each audio sample according to the number of frames decoded so far.
This is incompatible with the trimming mechanism that rely on the timestamps of the audio to be matching what is found in the container.

All the other audio decoders do it that way already.

Depends on D20969

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

--HG--
extra : moz-landing-system : lando
2019-02-27 14:19:00 +00:00
Jed Davis
5cc3212784 Bug 1506291 - Move the AV1 decoders to a sandbox-friendly CPU counting wrapper. r=gcp,mjf
Counting CPUs accesses the filesystem (sysfs or procfs), which we'd like
to disallow when sandboxed if possible, and fails silently if access
is denied.  Because the CPU count rarely changes, this patch handles
that problem for the RDD process by caching a copy before starting
sandboxing.

Tested with a local patch to have the sandbox file broker client crash
if accessing the sysfs node for the CPU count, to verify that it's not
accessed.

Depends on D14524

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

--HG--
extra : moz-landing-system : lando
2019-02-25 16:20:50 +00:00
Ryan Hunt
00e98538aa Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D21106

--HG--
extra : rebase_source : ea3f51c2c11247114deccbc86e90fb02b8a97257
2019-02-25 16:05:29 -06:00
Jean-Yves Avenard
4b9d7d9972 Bug 1528652 - Don't use WMF for decoding VP9 with alpha content. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D20957

--HG--
extra : moz-landing-system : lando
2019-02-25 01:17:31 +00:00
Jean-Yves Avenard
850a9d6aa7 Bug 1524890 - P17. Set duration on IMF sample. r=bryce
We didn't set the duration on the created IMF sample before sending it to the decoder.
For audio this isn't a problem as the duration is calculated from the number of frames returned.
For video however, the duration appears to have been calculated by WMF as the delta of pts. However, for the last frame, the value returned was set to a value not matching our input.

So we set the duration on the IMFSample so it doesn't have to make it up.

Setting the duration on the IMFSample isn't sufficient with Windows 7, which still continues to calculate it based on previous samples durations.
So we store the last sample duration and set it when draining.

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

--HG--
extra : moz-landing-system : lando
2019-02-23 09:28:14 +00:00
Jean-Yves Avenard
4a6552a7d5 Bug 1524890 - P14. Add AudioTrimmer wrapper. r=bryce
A simplistic decoder wrapper that will take decoded frames and truncate them should the originally compressed frame contained trimming information.

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

--HG--
extra : moz-landing-system : lando
2019-02-24 10:29:52 +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
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
Jean-Yves Avenard
3cf8c6d0df Bug 1524890 - P7. No longer access AudioData::mFrames directly. r=bryce
This will allow to remove mFrames member and calculate from the size of the content, which will dynamically change depending on a cropping filter.

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

--HG--
extra : moz-landing-system : lando
2019-02-22 09:18:47 +00:00
David Major
33bacb9783 Bug 1528074 - Clean up some media warning flags r=jya
I suspect these may have been cargo-culted from elsewhere.

We only need -Wno-sign-compare, which we can add regardless of compiler because clang-cl understands it natively in addition to the -wdNNNN form.

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

--HG--
extra : moz-landing-system : lando
2019-02-22 17:22:12 +00:00
Sylvestre Ledru
e0c61dafa5 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
Summary: # ignore-this-changeset

Reviewers: Ehsan

Reviewed By: Ehsan

Subscribers: emilio, jandem, bbouvier, jya

Bug #: 1519636

Differential Revision: https://phabricator.services.mozilla.com/D20062
2019-02-16 20:20:37 +01:00
Michael Froman
9599965900 Bug 1500596 - pt3 - Add remote audio decoding for Vorbis. r=jya
- Use a single remote decoder IPDL spec and make a remote decoding
  base class.
Renames PRemoteVideoDecoder.ipdl to PRemoteDecoder.ipdl
Renames RemoteVideoDecoder{Child|Parent}.{cpp|h} to
        RemoteDecoder{Child|Parent}.{cpp|h}

- Move remote video decoding to new subclasses.
Creates RemoteVideoDecoder.{cpp|h} that contains both the parent
and child sides of the RemoteVideoDecoder{Child|Parent} classes.

- Create new remote audio decoder
Creates RemoteAudioDecoder.{cpp|h} that contains both the parent
and child sides of the RemoteAudioDecoder{Child|Parent} classes.

- Connect all the plumbing to use the new remote audio decoder to
  decode Vorbis in RDD including a new pref to control whether
  Vorbis is decoding in the AgnosticDecoderModule or the
  RemoteDecoderModule/RDD (media.rdd-vorbis.enabled).

Depends on D18640

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

--HG--
rename : dom/media/ipc/PRemoteVideoDecoder.ipdl => dom/media/ipc/PRemoteDecoder.ipdl
rename : dom/media/ipc/RemoteVideoDecoderChild.cpp => dom/media/ipc/RemoteDecoderChild.cpp
rename : dom/media/ipc/RemoteVideoDecoderChild.h => dom/media/ipc/RemoteDecoderChild.h
rename : dom/media/ipc/RemoteVideoDecoderParent.cpp => dom/media/ipc/RemoteDecoderParent.cpp
rename : dom/media/ipc/RemoteVideoDecoderParent.h => dom/media/ipc/RemoteDecoderParent.h
extra : moz-landing-system : lando
2019-02-14 19:08:21 +00:00
Mike Hommey
ef3ad686ee Bug 1512504 - Remove support for MSVC. r=froydnj
Consequently, this removes:
- MOZ_LIBPRIO, which is now always enabled.
- non_msvc_compiler, which is now always true.
- The cl.py wrapper, since it's not used anymore.
- CL_INCLUDES_PREFIX, which was only used for the cl.py wrapper.
- NONASCII, which was only there to ensure CL_INCLUDES_PREFIX still
  worked in non-ASCII cases.

This however keeps a large part of detecting and configuring for MSVC,
because we still do need it for at least headers, libraries, and midl.

Depends on D19614

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

--HG--
extra : moz-landing-system : lando
2019-02-14 21:45:27 +00:00
Jean-Yves Avenard
ef00c51648 Bug 1525230 - Reset ImageRect when resolution change. r=bryce
VideoInfo.mImageRect is typically only used for VP8/VP9 content, however the Windows decoder use a common code between H264 and VP8/VP9 decoding and use this data to determine the image size. So we end up with conflicting image size and image rect (which contains cropping data).

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

--HG--
extra : moz-landing-system : lando
2019-02-07 14:56:44 +00:00
Andrew McCreight
0f605627fd Bug 1523013 - Clear SamplesWaitingForKey::mProxy in Shutdown(). r=cpearce
There's a strong cycle of references between SamplesWaitingForKey and
CDMProxy that does not get cleared unless keys actually come in. This
causes a leak. One way to avoid that leak is to clear the proxy
reference when the things holding the SamplesWaitingForKey is shut
down.

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

--HG--
extra : moz-landing-system : lando
2019-01-30 22:56:21 +00:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
John Lin
7821b39a44 Bug 1482452 - p2: validate object before sending to Java runtime. r=snorp
Depends on D16707

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

--HG--
extra : moz-landing-system : lando
2019-01-16 16:31:19 +00:00
John Lin
72322eaae4 Bug 1508434 - p4: release audio output buffers after processing on task queue. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D15985

--HG--
extra : moz-landing-system : lando
2019-01-11 17:08:11 +00:00
John Lin
31377925fe Bug 1508434 - p3: assert members are only accessed on task queue. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D15740

--HG--
extra : moz-landing-system : lando
2019-01-11 17:08:03 +00:00
John Lin
d6ebba5265 Bug 1508434 - p2: move codec output processing to task queue. r=jya
Processing MediaCodec output in Android binder threads while flushing
in task queue could cause race condition and leftover frames. Dispatch
the processing to task queue ensures all frames prior to flushing will
be cleared (by mDecodedData.Clear()) or ignored (by mInputInfos.Clear()).

Also consolidate all flushing operations in one task to avoid frame
insertion between emptying mDecodedData and mInputInfos.

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

--HG--
extra : moz-landing-system : lando
2019-01-11 17:08:00 +00:00
John Lin
2a6faa6bf8 Bug 1508434 - p1: Support explicitly resetting seek threshold. r=jya
Usually the threshold is reset internally in MediaDataDecoder subclasses
that support the hint in their Flush() implementations so the value
will start fresh after seeking completed. But sometimes when there are
consecutive seek requests, MediaFormatReader::DecoderData::Flush() could
return early because DecoderData::mFlushed stays true when there is no
sample demuxed yet, and the threshold will not be cleared. Also, in
MediaFormatReader::SetVideoDecodeThreshold() we decide not to set the
hint when the seek target is close to EOS by checking the existence of
the next keyframe, and that could fail when there are gaps between MSE
buffered ranges. To make sure the hint is never out of date, we should
clear it rather than leaving it untouched.

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

--HG--
extra : moz-landing-system : lando
2019-01-11 17:07:49 +00:00
Bryce Van Dyk
fa9d86fda5 Bug 1487416 - Replace mValid and mMode with mCryptoScheme for track and sample crypto structs. r=jya
Explicitly store the crypto scheme being used on our crypto structs to let us
differentiate between cenc and cbcs data. In doing so remove mMode and replace
mValid with IsEncrypted() for the following reasons:
- Different modes within the existing schemes are not currently utilized by the
  spec: the scheme implies mode. Having a mode and a scheme could lead to confusion
  between the two. We can return mMode if ever needed by the spec --
  possibly if the isProtected flag which we were tracking with mMode, is
  ever changed to be more than a bool in the spec.
- mValid was typically used to check if these structs contained valid crypto
  data or not. With only one scheme this was often shorthand for 'IsEncrypted',
  but with multiple schemes what is considered valid data for one may not be for
  another. Do away with this and just explicitly have an 'IsEncrypted'.

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

--HG--
extra : moz-landing-system : lando
2019-01-11 15:29:45 +00:00
Cosmin Sabou
15939f75f2 Backed out 6 changesets (bug 1487416) for causing Android build bustages on RemoteDataDecoder.cpp. CLOSED TREE
Backed out changeset 05bcc598e9fb (bug 1487416)
Backed out changeset b99936efbbc9 (bug 1487416)
Backed out changeset ee55b284223e (bug 1487416)
Backed out changeset d25449127f8f (bug 1487416)
Backed out changeset f7c201b7f9bc (bug 1487416)
Backed out changeset 233aedc8b42e (bug 1487416)
2019-01-10 23:37:20 +02:00
Bryce Van Dyk
1a3a965df3 Bug 1487416 - Replace mValid and mMode with mCryptoScheme for track and sample crypto structs. r=jya
Explicitly store the crypto scheme being used on our crypto structs to let us
differentiate between cenc and cbcs data. In doing so remove mMode and replace
mValid with IsEncrypted() for the following reasons:
- Different modes within the existing schemes are not currently utilized by the
  spec of implementation. Having a mode and a scheme could lead to confusion
  between the two. We can return mMode if ever needed by the spec.
- mValid was typically used to check if these structs contained valid crypto
  data or not. With only one scheme this was often shorthand for 'IsEncrypted',
  but with multiple schemes what is considered valid data for one may not be for
  another. Do away with this and just explicitly have an 'IsEncrypted'.

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

--HG--
extra : moz-landing-system : lando
2019-01-10 18:37:48 +00:00
Brindusan Cristian
e4a445730d Backed out 4 changesets (bug 1508434) for mda failures on test_waveShaperPassThrough.html. CLOSED TREE
Backed out changeset 1851290ec29b (bug 1508434)
Backed out changeset 12424313d637 (bug 1508434)
Backed out changeset 8fbed3243217 (bug 1508434)
Backed out changeset 25b67aa0ef55 (bug 1508434)
2019-01-09 21:00:35 +02:00
John Lin
9101933771 Bug 1508434 - p4: release audio output buffers after processing on task queue. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D15985

--HG--
extra : moz-landing-system : lando
2019-01-09 17:40:45 +00:00
John Lin
b61754a7c8 Bug 1508434 - p3: assert members are only accessed on task queue. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D15740

--HG--
extra : moz-landing-system : lando
2019-01-09 17:40:53 +00:00
John Lin
4003a972dc Bug 1508434 - p2: move codec output processing to task queue. r=jya
Processing MediaCodec output in Android binder threads while flushing
in task queue could cause race condition and leftover frames. Dispatch
the processing to task queue ensures all frames prior to flushing will
be cleared (by mDecodedData.Clear()) or ignored (by mInputInfos.Clear()).

Also consolidate all flushing operations in one task to avoid frame
insertion between emptying mDecodedData and mInputInfos.

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

--HG--
extra : moz-landing-system : lando
2019-01-08 20:57:47 +00:00
John Lin
3ef17ab0cb Bug 1508434 - p1: Support explicitly resetting seek threshold. r=jya
Usually the threshold is reset internally in MediaDataDecoder subclasses
that support the hint in their Flush() implementations so the value
will start fresh after seeking completed. But sometimes when there are
consecutive seek requests, MediaFormatReader::DecoderData::Flush() could
return early because DecoderData::mFlushed stays true when there is no
sample demuxed yet, and the threshold will not be cleared. Also, in
MediaFormatReader::SetVideoDecodeThreshold() we decide not to set the
hint when the seek target is close to EOS by checking the existence of
the next keyframe, and that could fail when there are gaps between MSE
buffered ranges. To make sure the hint is never out of date, we should
clear it rather than leaving it untouched.

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

--HG--
extra : moz-landing-system : lando
2019-01-08 20:57:34 +00:00
Jean-Yves Avenard
0855e7a7da Bug 1513511 - P1. Use new FFmpeg decode API with recent FFmpeg version. r=bryce
In libavcodec 58 and later, the old avcodec_decode_video2 is broken and only return the first visible frame found after a VP9 super-frame.

This resulted in some YouTube videos for about 10% of the frames to never be returned.

Only the new API properly behaves so we upgrade our code to use it.

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

--HG--
extra : moz-landing-system : lando
2018-12-17 17:29:13 +00:00
Jean-Yves Avenard
ed5b2cd92a Bug 1513227 - P2. Remove unused files. r=jolin
Depends on D14158

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

--HG--
extra : moz-landing-system : lando
2018-12-11 17:38:53 +00:00
Jean-Yves Avenard
7f7e06e3f1 Bug 1513227 - P1. Use correct constant to determine if HW decoding is enabled. r=jolin
Differential Revision: https://phabricator.services.mozilla.com/D14158

--HG--
extra : moz-landing-system : lando
2018-12-11 17:37:47 +00:00
John Lin
eb4a57903b Bug 1510424 - fix AAC and FLAC EME support configuration. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D13135

--HG--
extra : moz-landing-system : lando
2018-12-07 14:40:50 +00:00
Jean-Yves Avenard
44594dd77a Bug 1510265 - P1. Enforce template-parameter classes restrictions in MozPromise. r=gerald
And some required fixes to make things compile.

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

--HG--
extra : moz-landing-system : lando
2018-12-06 16:26:01 +00:00
Alex Chronopoulos
e1c6dec154 Bug 1509327 - Use timing and color information from decoded picture in dav1d wrapper. r=jya
Latest dav1d version supports to store the timing information in undecoded frame and restore it later from decoded picture. This can provide more accurate timing especially during drain. In additionto that, colorspace information is set according to the size of the image. Finally this patch addresses some style comments.

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

--HG--
extra : moz-landing-system : lando
2018-12-01 22:03:29 +00:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Andreea Pavel
8e973f56b2 Backed out 3 changesets (bug 1509327) for build bustages on a CLOSED TREE
Backed out changeset aeb00b8974a4 (bug 1509327)
Backed out changeset ea27440a2126 (bug 1509327)
Backed out changeset 9881fd46fde2 (bug 1509327)
2018-11-30 05:16:08 +02:00
Alex Chronopoulos
74a439c923 Bug 1509327 - Use timing and color information from decoded picture in dav1d wrapper. r=jya
Latest dav1d version supports to store the timing information in undecoded frame and restore it later from decoded picture. This can provide more accurate timing especially during drain. In additionto that, colorspace information is set according to the size of the image. Finally this patch addresses some style comments.

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

--HG--
extra : moz-landing-system : lando
2018-11-29 19:08:03 +00:00
Gabriele Svelto
19e52bebd4 Bug 1510582 - Remove useless inclusions of Services.h r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D13240

--HG--
extra : moz-landing-system : lando
2018-11-28 17:25:23 +00:00
Coroiu Cristina
47323ec73b Merge mozilla-central to autoland a=merge on a CLOSED TREE 2018-11-28 23:56:03 +02:00
Brindusan Cristian
eb07b312bf Backed out 3 changesets (bug 1486659) as requested by jhlin on irc for breaking video playback on Android and causing regression Bug 1510464. a=backout
Backed out changeset 9c2834ca8823 (bug 1486659)
Backed out changeset 5d897c0c7a25 (bug 1486659)
Backed out changeset b0fdcebfd20d (bug 1486659)
2018-11-28 19:09:13 +02:00
John Lin
739da292b4 Bug 1510363 - backout accidentally checked in file. r=jya
And add patterns to .gitignore to prevent future occurence.

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

--HG--
extra : moz-landing-system : lando
2018-11-28 17:50:32 +00:00
Alex Chronopoulos
5dab77d453 Bug 1493400 - Implement platform decoder for dav1d. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D12164

--HG--
extra : moz-landing-system : lando
2018-11-27 14:18:58 +00:00
John Lin
e43dca7804 Bug 1486659 - p3: copy texture contents for remote allocated Surface. r=snorp
Child processes cannot access textures allocated in the parent process,
which is needed by the compositor to render video elements efficiently.
Unfortunately, Android doesn't expose Sufrace buffers (sharable across
processes) in the SDK/NDK as other platforms, so we need to generate
extra texture/surface in the child process and update texture images
through the surface, which is passed to the parent process for the remote
texture to copy its contents into.

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

--HG--
rename : mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/gfx/ISurfaceAllocator.aidl => mobile/android/geckoview/src/main/aidl/org/mozilla/gecko/gfx/SyncConfig.aidl
extra : moz-landing-system : lando
2018-11-26 19:41:31 +00:00
John Lin
bfb5ef4f39 Bug 1425277 - p7: add apple encoder module and factory. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D7563

--HG--
extra : moz-landing-system : lando
2018-11-26 18:29:08 +00:00
John Lin
c81fdae426 Bug 1425277 - p6: implement media encoder using Apple VideoToolbox API. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D7562

--HG--
extra : moz-landing-system : lando
2018-11-26 18:30:08 +00:00
John Lin
b7271f6956 Bug 1425277 - p4: RAII for CVBuffer. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D7560

--HG--
extra : moz-landing-system : lando
2018-11-26 18:28:13 +00:00
John Lin
b3b4fa64cc Bug 1425277 - p3: fix misplaced dependent header. r=jya To address compile error when AppleVTDeocder.cpp is moved to another unified source file or in non-unified builds.
Differential Revision: https://phabricator.services.mozilla.com/D7559

--HG--
extra : moz-landing-system : lando
2018-11-26 18:27:49 +00:00
John Lin
0ea8bb4a7a Bug 1425277 - p2: remove dynamic apple framework linkers. r=jya No need for own linkers anymore for CoreMedia and VideoToolbox are both available on our minimal supported version (10.9).
Differential Revision: https://phabricator.services.mozilla.com/D7558

--HG--
extra : moz-landing-system : lando
2018-11-26 18:27:32 +00:00
John Lin
25c2e37423 Bug 1425277 - p1: introduce media encoder interfaces. r=jya
Differential Revision: https://phabricator.services.mozilla.com/D7557

--HG--
extra : moz-landing-system : lando
2018-11-26 18:27:14 +00:00
Jean-Yves Avenard
b07c3f66ba Bug 1505284 - P3. Ensure gfxVars and gfxPrefs are always initialized when using PDMFactory. r=gerald
While typically those will always be, when using through gtest it won't.

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

--HG--
extra : moz-landing-system : lando
2018-11-22 16:31:03 +00:00
Jean-Yves Avenard
deafacba67 Bug 1505284 - P1. Use ffmpeg decoder for h264 in low latency mode. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D12431

--HG--
extra : moz-landing-system : lando
2018-11-22 16:30:06 +00:00
Karl Tomlinson
cbf2ec1e66 Bug 1508909 revert reformat of third-party ffmpeg headers r=jya
Changes to these files from 0ceae9db9ec0 are reverted.

# skip-blame

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

--HG--
extra : moz-landing-system : lando
2018-11-21 08:25:05 +00:00
Narcis Beleuzu
8b9e60f605 Backed out 2 changesets (bug 1505284) for GTest crashes on [@ mozilla::AppleDecoderModule::Init()] . CLOSED TREE
Backed out changeset 1d3eb26cfeac (bug 1505284)
Backed out changeset 05fd55926206 (bug 1505284)
2018-11-20 21:13:48 +02:00
Jean-Yves Avenard
4577072e13 Bug 1505284 - P1. Use ffmpeg decoder for h264 in low latency mode. r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D12431

--HG--
extra : moz-landing-system : lando
2018-11-20 17:44:03 +00:00
Sylvestre Ledru
804b8b8883 Bug 1204606 - Reformat of dom/media r=jya
# skip-blame

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

--HG--
extra : moz-landing-system : lando
2018-11-19 13:25:37 +00:00
Michael Froman
2e78f7f1a1 Bug 1471535 - pt12 - Hook up RDD process and Remote decoding. r=jya,spohl
Depends on D8493

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

--HG--
extra : moz-landing-system : lando
2018-11-14 18:07:28 +00:00
Michael Froman
4e520483b8 Bug 1471535 - pt7 - Add remote decoding in dom/media/ipc alongside gpu decoding. r=jya,mattwoodrow,jld
Depends on D8488

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

--HG--
extra : moz-landing-system : lando
2018-11-14 18:06:11 +00:00
Michael Froman
3e6ce9501a Bug 1471535 - pt2 - Fix lurking OSX and Win build issues prepping for RDD work. r=jya
Due to changes in where things end up in the unified builds.

Depends on D8482

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

--HG--
extra : moz-landing-system : lando
2018-11-14 18:05:00 +00:00
Jean-Yves Avenard
75d4655f72 Bug 1482059 - P2. Use new VPx frame parser to detect content change. r=padenot
We also set the TrackInfoSharedPtr to each decoded sample so that on decoder that can be recycled (android) the frames are displayed with the right size.

Depends on D11588

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

--HG--
extra : moz-landing-system : lando
2018-11-14 14:40:26 +00:00
Jean-Yves Avenard
06a5c6246d Bug 1482059 - P1. Implement VP8/VP9 frame header parser. r=TD-Linux
And use it to determine if a frame is a keyframe, its size and display size.

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

--HG--
extra : moz-landing-system : lando
2018-11-14 09:33:10 +00:00
Michael Froman
a2091796e4 Bug 1471535 - pt1 - Split RemoteVideoDecoder into GpuDecoderModule and RemoteMediaDataDecoder preparing for new RDD decoder work. r=jya
- also makes RemoteMediaDecoder generic so it can work with the remote decoders on the RDD process
- changes VideoDecoderChild to subclass IRemoteDecoderChild

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

--HG--
rename : dom/media/ipc/RemoteVideoDecoder.cpp => dom/media/ipc/GpuDecoderModule.cpp
rename : dom/media/ipc/RemoteVideoDecoder.h => dom/media/ipc/GpuDecoderModule.h
extra : moz-landing-system : lando
2018-11-14 02:45:39 +00:00
Bogdan Tara
fc8134a16a Backed out 12 changesets (bug 1471535) for VideoDecoderChild failures CLOSED TREE
Backed out changeset 3d8a11458d79 (bug 1471535)
Backed out changeset 2176010bc1fe (bug 1471535)
Backed out changeset dfb4d3462b22 (bug 1471535)
Backed out changeset ea6b73ded74d (bug 1471535)
Backed out changeset 404d760a9e82 (bug 1471535)
Backed out changeset 28ae4b6fab68 (bug 1471535)
Backed out changeset af91e1f04c2d (bug 1471535)
Backed out changeset d39fef4334b3 (bug 1471535)
Backed out changeset a038821cd8ae (bug 1471535)
Backed out changeset 5dcc74a938c6 (bug 1471535)
Backed out changeset 53aff7e699b4 (bug 1471535)
Backed out changeset f3f6abc052f0 (bug 1471535)

--HG--
rename : dom/media/ipc/GpuDecoderModule.cpp => dom/media/ipc/RemoteVideoDecoder.cpp
rename : dom/media/ipc/GpuDecoderModule.h => dom/media/ipc/RemoteVideoDecoder.h
2018-11-13 23:31:56 +02:00
Michael Froman
563ff5b11d Bug 1471535 - pt12 - Hook up RDD process and Remote decoding. r=jya,spohl
Depends on D8493

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

--HG--
extra : moz-landing-system : lando
2018-11-13 17:36:47 +00:00
Michael Froman
9643048b75 Bug 1471535 - pt7 - Add remote decoding in dom/media/ipc alongside gpu decoding. r=jya,mattwoodrow,jld
Depends on D8488

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

--HG--
extra : moz-landing-system : lando
2018-11-13 17:35:31 +00:00
Michael Froman
a437587fde Bug 1471535 - pt2 - Fix lurking OSX and Win build issues prepping for RDD work. r=jya
Due to changes in where things end up in the unified builds.

Depends on D8482

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

--HG--
extra : moz-landing-system : lando
2018-11-13 17:34:23 +00:00
Michael Froman
97b1784063 Bug 1471535 - pt1 - Split RemoteVideoDecoder into GpuDecoderModule and RemoteMediaDataDecoder preparing for new RDD decoder work. r=jya
- also makes RemoteMediaDecoder generic so it can work with the remote decoders on the RDD process
- changes VideoDecoderChild to subclass IRemoteDecoderChild

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

--HG--
rename : dom/media/ipc/RemoteVideoDecoder.cpp => dom/media/ipc/GpuDecoderModule.cpp
rename : dom/media/ipc/RemoteVideoDecoder.h => dom/media/ipc/GpuDecoderModule.h
extra : moz-landing-system : lando
2018-11-13 17:34:10 +00:00
Jean-Yves Avenard
6ba9a04554 Bug 1505910 - P2. Remove use of AsTaskQueue(). r=cpearce
Make IsCurrentThreadIn() const.

Depends on D11491

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

--HG--
extra : moz-landing-system : lando
2018-11-12 01:09:03 +00:00
Jean-Yves Avenard
afa48c6843 Bug 1505882 - P5. Always ensure to use latest SPS/PPS when converting sample. r=bryce
ConvertSampleToAnnexB takes the sample's out of band extradata to prepend it to the data. It was theorically possible that the first sample would contain the SPS/PPS from the previous format.

Depends on D11559

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

--HG--
extra : moz-landing-system : lando
2018-11-11 11:42:32 +00:00
Jean-Yves Avenard
dbe872db75 Bug 1505882 - P4. Fix style. r=bryce
Depends on D11558

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

--HG--
extra : moz-landing-system : lando
2018-11-11 11:42:30 +00:00
Jean-Yves Avenard
064bca85b8 Bug 1505882 - P3. Don't check the sample's out of band extradata until after decoding the first frame. r=bryce
Depends on D11557

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

--HG--
extra : moz-landing-system : lando
2018-11-11 18:15:14 +00:00
Jean-Yves Avenard
fdcfc18a6a Bug 1505882 - P2. Assert that sample conversion required is either AVCC or AnnexB. r=bryce
This will avoid future bugs like bug 1506076.

Depends on D11556

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

--HG--
extra : moz-landing-system : lando
2018-11-11 11:42:20 +00:00
Jean-Yves Avenard
0ba7f50c49 Bug 1505882 - P1. Don't track keyframe in CodecChangeMonitor. r=bryce
keyframe was tracked in the CodecChangeMonitor in order to determine when to prepend the SPS/PPS to a sample for decoder using AnnexB format.
The assumption was that it was needed only once per the lifetime of the decoder (and indeed this is true with the Windows and Android decoder). However this causes issue with the Widevine H264 decoder and it will error on some content if the first sample passed following a flush doesn't contain a SPS/PPS.

Interestingly, this issue isn't observed with Netflix content or other Widevine sample videos. Only Amazon PrimeVideo content so far.

We instead use the global MediaChangeMonitor keyframe status that knows when the decoder has been drained or flushed.

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

--HG--
extra : moz-landing-system : lando
2018-11-11 11:42:18 +00:00
Jean-Yves Avenard
1156cc49c3 Bug 1506076 - Mark video android decoder as needing AnnexB. r=jolin,alwu
It only used to work as the H264Converter used to check that the conversion needed was != kNeedAVCC (the default being kNone)

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

--HG--
extra : moz-landing-system : lando
2018-11-09 22:07:40 +00:00
Jean-Yves Avenard
31ed9de297 Bug 1504643 - Enforce template-parameter classes restrictions in MozPromise. r=gerald
Make thorough use of move semantic for MozPromise using nsTArray

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

--HG--
extra : moz-landing-system : lando
2018-11-09 15:45:31 +00:00
Dorel Luca
a3894a4dcf Backed out 3 changesets (bug 1471535) for Mochitest failures in build/src/dom/media/ipc/VideoDecoderChild.cpp. a=backout
Backed out changeset 27c9f657bf3d (bug 1471535)
Backed out changeset 4a1366419883 (bug 1471535)
Backed out changeset 94fed1a4a43b (bug 1471535)

--HG--
rename : dom/media/ipc/GpuDecoderModule.cpp => dom/media/ipc/RemoteVideoDecoder.cpp
rename : dom/media/ipc/GpuDecoderModule.h => dom/media/ipc/RemoteVideoDecoder.h
2018-11-09 11:52:06 +02:00
Michael Froman
b801ff16e0 Bug 1471535 - pt2 - Fix lurking OSX and Win build issues prepping for RDD work. r=jya
Due to changes in where things end up in the unified builds.

Depends on D8482

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

--HG--
extra : moz-landing-system : lando
2018-11-08 03:46:07 +00:00
Michael Froman
25ac4aee06 Bug 1471535 - pt1 - Split RemoteVideoDecoder into GpuDecoderModule and RemoteMediaDataDecoder preparing for new RDD decoder work. r=jya
- also makes RemoteMediaDecoder generic so it can work with the remote decoders on the RDD process
- changes VideoDecoderChild to subclass IRemoteDecoderChild

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

--HG--
rename : dom/media/ipc/RemoteVideoDecoder.cpp => dom/media/ipc/GpuDecoderModule.cpp
rename : dom/media/ipc/RemoteVideoDecoder.h => dom/media/ipc/GpuDecoderModule.h
extra : moz-landing-system : lando
2018-11-08 03:45:54 +00:00
Jean-Yves Avenard
bb55747b9e Bug 1497951 - P7. Check for in-band profile VP9 change, r=bryce
Because why not...

Depends on D10913

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

--HG--
extra : moz-landing-system : lando
2018-11-07 13:50:15 +00:00
Jean-Yves Avenard
a941db77be Bug 1497951 - P5. Add VPXChangeMonitor and detect VPx inband resolution change. r=bryce
Depends on D10911

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

--HG--
extra : moz-landing-system : lando
2018-11-07 13:49:30 +00:00
Jean-Yves Avenard
e442b63ac4 Bug 1497951 - P4. Rework and simplify code flow. r=bryce
Depends on D10909

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

--HG--
extra : moz-landing-system : lando
2018-11-07 13:49:13 +00:00
Jean-Yves Avenard
be403b6fa4 Bug 1497951 - P3. Improve out of band SPS change detection. r=bryce
This ensures that the test always work whenever the sample contains an extradata that is different to the info specified in the VideoInfo.

Depends on D10908

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

--HG--
extra : moz-landing-system : lando
2018-11-07 13:49:03 +00:00
Jean-Yves Avenard
6b92b6d234 Bug 1497951 - P2. Always ensure the provided VideoConfig exactly match the content. r=bryce
For AVC1 content (where the SPS/PPS is provided out of band), we would use VideoInfo has found in the container's metadata which may not always be correct.
Likely the reason on why we had bug 1498788 (decoded sample size didn't match the video config's dimensions)

We also always set the MediaRawData::mTrackInfo member for all samples, not just the first one as it's the right thing to do.

Depends on D10907

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

--HG--
extra : moz-landing-system : lando
2018-11-07 13:48:51 +00:00
Jean-Yves Avenard
374ac7ce16 Bug 1497951 - P1. Abstract H264Converter. r=bryce
So that we can later expand and use it for other codecs.

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

--HG--
rename : dom/media/platforms/wrappers/H264Converter.cpp => dom/media/platforms/wrappers/MediaChangeMonitor.cpp
rename : dom/media/platforms/wrappers/H264Converter.h => dom/media/platforms/wrappers/MediaChangeMonitor.h
extra : moz-landing-system : lando
2018-11-07 13:48:44 +00:00
Jean-Yves Avenard
ff9dbafc2c Bug 1504944 - Only re-order channels for opus mapping 1. r=padenot
For channel mapping 0 (which is always mono or sterero), the mapping is identical to the SMPTE one, so can copy the mapping as-is.

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

--HG--
extra : moz-landing-system : lando
2018-11-06 18:11:41 +00:00
Takuro Ashie
ede3fb1356 Bug 1502786 - Break cycle between PureOmxPlatformLayer and OmxDataDecoder r=jya
OmxDataDecoder, OmxPromiseLayer and PureOmxPlatformLayer consist
circular reference by RefPtr, and no one sever the reference. As a
result their refcount never decrease to 0.
This commit sever it at PureOmxPlatformLayer::Shutdown() which is
called by OmxDataDecoder.

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

--HG--
extra : moz-landing-system : lando
2018-11-06 02:56:36 +00:00
Jean-Yves Avenard
8ef35e13b5 Bug 1498788 - Adjust width and height so they are never bigger than source or destination. r=mattwoodrow
Why we would need this is unclear however. the destination texture should always be smaller than what comes out of the decoder.

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

--HG--
extra : moz-landing-system : lando
2018-10-14 19:01:01 +00:00
Sylvestre Ledru
dd5741407b Bug 1498586 - Add clang-format off to avoid the reformatting of the data structures r=Ehsan
Too hard/impossible for the tool to format correctly these structs

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

--HG--
extra : moz-landing-system : lando
2018-10-12 20:48:24 +00:00
Jean-Yves Avenard
c084a873d7 Bug 1497294 - P5. Clip source to destination size when copying the D3D11 texture. r=mattwoodrow
The Windows' hardware decoder always return an image whose dimensions are multiple of 16 pixels. As such, the image coming out of the decoder is typically bigger than the wanted image.

The D3D11 documentation states that " If you try and copy outside the destination resource or specify a source box that is larger than the source resource, the behavior of CopySubresourceRegion is undefined."

We've always copied from a bigger texture into a smaller one without specifying clipping. It seems to have always worked but falls into the undefined behaviour category.

So to be extra safe, we clip the source so that it matches the dimension of the destination texture.

Depends on D8129

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

--HG--
extra : moz-landing-system : lando
2018-10-11 01:43:29 +00:00
Jean-Yves Avenard
0fcc0bd516 Bug 1496529 - P10. Add to libvpx decoder low latency mode. r=bryce
Depends on D7909

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

--HG--
extra : moz-landing-system : lando
2018-10-09 22:59:47 +00:00
Jean-Yves Avenard
a6e92bb58d Bug 1496529 - P9. Enable low latency decoding on Windows. r=bryce
Depends on D7908

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

--HG--
extra : moz-landing-system : lando
2018-10-09 16:59:32 +00:00
Jean-Yves Avenard
2349b2eb93 Bug 1496529 - P7. Pass full range of CreateDecoderParam::Option to RemoteVideoDecoder r=bryce
Depends on D7882

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

--HG--
extra : moz-landing-system : lando
2018-10-09 16:59:24 +00:00
Jean-Yves Avenard
38ff84370c Bug 1496529 - P6. Always run EMEDecryptor on the decoder's taskqueue. r=bryce
P2 changed the way the H264Converter would be calling the decoder. The assumption in the EMEDecryptor was pretty incorrect to start with.

Depends on D7865

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

--HG--
extra : moz-landing-system : lando
2018-10-09 22:58:05 +00:00
Jean-Yves Avenard
e9c79b802d Bug 1496529 - P3. Make the Apple H264 decoder provide 0 latency option. r=bryce
When used with the LowLatency option, we guarantee that the stream will contain no B-frame, as such we can reduce the re-ordering queue to zero. The apple VT decoder already returns frames in decode order making this change trivial.

Depends on D7861

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

--HG--
extra : moz-landing-system : lando
2018-10-09 16:59:05 +00:00
Jean-Yves Avenard
523200b148 Bug 1496529 - P2. Make H264Converter use provided decoder's TaskQueue. r=bryce
The H264Converter can be used on a thread that isn't a nsThread or a TaskQueue, so having the H264Converter dispatching tasks isn't going to work

So instead we run all the code on the decoder's taskqueue using promise chaining.
All internal methods are made to assert that they are running on the task queue accordingly

Depends on D7860

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

--HG--
extra : moz-landing-system : lando
2018-10-09 23:05:40 +00:00
Jean-Yves Avenard
3a0d9bef61 Bug 1495025 - P6. Remove now unused paramater. r=bryce
Depends on D7316

Differential Revision: https://phabricator.services.mozilla.com/D7491
2018-10-08 15:52:01 +02:00
Jean-Yves Avenard
34eeec152b Bug 1495025 - P5. Add Windows P010 and P016 support for software decoder r=cpearce
As we do not have an IMF nor D3D11 NV12 image, we always require a full copy of the data that will deinterleave the chroma channels.

Depends on D7316

Differential Revision: https://phabricator.services.mozilla.com/D7318
2018-10-08 15:52:01 +02:00
Jean-Yves Avenard
e0e52e125f Bug 1495025 - P3. Store original IMFMediaType's subtype in D3D11SharedHandleImage. r=cpearce
This allows more easily the creation of the MFT required to convert to a RGBA32 image when doing a readback.

Depends on D7295

Differential Revision: https://phabricator.services.mozilla.com/D7296
2018-10-08 15:52:00 +02:00