| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ | 6 #define CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // threading subtleties, see the implementation file. | 30 // threading subtleties, see the implementation file. |
| 31 class CONTENT_EXPORT AudioTrackRecorder | 31 class CONTENT_EXPORT AudioTrackRecorder |
| 32 : NON_EXPORTED_BASE(public MediaStreamAudioSink) { | 32 : NON_EXPORTED_BASE(public MediaStreamAudioSink) { |
| 33 public: | 33 public: |
| 34 using OnEncodedAudioCB = | 34 using OnEncodedAudioCB = |
| 35 base::Callback<void(const media::AudioParameters& params, | 35 base::Callback<void(const media::AudioParameters& params, |
| 36 scoped_ptr<std::string> encoded_data, | 36 scoped_ptr<std::string> encoded_data, |
| 37 base::TimeTicks capture_time)>; | 37 base::TimeTicks capture_time)>; |
| 38 | 38 |
| 39 AudioTrackRecorder(const blink::WebMediaStreamTrack& track, | 39 AudioTrackRecorder(const blink::WebMediaStreamTrack& track, |
| 40 const OnEncodedAudioCB& on_encoded_audio_cb); | 40 const OnEncodedAudioCB& on_encoded_audio_cb, |
| 41 int32_t bits_per_second); |
| 41 ~AudioTrackRecorder() override; | 42 ~AudioTrackRecorder() override; |
| 42 | 43 |
| 43 // Implement MediaStreamAudioSink. | 44 // Implement MediaStreamAudioSink. |
| 44 void OnSetFormat(const media::AudioParameters& params) override; | 45 void OnSetFormat(const media::AudioParameters& params) override; |
| 45 void OnData(const media::AudioBus& audio_bus, | 46 void OnData(const media::AudioBus& audio_bus, |
| 46 base::TimeTicks capture_time) override; | 47 base::TimeTicks capture_time) override; |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 friend class AudioTrackRecorderTest; | 50 friend class AudioTrackRecorderTest; |
| 50 class AudioParameters; | 51 class AudioParameters; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 76 const scoped_refptr<AudioEncoder> encoder_; | 77 const scoped_refptr<AudioEncoder> encoder_; |
| 77 // The thread on which |encoder_| works. | 78 // The thread on which |encoder_| works. |
| 78 base::Thread encoder_thread_; | 79 base::Thread encoder_thread_; |
| 79 | 80 |
| 80 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorder); | 81 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorder); |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace content | 84 } // namespace content |
| 84 | 85 |
| 85 #endif // CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ | 86 #endif // CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ |
| OLD | NEW |