Commit Graph

1084 Commits

Author SHA1 Message Date
Carsten "Tomcat" Book
8c3409a304 Merge mozilla-central to mozilla-inbound 2016-09-14 12:11:09 +02:00
Jean-Yves Avenard
a945c437e1 Bug 1299072: P10. Pass decoding error details to media element's error attribute. r=jwwang
MozReview-Commit-ID: 49DurV9WI5S
2016-09-11 00:56:09 +10:00
kaku@mozilla.com
788fd469db Bug 1299718 part 3 - call MarkAsContentSource() at where using video element as a source; r=gerald,kamidphish,mtseng
MozReview-Commit-ID: Kg6UpcsCi0P
2016-09-14 15:50:29 +10:00
kaku@mozilla.com
3e4dcf7643 Bug 1299718 part 2 - implement the MarkAsContentSource() API; r=gerald,kamidphish
MozReview-Commit-ID: 1eAdcMAmXSB
2016-09-14 15:50:29 +10:00
Kaku Kuo
90a343f11f 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
79a35e164a 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
d05d4c5116 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
425c839f4f 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
acd22e8efa Merge inbound to m-c a=merge 2016-09-07 17:54:24 -07:00
Andreas Pehrson
f20ab4d087 Bug 1300529 - Remove default arguments from HTMLMediaElement::CaptureStreamInternal. r=padenot
MozReview-Commit-ID: IL7odCBP74
2016-09-07 15:14:15 +02:00
Michael Layzell
f2f13378b5 Bug 1018486 - Part 1: Changes in dom/, r=baku
MozReview-Commit-ID: 4tCUM4KRe81
2016-09-07 10:50:35 -04:00
Jeremy Chen
c22b72adf2 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
2016-09-07 10:20:17 +08:00
Gerald Squelart
04eb9daee8 Bug 1300459 - Pass MediaInfo by const-ref to SetMediaInfo - r=jya
MozReview-Commit-ID: 5KvCBHmI1JC
2016-09-05 14:23:23 +10:00
Alastor Wu
6d093d007f Bug 1298777 - don't need to capture audio for media element without audio track. r=jwwang
MozReview-Commit-ID: DKRGiuTGjtg
2016-09-02 18:47:10 +08:00
Andreas Pehrson
4e763f0334 Bug 1299451 - Fix mozCaptureStream() happening after setting src but before having metadata. r=jesup
MozReview-Commit-ID: CKC3n3Nt5IE
2016-08-31 14:54:03 +02:00
Andreas Pehrson
45a6e05995 Bug 1299172 - HTMLMediaElement::StreamSizeListener spring cleaning. r=jesup
MozReview-Commit-ID: 25lt1j8t1Xh
2016-08-31 14:32:13 +02:00
Andreas Pehrson
db836401a1 Bug 1299172 - Fix media element StreamSizeListener calling DispatchToMainThreadAfterStreamStateUpdate off-MSG-thread. r=jesup
MozReview-Commit-ID: Cc2tJbEog20
2016-08-31 14:31:28 +02:00
Kaku Kuo
26c5d46d72 Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald
MozReview-Commit-ID: 56JBbJ743DM
2016-08-30 14:53:04 +08:00
Alastor Wu
2a26bc5f28 Bug 1262053 - part8 : remove function NotifyOwnerDocumentActivityChangedInternal. r=cpearce
MozReview-Commit-ID: DnWgQHGJLU5
2016-08-29 18:56:38 +08:00
Alastor Wu
0aa6d63f4f Bug 1262053 - part6 : don't need to capture media element without audio. r=baku,cpearce
MozReview-Commit-ID: GO6nXbzYwIy
2016-08-29 18:56:32 +08:00
Alastor Wu
a86a2617b9 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
2016-08-29 16:34:31 +08:00
Alastor Wu
80033f3fc5 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
2016-08-29 16:34:28 +08:00
Alastor Wu
8bbb47f0e2 Bug 1262053 - part3 : modify media element for blocking autoplay media. r=cpearce
MozReview-Commit-ID: 8e13lkYTN46
2016-08-29 16:34:26 +08:00
Chris Pearce
6abb31e01c Bug 1262053 - part2 : remove old media.block-play-until-visible behaviour. r=cpearce
MozReview-Commit-ID: GujLSVfu2rp
2016-08-29 10:42:10 +08:00
Jean-Yves Avenard
90c89d6302 Bug 1298594: P2. Fire waiting event when readyState move back to HAVE_CURRENT_DATA. r=jwwang
MozReview-Commit-ID: BpwYY6njXGC
2016-08-27 22:23:52 +10:00
Andreas Pehrson
71794987a5 Bug 1259788 - Ensure ready state is updated when first track added after NotifyTracksAvailable(). r=jesup
MozReview-Commit-ID: 1FwPfety82M
2016-08-19 13:41:48 +02:00
Andreas Pehrson
2d5667b427 Bug 1259788 - Add a new disabled mode for MSG tracks. r=jesup
MozReview-Commit-ID: 1dMTR4Wmcd8
2016-08-15 14:19:42 +02:00
Andreas Pehrson
0ea44a1cbd 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
2016-08-23 17:51:50 +02:00
Andreas Pehrson
f2994d694b 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
2016-08-12 13:50:41 +02:00
Andreas Pehrson
e335a8c2f6 Bug 1259788 - Rename CaptureStreamTrackSource to DecoderCaptureTrackSource. r=jesup
This prepares HTMLMediaElement for having a separate MediaStreamTrackSource for
MediaStreams, StreamCaptureTrackSource.

