MediaStream audio rendering: Bypass audio processing for non-WebRTC cases.

This change renames WebRtcLocalAudioRenderer to TrackAudioRenderer and
re-purposes it for rendering all local MediaStream audio tracks, and
non-PeerConnection/WebRTC-sourced remote audio tracks (e.g., Cast
Streaming).  In addition, a number of small functional changes were made
to fix audio glitching, especially surrounding Start/Stop/Mute
operations:

1. Improved accuracy of GetCurrentRenderTime(), based on audio sample
counts rather than using the system clock.

2. Removed the stopping of audio render on mute.  This would cause the
video player to freeze the video unintentionally.

3. Drop/re-create AudioShifter on any pause-then-play, audio format
change, or output device change.  The existing Flush() mechanic was
causing weird time-shifting effects when the audio data flow was
restarted due to retaining the old timing data history.

4. Corrected a timing calculation in the playout_time passed to
AudioShifter::Pull().  Since the playout_time is supposed to be "in the
future," the correct timestamp should be "now plus audio delay" and not
"now minus audio delay."

5. Removed legacy call to GetOptimalBufferSize() for the audio output
buffer size.  After reviewing the history on this code, I believe it
was probably just masked issues that were recently resolved by
AudioShifter.  Testing demonstrated the extra buffering was not
needed.

Other changes: Clarified and refreshed documentative code comments.  Code
clean-ups in media_stream_renderer_factory_impl.cc (e.g., removed output
argument in favor of a return value).

Testing:

1. Connected a chrome.tabCapture.capture() MediaStream to a local VIDEO
element and confirmed reliable playback with good AV sync.

2. Using https://webrtc.github.io/samples/src/content/peerconnection/pc1/
to confirm the WebRTC use case was not broken.

3. Cast Streaming loopback testing (using a simple test extension).

BUG=577881, 577874

Review URL: https://codereview.chromium.org/1633423002

Cr-Commit-Position: refs/heads/master@{#374766}
8 files changed