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 11 matching lines...) Expand all Loading... |
22 class MixerAudioSource { | 22 class MixerAudioSource { |
23 public: | 23 public: |
24 enum class AudioFrameInfo { | 24 enum class AudioFrameInfo { |
25 kNormal, // The samples in audio_frame are valid and should be used. | 25 kNormal, // The samples in audio_frame are valid and should be used. |
26 kMuted, // The samples in audio_frame should not be used, but should be | 26 kMuted, // The samples in audio_frame should not be used, but should be |
27 // implicitly interpreted as zero. Other fields in audio_frame | 27 // implicitly interpreted as zero. Other fields in audio_frame |
28 // may be read and should contain meaningful values. | 28 // may be read and should contain meaningful values. |
29 kError // audio_frame will not be used. | 29 kError // audio_frame will not be used. |
30 }; | 30 }; |
31 | 31 |
32 struct AudioFrameWithInfo { | 32 struct AudioFrameWithMuted { |
33 AudioFrame* audio_frame; | 33 AudioFrame* audio_frame; |
34 AudioFrameInfo audio_frame_info; | 34 AudioFrameInfo audio_frame_info; |
35 }; | 35 }; |
36 | 36 |
37 // The implementation of GetAudioFrameWithMuted should update | 37 // The implementation of GetAudioFrameWithMuted should update |
38 // audio_frame with new audio every time it's called. Implementing | 38 // audio_frame with new audio every time it's called. Implementing |
39 // classes are allowed to return the same AudioFrame pointer on | 39 // classes are allowed to return the same AudioFrame pointer on |
40 // different calls. The pointer must stay valid until the next | 40 // different calls. The pointer must stay valid until the next |
41 // mixing call or until this audio source is disconnected from the | 41 // mixing call or until this audio source is disconnected from the |
42 // mixer. | 42 // mixer. |
43 virtual AudioFrameWithInfo GetAudioFrameWithMuted(int32_t id, | 43 virtual AudioFrameWithMuted GetAudioFrameWithMuted(int32_t id, |
44 int sample_rate_hz) = 0; | 44 int sample_rate_hz) = 0; |
45 | 45 |
46 // Returns true if the participant was mixed this mix iteration. | 46 // Returns true if the participant was mixed this mix iteration. |
47 bool IsMixed() const; | 47 bool IsMixed() const; |
48 | 48 |
49 // This function specifies the sampling frequency needed for the AudioFrame | 49 // This function specifies the sampling frequency needed for the AudioFrame |
50 // for future GetAudioFrame(..) calls. | 50 // for future GetAudioFrame(..) calls. |
51 virtual int32_t NeededFrequency(int32_t id) const = 0; | 51 virtual int32_t NeededFrequency(int32_t id) const = 0; |
52 | 52 |
53 NewMixHistory* _mixHistory; | 53 NewMixHistory* _mixHistory; |
54 | 54 |
55 protected: | 55 protected: |
56 MixerAudioSource(); | 56 MixerAudioSource(); |
57 virtual ~MixerAudioSource(); | 57 virtual ~MixerAudioSource(); |
58 }; | 58 }; |
59 } // namespace webrtc | 59 } // namespace webrtc |
60 | 60 |
61 #endif // WEBRTC_MODULES_AUDIO_MIXER_INCLUDE_AUDIO_MIXER_DEFINES_H_ | 61 #endif // WEBRTC_MODULES_AUDIO_MIXER_INCLUDE_AUDIO_MIXER_DEFINES_H_ |
OLD | NEW |