Commit Graph

151 Commits

Author SHA1 Message Date
JW Wang
4f5754ca55 Bug 1328130. Part 2 - remove MozPromiseRequestHolder::Begin(). r=gerald
MozReview-Commit-ID: JL27n0Era6E

--HG--
extra : rebase_source : e6de76db3fb35b110370497f4060ea1c3f527f23
extra : intermediate-source : 5bc39a45ef042b895a5abda59cc0796e8cfb4be3
extra : source : a7f7faded7b112e8a971ca96b091a9a22214a2bb
2017-01-11 16:33:29 +08:00
John Lin
d496213476 Bug 1322679 - call MarkSentToCompositor() when VideoSink::Redraw() processing queued frame. r=jwwang
MozReview-Commit-ID: IBM6HcCpVA8

--HG--
extra : rebase_source : 7cdbe96a7236e2e0be61b6dc953963fde3fe6b84
2016-12-09 19:57:12 +08:00
John Lin
f2d11c05c8 Bug 1299068 - part 3: notify when VideoData are sent to compositor. r=jwwang
MozReview-Commit-ID: Jn4AqpMaXMg

--HG--
extra : rebase_source : 9080d1fd4cbc532019134ea7087bbef03ae2600a
2016-11-23 15:08:17 +08:00
Kaku Kuo
42a1f53991 Bug 1309516 part 0 - make sure that the VideoSink::Redraw() always draws something; r=jwwang
MozReview-Commit-ID: BQ0FDyNPuri

--HG--
extra : rebase_source : 42649411a6b00cc09f581b63a00e98b14a093986
2016-11-15 12:04:26 +08:00
JW Wang
b7474df3ed Bug 1316543 - Fix the calculation of VideoSink::mVideoFrameEndTime. r=cpearce
MozReview-Commit-ID: 4p34iXLtQz5

--HG--
extra : rebase_source : e084436cd88e7bea9000422a7e57d8f343c26f41
2016-11-10 17:12:01 +08:00
Chris Pearce
ad6837ab57 Bug 1307546 - Give VideoSink a minimum update interval. r=jwwang
Without this, we can end up with very short, or even negative, update
intervals, meaning we unnecessarily use CPU when we can't actually
advance the playback position.

MozReview-Commit-ID: 6H32uVCyCll

--HG--
extra : rebase_source : 952799b846bcbb562d4ff99e97a8dcb5d8b2f558
2016-11-07 16:21:58 +13:00
JW Wang
fea88a9ded Bug 1315586 - DecodedStream::NotifyOutput() should compare |a->mTime| to GetPosition() instead of |aTime|. r=pehrsons
MozReview-Commit-ID: AyqsW9w5Je0

--HG--
extra : rebase_source : b401aad9c175e6ded87edd535c3124eec139ecab
2016-11-07 11:10:53 +08:00
Sebastian Hengst
5bac92d3b9 Backed out changeset d5a00a0b689c (bug 1307546) for increased mda test_BufferingWait_mp4.html failure on Windows 7. r=backout a=backout
MozReview-Commit-ID: J0DyTk9rJJe
2016-11-05 16:52:33 +01:00
Chris Pearce
d2ec5f2f3e Bug 1307546 - Ensure we don't set timers with negative intervals in to update A/V sync. r=jya
Our logic to do A/V sync sets a timer to drop expired frames based on the
start time of the next frame in the queue. If the frames in the queue are
badly muxed and don't have monotonically increasing start times, we can
end up setting a timer with a negative interval. This causes us to reevaluate
the frames in the VideoSink's queue immediately, set the same timer again,
and so we end up hot-looping.

This is a simple low-risk fix that detects when we're about to set a negative
interval timer, and instead sets the timer 1/30th of a second in the future.

This fix is deliberately low risk, such that it's suitable for uplift. I have
an idea how to do this better, but the lower risk this is most suitable for
uplift.

MozReview-Commit-ID: CDOqJJodx4l

--HG--
extra : rebase_source : b2833382d95143ee1845f2ea32dcc77a1903dc00
2016-11-04 16:42:24 +13:00
JW Wang
f682200758 Bug 1198168 - add debugging logs. r=kaku
MozReview-Commit-ID: D35N9bNNOeK

--HG--
extra : rebase_source : 4da554e41c48e52f9f90e3c9d222d4a85130da87
2016-11-01 14:41:09 +08:00
JW Wang
d30c88bef8 Bug 1309111 - Some macros are not expanded correctly by MSVC. r=gerald
MozReview-Commit-ID: BGJXOgslSt8

