Commit Graph

480 Commits

Author SHA1 Message Date
Kaku Kuo
5286ffa8da Bug 1284350. Reland on top of backouts "Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald" r=kaku
Instead of "not visible", "approximately visible", and "visible" (in display port) we now have "approximately not visible", and "approximately visible" which includes "visible".
2016-08-30 14:53:04 +08:00
Kaku Kuo
cca4120327 Bug 1284350. Reland on top of backouts "Bug 1282710 - Part 1 - implement the suspend and resume logics in HTMLMediaElement.cpp according to visibility events; r=cpearce r=kamidphish" r=kaku
Instead of "not visible", "approximately visible", and "visible" (in display port) we now have "approximately not visible", and "approximately visible" which includes "visible".
2016-07-04 13:26:40 +08:00
Timothy Nikkel
4a590050bf Bug 1284350. Backed out changeset 1bbb1ab928c7 (Bug 1282710 - Part 1 - implement the suspend and resume logics in HTMLMediaElement.cpp according to visibility events; r=cpearce r=kamidphish) 2016-09-12 00:19:06 -05:00
Timothy Nikkel
e7b23cbf0f Bug 1284350. Backed out changeset 06bf533a2bdd (Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald) 2016-09-08 18:07:36 -05:00
Wes Kocher
5cbc382303 Merge inbound to m-c a=merge 2016-09-07 17:54:24 -07:00
Andreas Pehrson
c166a2bf07 Bug 1300529 - Remove default arguments from HTMLMediaElement::CaptureStreamInternal. r=padenot
MozReview-Commit-ID: IL7odCBP74

--HG--
extra : rebase_source : 3202348010f7c22a218fd37ad745ae7332fb007c
2016-09-07 15:14:15 +02:00
Michael Layzell
c47fca1cd7 Bug 1018486 - Part 1: Changes in dom/, r=baku
MozReview-Commit-ID: 4tCUM4KRe81
2016-09-07 10:50:35 -04:00
Jeremy Chen
e42a48e81d Bug 1297306 - part5:create enum constructors for EnumTable. r=baku
Enable nsAttrValue::EnumTable to be initialized with enum. So, we could get rid
of the castings in EnumTable. Fix EnumTable initialization comment.

For those untyped enumerations, declare them with uint8_t, as to other typed
enumerations with type size larger than int16_t, force casting to int16_t.

Use {nullptr,0} instead of {0} to represent the last entry.

MozReview-Commit-ID: 7Dma3Apkmxj

--HG--
extra : rebase_source : b2289866c4c33d80c8e170727bf109d018d92f67
2016-09-07 10:20:17 +08:00
Gerald Squelart
693932c5aa Bug 1300459 - Pass MediaInfo by const-ref to SetMediaInfo - r=jya
MozReview-Commit-ID: 5KvCBHmI1JC

--HG--
extra : rebase_source : aece207d36682e1a6cc4125ef660e2eb8f41d92c
2016-09-05 14:23:23 +10:00
Alastor Wu
384eb5f086 Bug 1298777 - don't need to capture audio for media element without audio track. r=jwwang
MozReview-Commit-ID: DKRGiuTGjtg

--HG--
extra : rebase_source : b5c2705b623d6479cb729f2a51aef637e59b1e39
2016-09-02 18:47:10 +08:00
Andreas Pehrson
3e21f8275b Bug 1299451 - Fix mozCaptureStream() happening after setting src but before having metadata. r=jesup
MozReview-Commit-ID: CKC3n3Nt5IE

--HG--
extra : rebase_source : 9c8348403cedb2ac7f68bce9fc5f36cfe2e08357
2016-08-31 14:54:03 +02:00
Andreas Pehrson
a91bec92ad Bug 1299172 - HTMLMediaElement::StreamSizeListener spring cleaning. r=jesup
MozReview-Commit-ID: 25lt1j8t1Xh

--HG--
extra : rebase_source : e972d008c5e80059dd10031df38cf400cc6c9650
2016-08-31 14:32:13 +02:00
Andreas Pehrson
864bcdc3c4 Bug 1299172 - Fix media element StreamSizeListener calling DispatchToMainThreadAfterStreamStateUpdate off-MSG-thread. r=jesup
MozReview-Commit-ID: Cc2tJbEog20

