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/media_stream_dispatcher.h" | 5 #include "content/renderer/media/media_stream_dispatcher.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "content/common/media/media_stream_messages.h" | 8 #include "content/common/media/media_stream_messages.h" |
9 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h" | 9 #include "content/renderer/media/media_stream_dispatcher_eventhandler.h" |
10 #include "content/renderer/render_thread_impl.h" | 10 #include "content/renderer/render_thread_impl.h" |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 int index) { | 396 int index) { |
397 DCHECK(thread_checker_.CalledOnValidThread()); | 397 DCHECK(thread_checker_.CalledOnValidThread()); |
398 LabelStreamMap::iterator it = label_stream_map_.find(label); | 398 LabelStreamMap::iterator it = label_stream_map_.find(label); |
399 if (it == label_stream_map_.end() || | 399 if (it == label_stream_map_.end() || |
400 it->second.video_array.size() <= static_cast<size_t>(index)) { | 400 it->second.video_array.size() <= static_cast<size_t>(index)) { |
401 return StreamDeviceInfo::kNoId; | 401 return StreamDeviceInfo::kNoId; |
402 } | 402 } |
403 return it->second.video_array[index].session_id; | 403 return it->second.video_array[index].session_id; |
404 } | 404 } |
405 | 405 |
406 bool MediaStreamDispatcher::IsAudioDuckingActive() const { | |
407 DCHECK(thread_checker_.CalledOnValidThread()); | |
408 LabelStreamMap::const_iterator stream_it = label_stream_map_.begin(); | |
409 while (stream_it != label_stream_map_.end()) { | |
410 const StreamDeviceInfoArray& audio_array = stream_it->second.audio_array; | |
411 for (StreamDeviceInfoArray::const_iterator device_it = audio_array.begin(); | |
412 device_it != audio_array.end(); ++device_it) { | |
413 if (device_it->device.input.effects & media::AudioParameters::DUCKING) | |
414 return true; | |
415 } | |
416 ++stream_it; | |
417 } | |
418 return false; | |
419 } | |
420 | |
421 } // namespace content | 406 } // namespace content |
OLD | NEW |