diff options
author | kxing@chromium.org <kxing@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-01 17:41:43 +0000 |
---|---|---|
committer | kxing@chromium.org <kxing@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-01 17:41:43 +0000 |
commit | abad505506cdee422daaeb6f3de37b15393058f8 (patch) | |
tree | e6312b9f1137989bdce6833df2f3cc19943a2e05 /remoting/codec | |
parent | ca254112419d316f0e89c92d6dc9487fc80bebf1 (diff) | |
download | chromium_src-abad505506cdee422daaeb6f3de37b15393058f8.zip chromium_src-abad505506cdee422daaeb6f3de37b15393058f8.tar.gz chromium_src-abad505506cdee422daaeb6f3de37b15393058f8.tar.bz2 |
Piping for audio encoding.
Review URL: https://chromiumcodereview.appspot.com/10836017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/codec')
-rw-r--r-- | remoting/codec/DEPS | 3 | ||||
-rw-r--r-- | remoting/codec/audio_encoder.h | 23 | ||||
-rw-r--r-- | remoting/codec/audio_encoder_verbatim.cc | 22 | ||||
-rw-r--r-- | remoting/codec/audio_encoder_verbatim.h | 29 |
4 files changed, 77 insertions, 0 deletions
diff --git a/remoting/codec/DEPS b/remoting/codec/DEPS new file mode 100644 index 0000000..9e5dc3c --- /dev/null +++ b/remoting/codec/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+google/protobuf", +] diff --git a/remoting/codec/audio_encoder.h b/remoting/codec/audio_encoder.h new file mode 100644 index 0000000..30147d6 --- /dev/null +++ b/remoting/codec/audio_encoder.h @@ -0,0 +1,23 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_CODEC_AUDIO_ENCODER_H_ +#define REMOTING_CODEC_AUDIO_ENCODER_H_ + +#include "base/memory/scoped_ptr.h" + +namespace remoting { + +class AudioPacket; + +class AudioEncoder { + public: + virtual ~AudioEncoder() {} + + virtual scoped_ptr<AudioPacket> Encode(scoped_ptr<AudioPacket> packet) = 0; +}; + +} // namespace remoting + +#endif // REMOTING_CODEC_AUDIO_ENCODER_H_ diff --git a/remoting/codec/audio_encoder_verbatim.cc b/remoting/codec/audio_encoder_verbatim.cc new file mode 100644 index 0000000..b81486b --- /dev/null +++ b/remoting/codec/audio_encoder_verbatim.cc @@ -0,0 +1,22 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "remoting/codec/audio_encoder_verbatim.h" + +#include "base/logging.h" +#include "remoting/proto/audio.pb.h" + +namespace remoting { + +AudioEncoderVerbatim::AudioEncoderVerbatim() {} + +AudioEncoderVerbatim::~AudioEncoderVerbatim() {} + +scoped_ptr<AudioPacket> AudioEncoderVerbatim::Encode( + scoped_ptr<AudioPacket> packet) { + DCHECK_EQ(AudioPacket::ENCODING_RAW, packet->encoding()); + return packet.Pass(); +} + +} // namespace remoting diff --git a/remoting/codec/audio_encoder_verbatim.h b/remoting/codec/audio_encoder_verbatim.h new file mode 100644 index 0000000..d3bc9ca --- /dev/null +++ b/remoting/codec/audio_encoder_verbatim.h @@ -0,0 +1,29 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef REMOTING_CODEC_AUDIO_ENCODER_VERBATIM_H_ +#define REMOTING_CODEC_AUDIO_ENCODER_VERBATIM_H_ + +#include "remoting/codec/audio_encoder.h" + +namespace remoting { + +class AudioPacket; + +class AudioEncoderVerbatim : public AudioEncoder { + public: + AudioEncoderVerbatim(); + virtual ~AudioEncoderVerbatim(); + + // AudioEncoder implementation. + virtual scoped_ptr<AudioPacket> Encode( + scoped_ptr<AudioPacket> packet) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(AudioEncoderVerbatim); +}; + +} // namespace remoting + +#endif // REMOTING_CODEC_AUDIO_ENCODER_VERBATIM_H_ |