--HG--
extra : rebase_source : 83731e3fe29a7813a51f70eff8a0f43a21f92e1d
2016-08-31 14:31:28 +02:00
Kaku Kuo
60576ca55c Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald
MozReview-Commit-ID: 56JBbJ743DM

--HG--
extra : rebase_source : 2ff2066735bb89db066540716436ec5b33bfb449
2016-08-30 14:53:04 +08:00
Alastor Wu
56e48dbbf5 Bug 1262053 - part8 : remove function NotifyOwnerDocumentActivityChangedInternal. r=cpearce
MozReview-Commit-ID: DnWgQHGJLU5

--HG--
extra : rebase_source : a6c4ab94fad22b2bef1bdde07bc17246943128f7
2016-08-29 18:56:38 +08:00
Alastor Wu
97b81589f8 Bug 1262053 - part6 : don't need to capture media element without audio. r=baku,cpearce
MozReview-Commit-ID: GO6nXbzYwIy

--HG--
extra : rebase_source : 03aba373fde9133bf373292b2cdded5f04f22781
2016-08-29 18:56:32 +08:00
Alastor Wu
47079de3ad Bug 1262053 - part5 : register audio agent immediately when media element starts playing. r=baku
In ancient degisn, we would only register audio channel after the media element has audio track and enoguh data to playback,
that is because the "audio-playback" event would be dispatched with the registration, and then shows the tab audio indicator.

However, now the event dispatching doesn't follow with the registration, it would be triggered when the media element has
really audible data which would be notified from media decoder.

Therefore, the media element without audio track or without enough data can also register audio channel agent, it won't affect
the display of tab audio indicator. The reason we need to do that is for blocking autoplay media in the non-visited tab.

The autoplay can be adding "autoplay" keyword or playing by the script, and we don't want to dispatch dom event for blocked
media. Therefore, we should register audio channel agent to know whether it needs to be blocked immediately even the media
element doesn't have any enough data which can let us to distinguish it have any audio track or not (this information can
be known from metadata).

First, we must check whether the media is blocked which is notified by audio channel agent, and then we can decide whether
need to dispatch the event. If we don't register audio channel agent, that we can't get blocking information.

MozReview-Commit-ID: HLLkOuecql1

--HG--
extra : rebase_source : 99c34f0185276ecd5b70ae09959b47c584d1564e
2016-08-29 16:34:31 +08:00
Alastor Wu
9021286e9a Bug 1262053 - part4 : don't dispatch dom event for blocked media. r=cpearce
If the media was blocked, we would postpone the dom event and dispatch them after media is resumed.

MozReview-Commit-ID: LcdJtH16qQn

--HG--
extra : rebase_source : 209d18925a88a9e0dac82f2c0695ec1b60f54f63
2016-08-29 16:34:28 +08:00
Alastor Wu
c060486878 Bug 1262053 - part3 : modify media element for blocking autoplay media. r=cpearce
MozReview-Commit-ID: 8e13lkYTN46

--HG--
extra : rebase_source : 134d698c6136b8dcf0ef67c6b40df787c42cb886
2016-08-29 16:34:26 +08:00
Chris Pearce
1231058432 Bug 1262053 - part2 : remove old media.block-play-until-visible behaviour. r=cpearce
MozReview-Commit-ID: GujLSVfu2rp

--HG--
extra : rebase_source : 6d229b3817736039e46713c9e029dec8fd8d5913
2016-08-29 10:42:10 +08:00
Jean-Yves Avenard
816b36a832 Bug 1298594: P2. Fire waiting event when readyState move back to HAVE_CURRENT_DATA. r=jwwang
MozReview-Commit-ID: BpwYY6njXGC

--HG--
extra : rebase_source : 6dfe1998341ccf9fea69d8974f08aaa54385628d
2016-08-27 22:23:52 +10:00
Andreas Pehrson
d7f4cea968 Bug 1259788 - Ensure ready state is updated when first track added after NotifyTracksAvailable(). r=jesup
MozReview-Commit-ID: 1FwPfety82M

--HG--
extra : rebase_source : a241d20acddff8bac40ba9c1bc1c8318ead25fae
2016-08-19 13:41:48 +02:00
Andreas Pehrson
9a907cfbfc Bug 1259788 - Add a new disabled mode for MSG tracks. r=jesup
MozReview-Commit-ID: 1dMTR4Wmcd8

