OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/media/webrtc_audio_renderer.h" | 5 #include "content/renderer/media/webrtc_audio_renderer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 source_params.frames_per_buffer()) * frame_duration_milliseconds; | 317 source_params.frames_per_buffer()) * frame_duration_milliseconds; |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 source_ = source; | 321 source_ = source; |
322 | 322 |
323 // Configure the audio rendering client and start rendering. | 323 // Configure the audio rendering client and start rendering. |
324 sink_ = AudioDeviceFactory::NewOutputDevice( | 324 sink_ = AudioDeviceFactory::NewOutputDevice( |
325 source_render_view_id_, source_render_frame_id_); | 325 source_render_view_id_, source_render_frame_id_); |
326 | 326 |
327 // TODO(tommi): Rename InitializeUnifiedStream to rather reflect association | |
328 // with a session. | |
329 DCHECK_GE(session_id_, 0); | 327 DCHECK_GE(session_id_, 0); |
330 sink_->InitializeUnifiedStream(sink_params_, this, session_id_); | 328 sink_->InitializeWithSessionId(sink_params_, this, session_id_); |
331 | 329 |
332 sink_->Start(); | 330 sink_->Start(); |
333 | 331 |
334 // User must call Play() before any audio can be heard. | 332 // User must call Play() before any audio can be heard. |
335 state_ = PAUSED; | 333 state_ = PAUSED; |
336 | 334 |
337 UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioOutputFramesPerBuffer", | 335 UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioOutputFramesPerBuffer", |
338 source_params.frames_per_buffer(), | 336 source_params.frames_per_buffer(), |
339 kUnexpectedAudioBufferSize); | 337 kUnexpectedAudioBufferSize); |
340 AddHistogramFramesPerBuffer(source_params.frames_per_buffer()); | 338 AddHistogramFramesPerBuffer(source_params.frames_per_buffer()); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 if (RemovePlayingState(source, state)) | 581 if (RemovePlayingState(source, state)) |
584 EnterPauseState(); | 582 EnterPauseState(); |
585 } else if (AddPlayingState(source, state)) { | 583 } else if (AddPlayingState(source, state)) { |
586 EnterPlayState(); | 584 EnterPlayState(); |
587 } | 585 } |
588 UpdateSourceVolume(source); | 586 UpdateSourceVolume(source); |
589 } | 587 } |
590 } | 588 } |
591 | 589 |
592 } // namespace content | 590 } // namespace content |
OLD | NEW |