OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 | 47 |
48 std::string name; | 48 std::string name; |
49 int clockrate_hz; | 49 int clockrate_hz; |
50 int num_channels; | 50 int num_channels; |
51 Parameters parameters; | 51 Parameters parameters; |
52 }; | 52 }; |
53 | 53 |
54 void swap(SdpAudioFormat& a, SdpAudioFormat& b); | 54 void swap(SdpAudioFormat& a, SdpAudioFormat& b); |
55 std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf); | 55 std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf); |
56 | 56 |
| 57 // To avoid API breakage, and make the code clearer, AudioCodecSpec should not |
| 58 // be directly initializable with any flags indicating optional support. If it |
| 59 // were, these initializers would break any time a new flag was added. It's also |
| 60 // more difficult to understand: |
| 61 // AudioCodecSpec spec{{"format", 8000, 1}, true, false, false, true, true}; |
| 62 // than |
| 63 // AudioCodecSpec spec({"format", 8000, 1}); |
| 64 // spec.allow_comfort_noise = true; |
| 65 // spec.future_flag_b = true; |
| 66 // spec.future_flag_c = true; |
57 struct AudioCodecSpec { | 67 struct AudioCodecSpec { |
| 68 explicit AudioCodecSpec(const SdpAudioFormat& format); |
| 69 explicit AudioCodecSpec(SdpAudioFormat&& format); |
| 70 ~AudioCodecSpec() = default; |
| 71 |
58 SdpAudioFormat format; | 72 SdpAudioFormat format; |
59 bool allow_comfort_noise; // This encoder can be used with an external | 73 bool allow_comfort_noise = true; // This codec can be used with an external |
60 // comfort noise generator. | 74 // comfort noise generator. |
| 75 bool supports_network_adaption = false; // This codec can adapt to varying |
| 76 // network conditions. |
61 }; | 77 }; |
62 | 78 |
63 } // namespace webrtc | 79 } // namespace webrtc |
64 | 80 |
65 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_FORMAT_H_ | 81 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_FORMAT_H_ |
OLD | NEW |