--HG--
extra : rebase_source : 8c2ea262d53901a11ec5c0e5067f328461dee8f2
2016-08-15 14:19:42 +02:00
Andreas Pehrson
091e8c0b00 Bug 1259788 - Support MediaStream sources for HTMLMediaElement.mozCaptureStream(). r=jesup
This adds support for HTMLMediaElement.mozCaptureStream() and
mozCaptureStreamUntilEnded() for a HTMLMediaElement playing a MediaStream.

This is up to spec, while capturing a HTMLMediaElement playing a file is not.
This incompatibility means we cannot mix sources for the returned MediaStream.

As such, a MediaStream returned while the HTMLMediaElement was playing a file
will only have content while the element is playing files. If the src changes
to a MediaStream, the stream will be empty.

It works the same way if a MediaStream was captured while the HTMLMediaElement
was playing another MediaStream.

This is due to TrackID management - MediaDecoder doesn't care, and creates new
tracks when you seek, so users are unable to keep track, while for MediaStream
we control everything from main thread and keep track of the TrackIDs used
previously.

This also adds a separate path from MediaElementAudioSourceNode so that we don't
forward video tracks when the returned MediaStream is only used internally for
WebAudio. We should in that case not require a DOMMediaStream but just forwarding
tracks to a TrackUnionStream should be enough, and will save us some cpu cycles.
This is however fine for now as it's simpler.

MozReview-Commit-ID: Bg8hESDISDU

--HG--
extra : rebase_source : 83885a73ec8cfc5fbe3c30a9330a52cd6b6dff12
extra : source : f1aec79078869c0a6435a1c06957c649d7a40dd9
2016-08-23 17:51:50 +02:00
Andreas Pehrson
83dcc7266e Bug 1259788 - Break out AddTrackInternal() from DOMMediaStream::CreateDOMTrack. r=jesup
Sometimes a track is added to a stream synchronously (before the stream is
exposed to script), and sometimes asynchronously (see the mediacapture-main spec
on the "addtrack" event).

In the latter case we might still need to create the MediaStreamTrack object
synchronously for tracking purposes. CaptureStream of Media element playing a
MediaStream wants this.

MozReview-Commit-ID: 7me8xzN7rwj

--HG--
extra : rebase_source : 4f129b127b855e47aad2ae9ab3981ffde057412d
2016-08-12 13:50:41 +02:00
Andreas Pehrson
e9d5ff0db1 Bug 1259788 - Rename CaptureStreamTrackSource to DecoderCaptureTrackSource. r=jesup
This prepares HTMLMediaElement for having a separate MediaStreamTrackSource for
MediaStreams, StreamCaptureTrackSource.

MozReview-Commit-ID: FVrYxFgvXgA

--HG--
extra : rebase_source : 5c162a0e861fa693fea0ba6b94b8e45446c0c13c
extra : source : a9151ac77a81573b8dbd9fee9c8aa09ba8dc7812
2016-07-06 12:15:27 +02:00
Andreas Pehrson
702bbad147 Bug 1259788 - Multi-track support for MediaTrackList. r=jesup
MozReview-Commit-ID: 1av5uvyCMYv

--HG--
extra : rebase_source : d60ecefbe55bf3d77521aaf3aced427e0012411a
extra : source : e108109d193b5f18e358fcb226d7700c5103d9cc
2016-08-24 10:58:04 +02:00
Dan Glastonbury
0e76b94eb8 Bug 1297429 - Fix video suspend intermittent failures. r=jwwang
On Linux x64 PGO try, HTMLMediaElement was reliably invoking
decoder->NotifyOwnerActivityChanged() after SetVisible(false) was
called. This caused the pending suspend to be cancelled and the test
waits for an event that never arrives.

Fixed by adding 'forced hidden' to MediaDecoder that overrides the
element visibility that comes from HTMLMediaElement.

MozReview-Commit-ID: 5aRhxxZ5cZd

