OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2014 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 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" | |
12 | |
13 #include "webrtc/base/checks.h" | |
14 #include "webrtc/base/trace_event.h" | |
15 | |
16 namespace webrtc { | |
17 | |
18 AudioEncoder::EncodedInfo::EncodedInfo() = default; | |
19 AudioEncoder::EncodedInfo::EncodedInfo(const EncodedInfo&) = default; | |
20 AudioEncoder::EncodedInfo::EncodedInfo(EncodedInfo&&) = default; | |
21 AudioEncoder::EncodedInfo::~EncodedInfo() = default; | |
22 AudioEncoder::EncodedInfo& AudioEncoder::EncodedInfo::operator=( | |
23 const EncodedInfo&) = default; | |
24 AudioEncoder::EncodedInfo& AudioEncoder::EncodedInfo::operator=(EncodedInfo&&) = | |
25 default; | |
26 | |
27 int AudioEncoder::RtpTimestampRateHz() const { | |
28 return SampleRateHz(); | |
29 } | |
30 | |
31 AudioEncoder::EncodedInfo AudioEncoder::Encode( | |
32 uint32_t rtp_timestamp, | |
33 rtc::ArrayView<const int16_t> audio, | |
34 rtc::Buffer* encoded) { | |
35 TRACE_EVENT0("webrtc", "AudioEncoder::Encode"); | |
36 RTC_CHECK_EQ(audio.size(), | |
37 static_cast<size_t>(NumChannels() * SampleRateHz() / 100)); | |
38 | |
39 const size_t old_size = encoded->size(); | |
40 EncodedInfo info = EncodeImpl(rtp_timestamp, audio, encoded); | |
41 RTC_CHECK_EQ(encoded->size() - old_size, info.encoded_bytes); | |
42 return info; | |
43 } | |
44 | |
45 bool AudioEncoder::SetFec(bool enable) { | |
46 return !enable; | |
47 } | |
48 | |
49 bool AudioEncoder::SetDtx(bool enable) { | |
50 return !enable; | |
51 } | |
52 | |
53 bool AudioEncoder::GetDtx() const { | |
54 return false; | |
55 } | |
56 | |
57 bool AudioEncoder::SetApplication(Application application) { | |
58 return false; | |
59 } | |
60 | |
61 void AudioEncoder::SetMaxPlaybackRate(int frequency_hz) {} | |
62 | |
63 void AudioEncoder::SetTargetBitrate(int target_bps) {} | |
64 | |
65 rtc::ArrayView<std::unique_ptr<AudioEncoder>> | |
66 AudioEncoder::ReclaimContainedEncoders() { return nullptr; } | |
67 | |
68 bool AudioEncoder::EnableAudioNetworkAdaptor(const std::string& config_string, | |
69 RtcEventLog* event_log, | |
70 const Clock* clock) { | |
71 return false; | |
72 } | |
73 | |
74 void AudioEncoder::DisableAudioNetworkAdaptor() {} | |
75 | |
76 void AudioEncoder::OnReceivedUplinkPacketLossFraction( | |
77 float uplink_packet_loss_fraction) {} | |
78 | |
79 void AudioEncoder::OnReceivedUplinkRecoverablePacketLossFraction( | |
80 float uplink_recoverable_packet_loss_fraction) {} | |
81 | |
82 void AudioEncoder::OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps) { | |
83 OnReceivedUplinkBandwidth(target_audio_bitrate_bps, rtc::Optional<int64_t>()); | |
84 } | |
85 | |
86 void AudioEncoder::OnReceivedUplinkBandwidth( | |
87 int target_audio_bitrate_bps, | |
88 rtc::Optional<int64_t> probing_interval_ms) {} | |
89 | |
90 void AudioEncoder::OnReceivedRtt(int rtt_ms) {} | |
91 | |
92 void AudioEncoder::OnReceivedOverhead(size_t overhead_bytes_per_packet) {} | |
93 | |
94 void AudioEncoder::SetReceiverFrameLengthRange(int min_frame_length_ms, | |
95 int max_frame_length_ms) {} | |
96 | |
97 } // namespace webrtc | |
OLD | NEW |