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
AudioSinkWrapper.cpp
AudioSinkWrapper.h
DecodedStream.cpp
DecodedStream.h
MediaSink.h
OutputStreamManager.cpp
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
moz.build