--HG--
extra : rebase_source : 5a4e1c44ddd2265eab545f8fe19c4ae47cebf7bf
2016-08-25 12:10:05 +10:00
Bryce Van Dyk
bf4a449efb Bug 1145011 - Implement waitingforkey event. r=jya
Bubble information from SamplesWaitingForKey to an HTMLMediaElement so that we
can emit a waitingForKey event. If we are unable to decode more samples due to
needing a key the event will be signalled. See
http://w3c.github.io/encrypted-media/#dom-evt-waitingforkey for more information
on this event.

The code in place before this patch handles updating readyState when we are
waiting for a key, this patch adds the event which should be emitted in such a
case. The spec defines certain preconditions should be the case before running
the algo to emit this event. For example, the element should potentially be
playing, and it should have at least HAVE_FUTURE_DATA ready state. This is not
strictly true for when the new code is run, due how existing code handles ready
state. We are honoring the spirit of the spec, though the letter of the spec is
lightly gone against in the handling of the preconditions.

MozReview-Commit-ID: LKlDd4wkRSE

--HG--
extra : rebase_source : 2c61fc41636e430afa23240ad5d26c886124d87f
2016-08-22 08:51:01 +12:00
Gerald Squelart
eaa8256995 Bug 1295831 - Report VIDEO_INTER_KEYFRAME_MAX_MS=0 when only 1 keyframe - r=kaku
We will now record '0' in VIDEO_INTER_KEYFRAME_MAX_MS when only one keyframe is
found when playing a video (played for at least enough time to be eligible for
video-decode-suspend feature.)

MozReview-Commit-ID: ALDmSYxs2f1

--HG--
extra : rebase_source : 70b19e9c5c976f764a744dc4bf7a0760e80dd834
2016-08-18 11:54:00 +10:00
Kaku Kuo
5ab464fd77 Bug 1295440 - Make HTMLMediaElement::SeekToNextFrame() reject promise with meaningful information; r=jwwang
MozReview-Commit-ID: Dgi3Ek8K3bR

--HG--
extra : rebase_source : 58d63933906f676a7e7a5ed85cf7e25e3e87dd16
2016-08-17 10:02:10 +08:00
bechen
931402dd2f Bug 1291629 - Remove RTSP code. r=jwwang
MozReview-Commit-ID: AxaLwO4rTuY

--HG--
extra : rebase_source : f8a5de1be1471238d62b6bbc419b3a45f2590da6
2016-08-10 10:32:25 +08:00
Jean-Yves Avenard
ca9b247d0a Bug 1294398: Always calculate seekable attribute value. r=jwwang
MozReview-Commit-ID: 2CHJxPQdVEg

--HG--
extra : rebase_source : e7ca98136d7d954911683e66fcf39920aca24267
2016-08-11 20:35:59 +10:00
Jean-Yves Avenard
c5b030a3f3 Bug 1293927: Always use MediaSource seekable range regardless of readyState. r=jwwang
MozReview-Commit-ID: 7ae467k5PSf

--HG--
extra : rebase_source : 96e79cc0ba99272d9573a427408e820cb496c106
2016-08-10 14:14:37 +10:00
Kaku Kuo
a6ed727230 Bug 1292091 - Part 2 - replace MaybeResolve(JS::UndefinedHandleValue) with MaybeResolveWithUndefined(); r=bz
MozReview-Commit-ID: KNbxVcCVqts

--HG--
extra : transplant_source : %1D%18%E5%C9o%F0%29%E7%E0%93%EEcR%C7B%3BeX%B3%87
2016-08-09 17:15:13 +08:00
Carsten "Tomcat" Book
553a2da922 merge mozilla-inbound to mozilla-central a=merge 2016-08-10 15:54:26 +02:00
Nicholas Nethercote
e7f10a07fd Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.

--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
2016-08-08 12:18:10 +10:00
JW Wang
aace2f0c8d Bug 1290809 - Remove MediaDecoder::IsEndedOrShutdown(). r=gerald
MozReview-Commit-ID: 4XUcJyQlmfk

--HG--
extra : rebase_source : fc2a044ca2776744ef0fff32300faf647666e73c
2016-08-01 15:22:32 +08:00
Alastor Wu
d5a9e0c263 Bug 1283417 - part1 : implement function to notify cue's display states changed. r=bechen
MozReview-Commit-ID: AF2S2UOLCt1

