2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_AUDIO_ENCODER_OPUS_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_AUDIO_ENCODER_OPUS_H_
16 #include "webrtc/modules/audio_coding/codecs/opus/interface/opus_interface.h"
17 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
21 class AudioEncoderOpus : public AudioEncoder {
30 explicit AudioEncoderOpus(const Config& config);
31 virtual ~AudioEncoderOpus() OVERRIDE;
33 virtual int sample_rate_hz() const OVERRIDE;
34 virtual int num_channels() const OVERRIDE;
35 virtual int Num10MsFramesInNextPacket() const OVERRIDE;
38 virtual bool Encode(uint32_t timestamp,
40 size_t max_encoded_bytes,
42 size_t* encoded_bytes,
43 uint32_t* encoded_timestamp) OVERRIDE;
46 const int num_10ms_frames_per_packet_;
47 const int num_channels_;
48 const int samples_per_10ms_frame_;
49 std::vector<int16_t> input_buffer_;
51 uint32_t first_timestamp_in_buffer_;
55 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_OPUS_INTERFACE_AUDIO_ENCODER_OPUS_H_