OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 public: | 47 public: |
48 CurrentSpeakerMonitor(AudioSourceContext* audio_source_context); | 48 CurrentSpeakerMonitor(AudioSourceContext* audio_source_context); |
49 ~CurrentSpeakerMonitor(); | 49 ~CurrentSpeakerMonitor(); |
50 | 50 |
51 void Start(); | 51 void Start(); |
52 void Stop(); | 52 void Stop(); |
53 | 53 |
54 // Used by tests. Note that the actual minimum time between switches | 54 // Used by tests. Note that the actual minimum time between switches |
55 // enforced by the monitor will be the given value plus or minus the | 55 // enforced by the monitor will be the given value plus or minus the |
56 // resolution of the system clock. | 56 // resolution of the system clock. |
57 void set_min_time_between_switches(uint32_t min_time_between_switches); | 57 void set_min_time_between_switches(int min_time_between_switches); |
58 | 58 |
59 // This is fired when the current speaker changes, and provides his audio | 59 // This is fired when the current speaker changes, and provides his audio |
60 // SSRC. This only fires after the audio monitor on the underlying | 60 // SSRC. This only fires after the audio monitor on the underlying |
61 // AudioSourceContext has been started. | 61 // AudioSourceContext has been started. |
62 sigslot::signal2<CurrentSpeakerMonitor*, uint32_t> SignalUpdate; | 62 sigslot::signal2<CurrentSpeakerMonitor*, uint32_t> SignalUpdate; |
63 | 63 |
64 private: | 64 private: |
65 void OnAudioMonitor(AudioSourceContext* audio_source_context, | 65 void OnAudioMonitor(AudioSourceContext* audio_source_context, |
66 const AudioInfo& info); | 66 const AudioInfo& info); |
67 void OnMediaStreamsUpdate(AudioSourceContext* audio_source_context, | 67 void OnMediaStreamsUpdate(AudioSourceContext* audio_source_context, |
(...skipping 11 matching lines...) Expand all Loading... |
79 SS_WAS_SPEAKING_RECENTLY1, | 79 SS_WAS_SPEAKING_RECENTLY1, |
80 SS_WAS_SPEAKING_RECENTLY2 | 80 SS_WAS_SPEAKING_RECENTLY2 |
81 }; | 81 }; |
82 | 82 |
83 bool started_; | 83 bool started_; |
84 AudioSourceContext* audio_source_context_; | 84 AudioSourceContext* audio_source_context_; |
85 std::map<uint32_t, SpeakingState> ssrc_to_speaking_state_map_; | 85 std::map<uint32_t, SpeakingState> ssrc_to_speaking_state_map_; |
86 uint32_t current_speaker_ssrc_; | 86 uint32_t current_speaker_ssrc_; |
87 // To prevent overswitching, switching is disabled for some time after a | 87 // To prevent overswitching, switching is disabled for some time after a |
88 // switch is made. This gives us the earliest time a switch is permitted. | 88 // switch is made. This gives us the earliest time a switch is permitted. |
89 uint32_t earliest_permitted_switch_time_; | 89 int64_t earliest_permitted_switch_time_; |
90 uint32_t min_time_between_switches_; | 90 int min_time_between_switches_; |
91 }; | 91 }; |
92 | 92 |
93 } | 93 } |
94 | 94 |
95 #endif // TALK_SESSION_MEDIA_CURRENTSPEAKERMONITOR_H_ | 95 #endif // TALK_SESSION_MEDIA_CURRENTSPEAKERMONITOR_H_ |
OLD | NEW |