summaryrefslogtreecommitdiffstats
path: root/remoting/codec
diff options
context:
space:
mode:
authorkxing@chromium.org <kxing@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 17:41:43 +0000
committerkxing@chromium.org <kxing@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-01 17:41:43 +0000
commitabad505506cdee422daaeb6f3de37b15393058f8 (patch)
treee6312b9f1137989bdce6833df2f3cc19943a2e05 /remoting/codec
parentca254112419d316f0e89c92d6dc9487fc80bebf1 (diff)
downloadchromium_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/DEPS3
-rw-r--r--remoting/codec/audio_encoder.h23
-rw-r--r--remoting/codec/audio_encoder_verbatim.cc22
-rw-r--r--remoting/codec/audio_encoder_verbatim.h29
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_