--HG--
extra : rebase_source : a62efe2e0653f009a7010e5c95dcbb09bed2213b
extra : source : f8a392e8034e1ca216aaf7084f860b0a03e021eb
2016-10-11 13:28:56 +08:00
JW Wang
15fc2d73c6 Bug 1306813 - Don't puslish events to mOnOutput after DecodedStream::Stop() is called. r=pehrsons
Because the TaskQueue of MDSM will shut down soon and TaskQueue::Dispatch() will fail (via mOnOutput.Notify()).
We reset mStream in Forget() on the TaskQueue thread of MDSM so NotifyOutput() can check it
and ensure mOnOutput.Notify() always happen before DecodedStream::Stop().

MozReview-Commit-ID: 4sCXk1KAfCC

--HG--
extra : rebase_source : 1ec50a86fa1519c4fc8caa1087f2794411aa23b0
2016-10-04 14:54:23 +08:00
Jean-Yves Avenard
aa4ed2f442 Bug 1305826: P3. Only process the number of frames, do not rely on allocated size. r=gerald
This is only for safeguarding, in case an audio buffer was over allocated. There should be none. But better be safe than sorry

MozReview-Commit-ID: JszA8CqycTr

--HG--
extra : rebase_source : ddeb1ff1f19abba36e4cbb1bab5132f15f5a2a74
2016-10-01 19:34:42 +10:00
JW Wang
1a0d74d8ae Bug 1305353. Part 3 - discard audio samples in DecodedStream::NotifyOutput(). r=pehrsons
MozReview-Commit-ID: 7o6cdP126ip

--HG--
extra : rebase_source : 1c048589c50697b103d41d1f350d3056b392ffdf
extra : source : cb75ad9850543f4739ab37f8cd309301d067fc46
2016-09-26 15:25:11 +08:00
JW Wang
951520874b Bug 1305353. Part 2 - remove DecodedStreamData::GetPosition() and its friends. r=pehrsons
MozReview-Commit-ID: FJvBDO0x6b0

--HG--
extra : rebase_source : 1038e583031cea484cbb1f4e83d8e7fa26b96eb5
extra : source : c9883664b68c0782450994ebe0e1d5798baa06a5
2016-09-26 15:12:20 +08:00
JW Wang
b903738272 Bug 1305353. Part 1 - publish output time to DecodedStream using MediaEventProducer. r=pehrsons
MozReview-Commit-ID: 5f37RfBhDA

--HG--
extra : rebase_source : 890a5b52fffac35302db1a8f17b4ff68b31e5ba4
extra : source : 07a11ac6970391aafc96f39370ab83370316f65a
2016-09-26 15:08:12 +08:00
Jamie Nicol
22f1d4f009 Bug 1245959 - Check video frame has non-zero dimensions before sending image to compositor. r=nical
MozReview-Commit-ID: 6PlWqE6is7Z

--HG--
extra : rebase_source : df4ff6689eea6ff8e95dd0f6d7e3e37b994875a1
2016-09-19 14:41:36 +01:00
Sotaro Ikeda
8cffca6531 Bug 1299415 - Clear ImageContainer cached resources When VideoSink pause playing r=jwwang 2016-09-04 23:38:43 -07:00
JW Wang
713c29c0d1 Bug 1299021. Part 2 - ensure resolving the end promise when mVideoSinkEndRequest is resolved. r=kikuo
MozReview-Commit-ID: 2XTpqVGBrBN

--HG--
extra : rebase_source : 37246ada49fd5b8a4de57ece3c3941f182db5e2c
2016-08-29 21:28:36 +08:00
JW Wang
2ecd9cc1dd Bug 1299021. Part 1 - extract the code about resolving the end promise. r=kikuo
MozReview-Commit-ID: ECr058zKdUk

--HG--
extra : rebase_source : ae2b59cbf758ab9b703c9aed471ddb7bf3145f4f
2016-08-29 20:56:00 +08:00
JW Wang
716c3e5830 Bug 1299019 - ensure mVideoFrameEndTime is mono-increasing. r=kikuo
MozReview-Commit-ID: 3rwItcTAqUQ

--HG--
extra : rebase_source : dfcefdd15f85387a13312c271c4df7b424f4d239
2016-08-29 20:46:26 +08:00
Jean-Yves Avenard
b3537bb63d Bug 1298594: P4. Pop the frame when current time is past the end of the current frame. r=jwwang
Most frames start when the previous one stop.

MozReview-Commit-ID: H92Bmiki49Q

--HG--
extra : rebase_source : 071416d9151d5188550d73f0eb5a4c70a5fbd48b
2016-08-29 15:46:56 +10:00
JW Wang
663ca6b4fa Bug 1297553 - Dump more debugging messages for MDSM and MediaSink. r=kaku
MozReview-Commit-ID: ILcF1hT2hVN

