OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "webrtc/base/sigslot.h" | 33 #include "webrtc/base/sigslot.h" |
34 #include "webrtc/base/thread.h" | 34 #include "webrtc/base/thread.h" |
35 | 35 |
36 namespace cricket { | 36 namespace cricket { |
37 | 37 |
38 class VoiceChannel; | 38 class VoiceChannel; |
39 | 39 |
40 struct AudioInfo { | 40 struct AudioInfo { |
41 int input_level; | 41 int input_level; |
42 int output_level; | 42 int output_level; |
43 typedef std::vector<std::pair<uint32, int> > StreamList; | 43 typedef std::vector<std::pair<uint32_t, int> > StreamList; |
44 StreamList active_streams; // ssrcs contributing to output_level | 44 StreamList active_streams; // ssrcs contributing to output_level |
45 }; | 45 }; |
46 | 46 |
47 class AudioMonitor : public rtc::MessageHandler, | 47 class AudioMonitor : public rtc::MessageHandler, |
48 public sigslot::has_slots<> { | 48 public sigslot::has_slots<> { |
49 public: | 49 public: |
50 AudioMonitor(VoiceChannel* voice_channel, rtc::Thread *monitor_thread); | 50 AudioMonitor(VoiceChannel* voice_channel, rtc::Thread *monitor_thread); |
51 ~AudioMonitor(); | 51 ~AudioMonitor(); |
52 | 52 |
53 void Start(int cms); | 53 void Start(int cms); |
54 void Stop(); | 54 void Stop(); |
55 | 55 |
56 VoiceChannel* voice_channel(); | 56 VoiceChannel* voice_channel(); |
57 rtc::Thread *monitor_thread(); | 57 rtc::Thread *monitor_thread(); |
58 | 58 |
59 sigslot::signal2<AudioMonitor*, const AudioInfo&> SignalUpdate; | 59 sigslot::signal2<AudioMonitor*, const AudioInfo&> SignalUpdate; |
60 | 60 |
61 protected: | 61 protected: |
62 void OnMessage(rtc::Message *message); | 62 void OnMessage(rtc::Message *message); |
63 void PollVoiceChannel(); | 63 void PollVoiceChannel(); |
64 | 64 |
65 AudioInfo audio_info_; | 65 AudioInfo audio_info_; |
66 VoiceChannel* voice_channel_; | 66 VoiceChannel* voice_channel_; |
67 rtc::Thread* monitoring_thread_; | 67 rtc::Thread* monitoring_thread_; |
68 rtc::CriticalSection crit_; | 68 rtc::CriticalSection crit_; |
69 uint32 rate_; | 69 uint32_t rate_; |
70 bool monitoring_; | 70 bool monitoring_; |
71 }; | 71 }; |
72 | 72 |
73 } | 73 } |
74 | 74 |
75 #endif // TALK_SESSION_MEDIA_AUDIOMONITOR_H_ | 75 #endif // TALK_SESSION_MEDIA_AUDIOMONITOR_H_ |
OLD | NEW |