gecko-dev/dom/media/mediasink
Chris Pearce 2be26b6b7c Bug 1443942 - Move code to toggle high res timers into VideoSink. r=jya
We have code in the MDSM to toggle on high resolution timers on Windows when we
start/stop playing because the VideoSink relies on being awoken by timers to
update the set of current frames in the compositor's queue, and on Windows 7 we
end up dropping frames due to the timer lag without this.

We assert in the MDSM's destructor that we've turned off high res timers (as
they cause needless battery drain, so we only want them on when we need them),
and the new test_mediarecorder_principals is hitting that assert on Windows. I
think we're missing turning them off when we create a new VideoSink for
outputting to the MSG. That affects the value returned by
MediaDecoderStateMachine->mVideoSink->IsPlaying(), which is what we use to
decide whether we should enable high resolution timers. We track whether we've
enabled high res timers in MDSM::mHiResTimersRequested, and that gets out of
sync with IsPlaying() when we re-create the MediaSink.

Rather than trying to handle all the permutations of places where we need to
turn off high resolution timers in the MDSM, we're better to move the code to
toggle high res timers into the VideoSink, as that's actually where we need to
be sure that we have high resolution timers enabled anyway. It's the VideoSink
after all that is relying on timers for frame update, not the MDSM.

Also remove the media.hi-res-timers.enabled pref, as we haven't needed it.

MozReview-Commit-ID: 9dNxcYxPDZH

--HG--
extra : rebase_source : 6e403d59bb5f1dd0241fe8298a823ba08b1670fb
2018-04-06 13:33:28 +12:00
..
AudioSink.cpp Bug 1431810 - Disable Opus phase inversion on stereo to mono downmix. r=rillian 2018-03-15 18:28:14 +02:00
AudioSink.h Bug 1412212. P3 - also dump debug info of AudioSink. r=JamesCheng 2017-10-27 15:36:24 +08:00
AudioSinkWrapper.cpp Bug 1414991 - Unified build fixes in media. r=gerald 2017-11-07 12:57:34 +13:00
AudioSinkWrapper.h Bug 1412212. P3 - also dump debug info of AudioSink. r=JamesCheng 2017-10-27 15:36:24 +08:00
DecodedStream.cpp Bug 1404997 - P14. Rename members to clarify the finish meaning. r=padenot 2017-12-06 19:00:22 +01:00
DecodedStream.h Bug 1388125 - CloneableWithRangeMediaResource for streams implementing nsICloneableInputStreamWithRange, r=jya 2017-09-18 13:34:43 +02:00
MediaSink.h Bug 1350826 - Replace use of int64_t for microseconds by TimeUnit in MediaSink and its sub-classes. r=kaku 2017-03-27 14:55:05 +08:00
moz.build Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
OutputStreamManager.cpp Bug 1404997 - P14. Rename members to clarify the finish meaning. r=padenot 2017-12-06 19:00:22 +01:00
OutputStreamManager.h
VideoSink.cpp Bug 1443942 - Move code to toggle high res timers into VideoSink. r=jya 2018-04-06 13:33:28 +12:00
VideoSink.h Bug 1443942 - Move code to toggle high res timers into VideoSink. r=jya 2018-04-06 13:33:28 +12:00