Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1123)

Unified Diff: components/copresence/mediums/audio/audio_recorder_impl.h

Issue 637223011: Redesign the copresence audio handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/copresence/mediums/audio/audio_recorder_impl.h
diff --git a/components/copresence/mediums/audio/audio_recorder.h b/components/copresence/mediums/audio/audio_recorder_impl.h
similarity index 76%
copy from components/copresence/mediums/audio/audio_recorder.h
copy to components/copresence/mediums/audio/audio_recorder_impl.h
index e554f01bd2aa73849864d96a524eec6879387482..7ef27908af07779e357cd3f6216a5759074c3ad6 100644
--- a/components/copresence/mediums/audio/audio_recorder.h
+++ b/components/copresence/mediums/audio/audio_recorder_impl.h
@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_RECORDER_H_
-#define COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_RECORDER_H_
+#ifndef COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_RECORDER_IMPL_H_
+#define COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_RECORDER_IMPL_H_
#include <string>
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
+#include "components/copresence/mediums/audio/audio_recorder.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_parameters.h"
#include "media/base/audio_converter.h"
@@ -25,23 +26,21 @@ class AudioBus;
namespace copresence {
// The AudioRecorder class will record audio until told to stop.
-class AudioRecorder : public media::AudioInputStream::AudioInputCallback,
- public media::AudioConverter::InputCallback {
+class AudioRecorderImpl final
+ : public AudioRecorder,
+ public media::AudioInputStream::AudioInputCallback,
+ public media::AudioConverter::InputCallback {
public:
- typedef base::Callback<void(const std::string&)> DecodeSamplesCallback;
+ typedef base::Callback<void(const std::string&)> RecordedSamplesCallback;
- explicit AudioRecorder(const DecodeSamplesCallback& decode_callback);
+ AudioRecorderImpl();
- // Initializes the object. Do not use this object before calling this method.
- virtual void Initialize();
-
- virtual void Record();
- virtual void Stop();
-
- // Cleans up and deletes this object. Do not use object after this call.
- virtual void Finalize();
-
- bool IsRecording();
+ // AudioRecorder overrides:
+ void Initialize(const RecordedSamplesCallback& decode_callback) override;
+ void Record() override;
+ void Stop() override;
+ void Finalize() override;
+ bool IsRecording() override;
// Takes ownership of the stream.
void set_input_stream_for_testing(
@@ -55,7 +54,7 @@ class AudioRecorder : public media::AudioInputStream::AudioInputCallback,
}
protected:
- ~AudioRecorder() override;
+ virtual ~AudioRecorderImpl();
void set_is_recording(bool is_recording) { is_recording_ = is_recording; }
private:
@@ -92,7 +91,8 @@ class AudioRecorder : public media::AudioInputStream::AudioInputCallback,
bool is_recording_;
media::AudioInputStream* stream_;
- DecodeSamplesCallback decode_callback_;
+
+ RecordedSamplesCallback decode_callback_;
// ProvideInput will use this buffer as its source.
const media::AudioBus* temp_conversion_buffer_;
@@ -108,9 +108,9 @@ class AudioRecorder : public media::AudioInputStream::AudioInputCallback,
scoped_ptr<media::AudioInputStream> input_stream_for_testing_;
scoped_ptr<media::AudioParameters> params_for_testing_;
- DISALLOW_COPY_AND_ASSIGN(AudioRecorder);
+ DISALLOW_COPY_AND_ASSIGN(AudioRecorderImpl);
};
} // namespace copresence
-#endif // COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_RECORDER_H_
+#endif // COMPONENTS_COPRESENCE_MEDIUMS_AUDIO_AUDIO_RECORDER_IMPL_H_
« no previous file with comments | « components/copresence/mediums/audio/audio_recorder.cc ('k') | components/copresence/mediums/audio/audio_recorder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698