MozReview-Commit-ID: FVrYxFgvXgA
2016-07-06 12:15:27 +02:00
Andreas Pehrson
7851818950 Bug 1259788 - Multi-track support for MediaTrackList. r=jesup
MozReview-Commit-ID: 1av5uvyCMYv
2016-08-24 10:58:04 +02:00
Dan Glastonbury
eab84a26d9 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
2016-08-25 12:10:05 +10:00
Bryce Van Dyk
8c84be1a8f 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
2016-08-22 08:51:01 +12:00
Gerald Squelart
ec07371f97 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
2016-08-18 11:54:00 +10:00
Kaku Kuo
04c743da91 Bug 1295440 - Make HTMLMediaElement::SeekToNextFrame() reject promise with meaningful information; r=jwwang
MozReview-Commit-ID: Dgi3Ek8K3bR
2016-08-17 10:02:10 +08:00
bechen
e2ae2d2c33 Bug 1291629 - Remove RTSP code. r=jwwang
MozReview-Commit-ID: AxaLwO4rTuY
2016-08-10 10:32:25 +08:00
Jean-Yves Avenard
397901095e Bug 1294398: Always calculate seekable attribute value. r=jwwang
MozReview-Commit-ID: 2CHJxPQdVEg
2016-08-11 20:35:59 +10:00
Jean-Yves Avenard
73235ff1f7 Bug 1293927: Always use MediaSource seekable range regardless of readyState. r=jwwang
MozReview-Commit-ID: 7ae467k5PSf
2016-08-10 14:14:37 +10:00
Kaku Kuo
bcb7169ac7 Bug 1292091 - Part 2 - replace MaybeResolve(JS::UndefinedHandleValue) with MaybeResolveWithUndefined(); r=bz
MozReview-Commit-ID: KNbxVcCVqts
2016-08-09 17:15:13 +08:00
Carsten "Tomcat" Book
ce02c3ed29 merge mozilla-inbound to mozilla-central a=merge 2016-08-10 15:54:26 +02:00
Nicholas Nethercote
1f65390cc9 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.
2016-08-08 12:18:10 +10:00
JW Wang
3d9cb4536f Bug 1290809 - Remove MediaDecoder::IsEndedOrShutdown(). r=gerald
MozReview-Commit-ID: 4XUcJyQlmfk
2016-08-01 15:22:32 +08:00
Alastor Wu
e4b9fa835e Bug 1283417 - part1 : implement function to notify cue's display states changed. r=bechen
MozReview-Commit-ID: AF2S2UOLCt1
2016-08-09 16:43:07 +08:00
Gerald Squelart
a8099eb8bb 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
2016-08-08 10:14:39 +08:00
Iris Hsiao
4df8be5986 Backed out changeset 41138b630cdc (bug 1293145) for nsCOMPtr crash \
CLOSED TREE
2016-08-09 14:21:22 +08:00
Gerald Squelart
8ea3a2c1f5 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
2016-08-08 10:14:39 +08:00
Wes Kocher
2712405c2e Merge m-c to inbound, a=merge 2016-08-05 14:06:00 -07:00
Jean-Yves Avenard
08d5f03820 Bug 1292157: Ignore preload value when dealing with MediaSource originated URI. r=jwwang
MozReview-Commit-ID: CN9w9XJj2YR
2016-08-05 11:15:50 +10:00
Yoshi Huang
7937ade983 Bug 1264231 - Part 3: remove loadInfo work-around. r=sicking 2016-08-05 19:44:57 +08:00
ctai
a60d7411e6 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
2016-07-25 10:01:26 +08:00