--HG--
extra : rebase_source : 1f6564eb5161608ee6031b1c362a6b689762dcfe
2016-08-24 11:45:58 +12:00
Chris Pearce
b20d1d8c23 Bug 1295630 - Provide a way for A/V sync to be ruined, so talos can test compositor throughput by painting expired frames. r=mattwoodrow
In bug 1258870 I changed the media code so that we dropped all late video
frames. Without this, our A/V sync was broken when the decode was struggling
to keep up, and we weren't reporting dropped frames when the decode couldn't
keep up, and so players couldn't adapt to a bitrate which the decode could keep
up on.

However, dropping all late frames broke talos tests which relied on the old
behaviour of us rendering video frames that were late. So this patch adds a
pref to cause the frame dropping code to not drop the last frame in the
queue, so there will always be something for the compositor to composit. This
means talos will once again be able to test how fast it can composit frames
that aren't supposed to be drawn.

The pref is media.ruin-av-sync.enabled.

It defaults to false.

MozReview-Commit-ID: J3VvpzoDRmI

--HG--
extra : rebase_source : ee24f37f201ef266e0894ca2c5afda498629ec0a
2016-08-19 21:34:42 +12:00
Chris Pearce
3940f4a605 Bug 1258870 - Don't push late video frames to the compositor, drop them. r=jwwang
We can get out of A/V sync if the decode is struggling to keep up. This is
because of the loop in VideoSink::UpdateRenderedVideoFrames(). If this function
runs while there's only one frame in the video queue, we won't drop that one
frame if it's late. If we're struggling to keep up, it's increasingly likely
that we'll end up running this function with only one frame in the video queue.
That results in us entering VideoSink::RenderVideoFrames() with only 1 late
frame, which the compositor dutifully draws. Resulting in a late frame being
drawn, and thus broken A/V sync.

This change makes VideoSink::UpdateRenderedVideoFrames() drop all late
frames, even the last one in the video queue. We now keep A/V sync when the
decode is struggling to keep up. However, if I do this, we end up dropping
(and reporting that we drop) a lot more frames, and thus rendering a lot fewer.
But since we when we drop the frames we report them as dropped, a well written
MSE player can detect that we've failing miserably to keep up, and and lower
their bitrate.




MozReview-Commit-ID: ybkq48mKk2

--HG--
extra : rebase_source : f03c186059a365a45de698b2a30e632daae47fb8
2016-08-15 13:35:52 +12: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
Sebastian Hengst
f4671c3b11 Backed out changeset 4111e388bd90 (bug 1201363) 2016-08-03 19:33:25 +02:00
ctai
a3cc6128d3 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 : amend_source : 7b9c51dcb4046c6c807d1cf1e48bef301e45fa8e
2016-07-25 10:01:26 +08:00
Carsten "Tomcat" Book
27cb7f4d79 Backed out changeset 06c0a7eb7bc6 (bug 1201363) 2016-08-02 12:53:53 +02:00
ctai
edeaa48113 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 : %C4n%D7a%10%CFK%D5%F2%DC%10%08%C2%24%EC%11%13J%DB%5D
2016-07-25 10:01:26 +08:00
Gerald Squelart
7bea2e1262 Bug 1289668 - Refactor FrameStatistics writers to use Data struct - r=kamidphish
Decoders now use FrameStatisticsData to gather data for their frame-related
notifications. This will ease introducing new members later on.

MozReview-Commit-ID: DWdOSPX3JM

--HG--
extra : rebase_source : a3e05f34353a397d1c82b3f4d935c0864f90556e
2016-07-18 10:41:40 +10:00
Tom Tromey
5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Farmer Tseng
55fd27efdb Bug 1283489 - mParams.mPlaybackRate should be updated after call GetVideoPosition(). r=jwwang 2016-07-10 23:35:00 +02:00
ctai
fd36b32d94 Bug 1266646 - Move group of MediaStreamListener to a new header file. r=pehrsons
This can reduce the include header dependency. MediaStreamVideoSink will inherit from DirectMediaStreamTrackListener. But we can't use forward declaration on MediaStreamListener because the usage of nsTArray<RefPtr<MediaStreamVideoSink>>.

MozReview-Commit-ID: 328s4Kw9NvW

--HG--
extra : transplant_source : %D2%18%E3%3B%0C%D8%F04%F3%EB%EB%A0%A7%8B%B1%A9%AB%97rY
2016-06-30 15:07:48 +08:00
Andreas Pehrson
e028368c0f Bug 1280445 - Remove wrapper from MediaStream. r=jesup, r=padenot
MozReview-Commit-ID: CTCFloIUXKa

