blob: 1e87eee80e33e59a3cb0ad52562c31132dccd30b [file] [log] [blame]
[email protected]abad5052012-08-01 17:41:431// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "remoting/codec/audio_encoder_verbatim.h"
6
7#include "base/logging.h"
8#include "remoting/proto/audio.pb.h"
9
10namespace remoting {
11
12AudioEncoderVerbatim::AudioEncoderVerbatim() {}
13
14AudioEncoderVerbatim::~AudioEncoderVerbatim() {}
15
dcheng0765c492016-04-06 22:41:5316std::unique_ptr<AudioPacket> AudioEncoderVerbatim::Encode(
17 std::unique_ptr<AudioPacket> packet) {
[email protected]abad5052012-08-01 17:41:4318 DCHECK_EQ(AudioPacket::ENCODING_RAW, packet->encoding());
[email protected]a88e2db2012-08-16 01:59:4919 DCHECK_EQ(1, packet->data_size());
[email protected]922ecc32012-08-21 16:42:3020 DCHECK_NE(AudioPacket::SAMPLING_RATE_INVALID, packet->sampling_rate());
21 DCHECK_NE(AudioPacket::BYTES_PER_SAMPLE_INVALID, packet->bytes_per_sample());
22 DCHECK_NE(AudioPacket::CHANNELS_INVALID, packet->channels());
sergeyu42ad7c02015-12-24 00:20:5123 return packet;
[email protected]abad5052012-08-01 17:41:4324}
25
sergeyu22931b52015-02-17 22:16:2026int AudioEncoderVerbatim::GetBitrate() {
27 return AudioPacket::SAMPLING_RATE_48000 * AudioPacket::BYTES_PER_SAMPLE_2 *
28 AudioPacket::CHANNELS_STEREO * 8;
29}
30
[email protected]abad5052012-08-01 17:41:4331} // namespace remoting