OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 17 matching lines...) Expand all Loading... |
28 // implicitly interpreted as zero. Other fields in audio_frame | 28 // implicitly interpreted as zero. Other fields in audio_frame |
29 // may be read and should contain meaningful values. | 29 // may be read and should contain meaningful values. |
30 kError // audio_frame will not be used. | 30 kError // audio_frame will not be used. |
31 }; | 31 }; |
32 | 32 |
33 struct AudioFrameWithMuted { | 33 struct AudioFrameWithMuted { |
34 AudioFrame* audio_frame; | 34 AudioFrame* audio_frame; |
35 AudioFrameInfo audio_frame_info; | 35 AudioFrameInfo audio_frame_info; |
36 }; | 36 }; |
37 | 37 |
| 38 virtual ~MixerAudioSource() = default; |
| 39 |
38 // The implementation of GetAudioFrameWithMuted should update | 40 // The implementation of GetAudioFrameWithMuted should update |
39 // audio_frame with new audio every time it's called. Implementing | 41 // audio_frame with new audio every time it's called. Implementing |
40 // classes are allowed to return the same AudioFrame pointer on | 42 // classes are allowed to return the same AudioFrame pointer on |
41 // different calls. The pointer must stay valid until the next | 43 // different calls. The pointer must stay valid until the next |
42 // mixing call or until this audio source is disconnected from the | 44 // mixing call or until this audio source is disconnected from the |
43 // mixer. | 45 // mixer. |
44 virtual AudioFrameWithMuted GetAudioFrameWithMuted(int32_t id, | 46 virtual AudioFrameWithMuted GetAudioFrameWithMuted(int32_t id, |
45 int sample_rate_hz) = 0; | 47 int sample_rate_hz) = 0; |
46 | |
47 // Returns true if the audio source was mixed this mix iteration. | |
48 bool IsMixed() const; | |
49 | |
50 // Returns true if the audio source was mixed previous mix | |
51 // iteration. | |
52 bool WasMixed() const; | |
53 | |
54 // Updates the mixed status. | |
55 int32_t SetIsMixed(bool mixed); | |
56 | |
57 void ResetMixedStatus(); | |
58 | |
59 private: | |
60 bool is_mixed_; | |
61 | |
62 protected: | |
63 MixerAudioSource(); | |
64 virtual ~MixerAudioSource(); | |
65 }; | 48 }; |
66 } // namespace webrtc | 49 } // namespace webrtc |
67 | 50 |
68 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_DEFINES_H_ | 51 #endif // WEBRTC_MODULES_AUDIO_MIXER_AUDIO_MIXER_DEFINES_H_ |
OLD | NEW |