Commit Graph

612 Commits

Author SHA1 Message Date
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
ctai
4240c7df8f Bug 1201363 - Adding Add/RemoveVideoOutput into VideoStreamTrack. r=jesup
MozReview-Commit-ID: JmKotuB3pBM
2016-07-19 11:45:27 +08:00
ctai
56fe08b4fc Bug 1201363 - Replace VideoFrameContainer with MediaStreamVideoSink in MSG. r=jesup
Replace the pointer of VideoFrameContainer with the pointer of MediaStreamVideoSink.

MozReview-Commit-ID: 5bqEMpemwuR
2016-05-27 14:33:48 +08:00
Sebastian Hengst
3704bef2fd Backed out changeset 3851902daa94 (bug 1201363) 2016-08-03 19:33:25 +02:00
Sebastian Hengst
427f864854 Backed out changeset 0744bfe6854f (bug 1201363) 2016-08-03 19:33:25 +02:00
Sebastian Hengst
396da974ac Backed out changeset 4111e388bd90 (bug 1201363) 2016-08-03 19:33:25 +02:00
ctai
fec582345c 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
ctai
7692a9689d Bug 1201363 - Adding Add/RemoveVideoOutput into VideoStreamTrack. r=jesup
MozReview-Commit-ID: JmKotuB3pBM
2016-07-19 11:45:27 +08:00
ctai
9104d064ff Bug 1201363 - Replace VideoFrameContainer with MediaStreamVideoSink in MSG. r=jesup
Replace the pointer of VideoFrameContainer with the pointer of MediaStreamVideoSink.

MozReview-Commit-ID: 5bqEMpemwuR
2016-05-27 14:33:48 +08:00
Kaku Kuo
40efb11f19 Bug 1274626 part 1 - add a method to HTMLMediaElement for debugging visibilty change; r=jwwang,ehsan
MozReview-Commit-ID: B1gAc0KfmCQ
2016-07-28 16:09:02 +08:00
Carsten "Tomcat" Book
4422966ea3 Backed out changeset eb7f310f128d (bug 1274626) for breaking unified builds 2016-08-02 17:47:47 +02:00
Carsten "Tomcat" Book
ea106e7924 Backed out changeset b018ce9d1484 (bug 1201363) 2016-08-02 12:53:59 +02:00
Carsten "Tomcat" Book
79d29cdf34 Backed out changeset a6bafaf6bbe6 (bug 1201363) 2016-08-02 12:53:54 +02:00
Carsten "Tomcat" Book
6b4c35d60d Backed out changeset 06c0a7eb7bc6 (bug 1201363) 2016-08-02 12:53:53 +02:00
ctai
cdba565a14 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
ctai
c82ac89d32 Bug 1201363 - Adding Add/RemoveVideoOutput into VideoStreamTrack. r=jesup
MozReview-Commit-ID: JmKotuB3pBM
2016-07-19 11:45:27 +08:00
ctai
f94bf5cd50 Bug 1201363 - Replace VideoFrameContainer with MediaStreamVideoSink in MSG. r=jesup
Replace the pointer of VideoFrameContainer with the pointer of MediaStreamVideoSink.

MozReview-Commit-ID: 5bqEMpemwuR
2016-05-27 14:33:48 +08:00
Kaku Kuo
bc0577ca70 Bug 1274626 - Part 1 - add a method to HTMLMediaElement for debugging visibilty change; r=jwwang,ehsan
MozReview-Commit-ID: B1gAc0KfmCQ
2016-07-28 16:09:02 +08:00
Carsten "Tomcat" Book
bc6615c2f9 Merge mozilla-central to autoland 2016-07-30 16:49:41 +02:00
JW Wang
fa1920a2bb Bug 1289649 - HTMLMediaElement should clear mDecoder when XPCOM shutdown begins. r=gerald
MozReview-Commit-ID: A3ECReCgiD7
2016-07-27 10:26:21 +08:00
Alastor Wu
a47af62e51 Bug 1288971 - notify audio playback changed by media element's play(). r=baku
Notify audible-changing when resuming audio by MediaElement::play() instead of control interface.

MozReview-Commit-ID: 10a1npQ46Th
2016-07-29 19:26:56 +08:00
James Willcox
c3412b379c Bug 1286133 - Use Android VideoView to play HLS r=sebastian,jchen 2016-07-29 17:02:35 -05:00
Alastor Wu
a73b58fc73 Bug 1282410 - part1 : open unsupported type media. r=cpearce 2016-07-29 17:02:31 -05:00