blob: 8974cf18bc71ceb17025360fb9104a3ae8057a75 [file] [log] [blame]
henrik.lundin@webrtc.orgc1c92912014-12-16 13:41:36 +00001/*
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"
henrik.lundin@webrtc.orgf45c8ca2015-02-05 18:29:39 +000012#include "webrtc/base/checks.h"
henrik.lundin@webrtc.orgc1c92912014-12-16 13:41:36 +000013
14namespace webrtc {
15
kwiberg12cfc9b2015-09-08 05:57:53 -070016AudioEncoder::EncodedInfo::EncodedInfo() = default;
henrik.lundin@webrtc.orgc1c92912014-12-16 13:41:36 +000017
kwiberg12cfc9b2015-09-08 05:57:53 -070018AudioEncoder::EncodedInfo::~EncodedInfo() = default;
19
20int AudioEncoder::RtpTimestampRateHz() const {
21 return SampleRateHz();
henrik.lundin@webrtc.orgc1c92912014-12-16 13:41:36 +000022}
23
jmarusic@webrtc.org9afaee72015-03-19 08:50:26 +000024AudioEncoder::EncodedInfo AudioEncoder::Encode(uint32_t rtp_timestamp,
25 const int16_t* audio,
26 size_t num_samples_per_channel,
27 size_t max_encoded_bytes,
28 uint8_t* encoded) {
henrik.lundin@webrtc.orgf45c8ca2015-02-05 18:29:39 +000029 CHECK_EQ(num_samples_per_channel,
kwiberg@webrtc.org05211272015-02-18 12:00:32 +000030 static_cast<size_t>(SampleRateHz() / 100));
jmarusic@webrtc.org9afaee72015-03-19 08:50:26 +000031 EncodedInfo info =
32 EncodeInternal(rtp_timestamp, audio, max_encoded_bytes, encoded);
33 CHECK_LE(info.encoded_bytes, max_encoded_bytes);
34 return info;
henrik.lundin@webrtc.orgf45c8ca2015-02-05 18:29:39 +000035}
36
kwiberg12cfc9b2015-09-08 05:57:53 -070037bool AudioEncoder::SetFec(bool enable) {
38 return !enable;
henrik.lundin@webrtc.org478cedc2015-01-27 18:24:45 +000039}
40
kwiberg12cfc9b2015-09-08 05:57:53 -070041bool AudioEncoder::SetDtx(bool enable) {
42 return !enable;
43}
44
45bool AudioEncoder::SetApplication(Application application) {
46 return false;
47}
48
kwiberg3f5f1c22015-09-08 23:15:33 -070049void AudioEncoder::SetMaxPlaybackRate(int frequency_hz) {}
kwiberg12cfc9b2015-09-08 05:57:53 -070050
51void AudioEncoder::SetProjectedPacketLossRate(double fraction) {}
52
53void AudioEncoder::SetTargetBitrate(int target_bps) {}
54
55void AudioEncoder::SetMaxBitrate(int max_bps) {}
56
57void AudioEncoder::SetMaxPayloadSize(int max_payload_size_bytes) {}
58
henrik.lundin@webrtc.orgc1c92912014-12-16 13:41:36 +000059} // namespace webrtc