Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: webrtc/api/audio_codecs/opus/audio_encoder_opus_config.h

Issue 2930243003: Opus implementation of the AudioEncoderFactoryTemplate API (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_API_AUDIO_CODECS_OPUS_AUDIO_ENCODER_OPUS_CONFIG_H_
12 #define WEBRTC_API_AUDIO_CODECS_OPUS_AUDIO_ENCODER_OPUS_CONFIG_H_
13
14 #include <stddef.h>
15
16 #include <vector>
17
18 namespace webrtc {
19
20 // NOTE: This struct is still under development and may change without notice.
21 struct AudioEncoderOpusConfig {
ossu 2017/06/16 09:53:53 Why is AudioEncoderOpusConfig separate from AudioE
kwiberg-webrtc 2017/06/16 12:44:14 They need to be in separate build targets, because
ossu 2017/06/16 13:18:27 Ah, right!
22 static constexpr int kDefaultFrameSizeMs = 20;
23
24 // Opus API allows a min bitrate of 500bps, but Opus documentation suggests
25 // bitrate should be in the range of 6000 to 510000, inclusive.
26 static constexpr int kMinBitrateBps = 6000;
27 static constexpr int kMaxBitrateBps = 510000;
28
29 AudioEncoderOpusConfig();
30 AudioEncoderOpusConfig(const AudioEncoderOpusConfig&);
31 ~AudioEncoderOpusConfig();
32 AudioEncoderOpusConfig& operator=(const AudioEncoderOpusConfig&);
33
34 bool IsOk() const; // Checks if the values are currently OK.
35
36 int frame_size_ms;
37 size_t num_channels;
38 enum class ApplicationMode { kVoip, kAudio };
39 ApplicationMode application;
40 int bitrate_bps;
41 bool fec_enabled;
42 bool cbr_enabled;
43 int max_playback_rate_hz;
44
45 // |complexity| is used when the bitrate goes above
46 // |complexity_threshold_bps| + |complexity_threshold_window_bps|;
47 // |low_rate_complexity| is used when the bitrate falls below
48 // |complexity_threshold_bps| - |complexity_threshold_window_bps|. In the
49 // interval in the middle, we keep using the most recent of the two
50 // complexity settings.
51 int complexity;
52 int low_rate_complexity;
53 int complexity_threshold_bps;
54 int complexity_threshold_window_bps;
55
56 bool dtx_enabled;
57 std::vector<int> supported_frame_lengths_ms;
58 int uplink_bandwidth_update_interval_ms;
59 };
60
61 } // namespace webrtc
62
63 #endif // WEBRTC_API_AUDIO_CODECS_OPUS_AUDIO_ENCODER_OPUS_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698