--HG--
extra : rebase_source : b1c2073c638bb65c19a0f40e8d17e9a5bae15c98
extra : source : c6d854b3209e7de7d97153c0bfc492c1d5f1e6b5
2016-06-29 12:27:13 +02:00
JW Wang
e34042f5dc Bug 1277175 - Remove AudioStream::IsPaused(). r=kinetik.
MozReview-Commit-ID: K2CHJ0E90MW

--HG--
extra : rebase_source : 4f0bd8f2e46ad8850a15c7a1102c9bae5217e6bc
2016-05-31 15:59:20 +08:00
JW Wang
fbdef02717 Bug 1272565 - draw a blank image when no frames in the video track.
MozReview-Commit-ID: 1Kijn00XAnQ
2016-05-17 10:33:32 +08:00
Chris Peterson
353ee65255 Bug 1272513 - Part 1: Suppress -Wshadow warnings-as-errors in some directories. r=glandium 2016-05-11 00:00:01 -07:00
Jean-Yves Avenard
e926d54268 Bug 1206637: P1. Add MediaPrefs convenience class. r=cpearce
Almost identical to gfxPrefs, with the exception that preferences can't be set (as it doesn't work with e10s anyway). The generated code size is tiny enough that we don't have to bother about having duplicates.

MozReview-Commit-ID: 5SZyscvIzzS

--HG--
extra : rebase_source : 1a2577bbe24d2d6644c3f1f5d0c47850b67fdea0
2016-05-09 14:59:02 +10:00
Alastor Wu
2d52873a0d Bug 1269672 - part2 : move audible data checking from MDSM to DecodedAudioDataSink.
MozReview-Commit-ID: 8uYJ9UA2Jf2
2016-05-12 14:18:53 +08:00
Kyle Huey
941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Carsten "Tomcat" Book
ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Kyle Huey
48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Kaku Kuo
d42d57aa97 Bug 1267983 - include MediaQueue.h; r=jwwang
MozReview-Commit-ID: ikxjE7VZsd

--HG--
extra : rebase_source : 0f8bcca3b15fade72b04982b9b4f79e130413938
2016-04-27 19:01:13 +08:00
Jean-Yves Avenard
bb9dfe8544 Bug 1264199: P9. Include pending frames in HasUnplayedFrames calculation. r=jwwang
MozReview-Commit-ID: 5m8zCe4cB2s

--HG--
extra : rebase_source : 5c33353294acfc0ec51385bf7d00fea9aa985b39
2016-04-26 00:13:01 +10:00
Jean-Yves Avenard
45a02f35c6 Bug 1264199: P6. Drain resampler when changing format or reaching the end. r=kinetik
MozReview-Commit-ID: KqcB0FYxNtC

--HG--
extra : rebase_source : 63eff5cb4d66483ecc2871440dda6bc9f73d9822
2016-04-14 15:44:02 +10:00
Jean-Yves Avenard
33f592b6a5 Bug 1264199: P5. Perform all downmixing operations in DecodedAudioDataSink. r=kinetik
Performing all audio processing operations in the same place, allows to simplify the code.

Additionally, if accessibility.monoaudio.enable is not set, we always upmix mono to stereo so that if the first audio stream seen was mono, we aren't stuck playing all future streams in mono.

MozReview-Commit-ID: 5yANN6PLFhX

--HG--
extra : rebase_source : 8b2138368d97f4ec2857c021ed9605c633282ed2
2016-04-13 20:25:50 +10:00
Jean-Yves Avenard
ec0a733d51 Bug 1264199: P3. Attempt to minimize audio quality loss and unnecessary processing. r=kinetik
We attempt to avoid unnecessary resampling of 44.1kHz and 48kHz content, for all others we use cubeb's preferred sampling rate as final sampling rate.

MozReview-Commit-ID: 413qnsDFHzY

--HG--
extra : rebase_source : ca3508aefb29e2e64e84774bddb9fe77654c8945
2016-04-13 17:55:48 +10:00
Jean-Yves Avenard
68dc5cfd31 Bug 1264199: P2. Ensure the AudioStream only ever receive the same content format. r=kinetik
The audio is automatically converted to always match the format of the first processed sample.
This is a temporary approach, as it would be preferred to use a final sampling rate not causing too much quality loss.

MozReview-Commit-ID: Lo3827aon43

--HG--
extra : rebase_source : 946eabde451a33018722cb6f1c0ca7b8c1d87009
2016-04-13 17:30:23 +10:00
Jean-Yves Avenard
fa7bd08dd2 Bug 1264199: P1. Perform audio conversion in the MSDM taskqueue and ahead of use. r=kinetik
This will allow to easily detect audio configuration change prior immediate playback.

MozReview-Commit-ID: IwDUGOd17ND

--HG--
extra : rebase_source : ef2b492cfeed5eca8fdfcb5442dedc2b65fc1d8f
2016-04-13 17:17:54 +10:00