| Index: content/renderer/media/webrtc/webrtc_audio_sink_adapter.h
|
| diff --git a/content/renderer/media/webrtc/webrtc_audio_sink_adapter.h b/content/renderer/media/webrtc/webrtc_audio_sink_adapter.h
|
| index 4e70d194b5a0eb141b661713ea2dea62b91ad57a..214a1602ace7dd24a935ca52cf7e6dcd0c3c5b67 100644
|
| --- a/content/renderer/media/webrtc/webrtc_audio_sink_adapter.h
|
| +++ b/content/renderer/media/webrtc/webrtc_audio_sink_adapter.h
|
| @@ -11,6 +11,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "content/public/renderer/media_stream_audio_sink.h"
|
| #include "media/audio/audio_parameters.h"
|
| +#include "media/base/audio_rechunker.h"
|
|
|
| namespace webrtc {
|
| class AudioTrackSinkInterface;
|
| @@ -21,7 +22,8 @@ namespace content {
|
| // Adapter to the webrtc::AudioTrackSinkInterface of the audio track.
|
| // This class is used in between the MediaStreamAudioSink and
|
| // webrtc::AudioTrackSinkInterface. It gets data callback via the
|
| -// MediaStreamAudioSink::OnData() interface and pass the data to
|
| +// MediaStreamAudioSink::OnData() interface, re-chunks the data into the
|
| +// required 10 ms chunks if needed, and passes the data to WebRTC via the
|
| // webrtc::AudioTrackSinkInterface.
|
| class WebRtcAudioSinkAdapter : public MediaStreamAudioSink {
|
| public:
|
| @@ -37,9 +39,13 @@ class WebRtcAudioSinkAdapter : public MediaStreamAudioSink {
|
| base::TimeTicks estimated_capture_time) override;
|
| void OnSetFormat(const media::AudioParameters& params) override;
|
|
|
| - webrtc::AudioTrackSinkInterface* const sink_;
|
| + // Called by AudioRechunker zero or more times during the call to
|
| + // OnData(). Delivers audio data in 10 ms chunks to |sink_|.
|
| + void DeliverRechunkedAudio(const media::AudioBus& audio_bus,
|
| + base::TimeDelta timestamp);
|
|
|
| - media::AudioParameters params_;
|
| + webrtc::AudioTrackSinkInterface* const sink_;
|
| + media::AudioRechunker rechunker_;
|
| scoped_ptr<int16_t[]> interleaved_data_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(WebRtcAudioSinkAdapter);
|
|
|