--HG--
extra : rebase_source : a49043e2114cba053168b5e3f52f3846c456b2fa
2016-08-09 16:43:07 +08:00
Gerald Squelart
d78a374b2d Bug 1293145 - Simulate video-decode-suspend for telemetry purposes - r=kamidphish
After a video has been playing while hidden for a certain time, count the time
until it is not hidden anymore (or it has finished playing), to test-drive how
much decoding time would have been saved by the video-decode-suspend feature.

Note that this is done inside HTMLMediaElement by simulating what should happen
in the MDSM, because instrumenting the MDSM itself and friends would have been
harder and more intrusive.

MozReview-Commit-ID: LdxhPtmoXeA

--HG--
extra : rebase_source : 151e1f1383ab5c445eb8c957be8363340cdc4ab1
2016-08-08 10:14:39 +08:00
Iris Hsiao
36c9d770e1 Backed out changeset 41138b630cdc (bug 1293145) for nsCOMPtr crash \
CLOSED TREE
2016-08-09 14:21:22 +08:00
Gerald Squelart
5ab439ad36 Bug 1293145 - Simulate video-decode-suspend for telemetry purposes - r=kamidphish
After a video has been playing while hidden for a certain time, count the time
until it is not hidden anymore (or it has finished playing), to test-drive how
much decoding time would have been saved by the video-decode-suspend feature.

Note that this is done inside HTMLMediaElement by simulating what should happen
in the MDSM, because instrumenting the MDSM itself and friends would have been
harder and more intrusive.

MozReview-Commit-ID: LdxhPtmoXeA

--HG--
extra : rebase_source : c4063d7c39b56e62e4f397bc21ef889ed14307c8
2016-08-08 10:14:39 +08:00
Wes Kocher
83c7e63697 Merge m-c to inbound, a=merge 2016-08-05 14:06:00 -07:00
Jean-Yves Avenard
91fecd5799 Bug 1292157: Ignore preload value when dealing with MediaSource originated URI. r=jwwang
MozReview-Commit-ID: CN9w9XJj2YR

--HG--
extra : rebase_source : 60c809ab8d65f9abfe75ec524a1ae2ecbd6b7f00
2016-08-05 11:15:50 +10:00
Yoshi Huang
a520e75a4d Bug 1264231 - Part 3: remove loadInfo work-around. r=sicking 2016-08-05 19:44:57 +08:00
ctai
2c69985ffe Bug 1201363 - Call MediaStreamVideoSink::setCurrentFrames in SourceMediaStream::AppendToTrack. r=jesup
In this patch, we first deal with the case of MediaElement. Now we replace |PlayVideo| with |VideoFrameContainer::SetCurrentFrames| in |SourceMediaStream::AppendToTrack|. The MSG use TimeStamp::Now() for the TimeStamp of each video frame in most of case except MediaElement case. Becasue the MediaElement has its own VideoQueue, we need to calucalte the correct Timestamp based on the StartTimeStamp of this MediaStream and the elpased time of the video frame in DecodedStream.

MozReview-Commit-ID: 2bm2AHkFXHu

--HG--
extra : transplant_source : %3D%AA%00%CE%A3SV5%8F%84%96%AC%E2%D9%10%EC%85%07N%DF
2016-07-25 10:01:26 +08:00
ctai
384447b1ba Bug 1201363 - Adding Add/RemoveVideoOutput into VideoStreamTrack. r=jesup
MozReview-Commit-ID: JmKotuB3pBM

--HG--
extra : transplant_source : %DE%90%A1%E0%CC%FD%27%AC%BB%931%9F%EF%B8M%CE%F0%C3%3F%B7
2016-07-19 11:45:27 +08:00
ctai
b7fcb47572 Bug 1201363 - Replace VideoFrameContainer with MediaStreamVideoSink in MSG. r=jesup
Replace the pointer of VideoFrameContainer with the pointer of MediaStreamVideoSink.

MozReview-Commit-ID: 5bqEMpemwuR

--HG--
extra : transplant_source : %008z%D8W%EE%87%8E%E9/%2CT%26%EBvo%AE%099%A6
2016-05-27 14:33:48 +08:00
Sebastian Hengst
120f502e2a Backed out changeset 3851902daa94 (bug 1201363) 2016-08-03 19:33:25 +02:00
Sebastian Hengst
f0fd44f274 Backed out changeset 0744bfe6854f (bug 1201363) 2016-08-03 19:33:25 +02:00