| 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 75%
|
| copy from components/copresence/mediums/audio/audio_recorder.h
|
| copy to components/copresence/mediums/audio/audio_recorder_impl.h
|
| index 5c68eca1808b5c064be2f6426514559186b0adc8..b14edb3023c52057048cd91e86c90ad1ed35fdd9 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,22 @@ 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:
|
| + virtual void Initialize(
|
| + const RecordedSamplesCallback& decode_callback) override;
|
| + virtual void Record() override;
|
| + virtual void Stop() override;
|
| + virtual void Finalize() override;
|
| + virtual bool IsRecording() override;
|
|
|
| // Takes ownership of the stream.
|
| void set_input_stream_for_testing(
|
| @@ -55,7 +55,7 @@ class AudioRecorder : public media::AudioInputStream::AudioInputCallback,
|
| }
|
|
|
| protected:
|
| - virtual ~AudioRecorder();
|
| + virtual ~AudioRecorderImpl();
|
| void set_is_recording(bool is_recording) { is_recording_ = is_recording; }
|
|
|
| private:
|
| @@ -92,7 +92,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 +109,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_
|
|
|