| 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 29 matching lines...) Expand all Loading... |
| 40 AudioTrackRecorder(const blink::WebMediaStreamTrack& track, | 40 AudioTrackRecorder(const blink::WebMediaStreamTrack& track, |
| 41 const OnEncodedAudioCB& on_encoded_audio_cb, | 41 const OnEncodedAudioCB& on_encoded_audio_cb, |
| 42 int32_t bits_per_second); | 42 int32_t bits_per_second); |
| 43 ~AudioTrackRecorder() override; | 43 ~AudioTrackRecorder() override; |
| 44 | 44 |
| 45 // Implement MediaStreamAudioSink. | 45 // Implement MediaStreamAudioSink. |
| 46 void OnSetFormat(const media::AudioParameters& params) override; | 46 void OnSetFormat(const media::AudioParameters& params) override; |
| 47 void OnData(const media::AudioBus& audio_bus, | 47 void OnData(const media::AudioBus& audio_bus, |
| 48 base::TimeTicks capture_time) override; | 48 base::TimeTicks capture_time) override; |
| 49 | 49 |
| 50 void Pause(); |
| 51 void Resume(); |
| 52 |
| 50 private: | 53 private: |
| 51 // Forward declaration of nested class for handling encoding. | 54 // Forward declaration of nested class for handling encoding. |
| 52 // See the implementation file for details. | 55 // See the implementation file for details. |
| 53 class AudioEncoder; | 56 class AudioEncoder; |
| 54 | 57 |
| 55 // Used to check that we are destroyed on the same thread we were created on. | 58 // Used to check that we are destroyed on the same thread we were created on. |
| 56 base::ThreadChecker main_render_thread_checker_; | 59 base::ThreadChecker main_render_thread_checker_; |
| 57 | 60 |
| 58 // Used to check that MediaStreamAudioSink's methods are called on the | 61 // Used to check that MediaStreamAudioSink's methods are called on the |
| 59 // capture audio thread. | 62 // capture audio thread. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 const scoped_refptr<AudioEncoder> encoder_; | 74 const scoped_refptr<AudioEncoder> encoder_; |
| 72 // The thread on which |encoder_| works. | 75 // The thread on which |encoder_| works. |
| 73 base::Thread encoder_thread_; | 76 base::Thread encoder_thread_; |
| 74 | 77 |
| 75 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorder); | 78 DISALLOW_COPY_AND_ASSIGN(AudioTrackRecorder); |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace content | 81 } // namespace content |
| 79 | 82 |
| 80 #endif // CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ | 83 #endif // CONTENT_RENDERER_MEDIA_AUDIO_TRACK_RECORDER_H_ |
| OLD | NEW |