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 #include "content/renderer/media/audio_track_recorder.h" | 5 #include "content/renderer/media/audio_track_recorder.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "content/renderer/media/media_stream_audio_track.h" | 13 #include "content/renderer/media/media_stream_audio_track.h" |
14 #include "media/audio/audio_parameters.h" | |
15 #include "media/base/audio_bus.h" | 14 #include "media/base/audio_bus.h" |
16 #include "media/base/audio_converter.h" | 15 #include "media/base/audio_converter.h" |
17 #include "media/base/audio_fifo.h" | 16 #include "media/base/audio_fifo.h" |
| 17 #include "media/base/audio_parameters.h" |
18 #include "media/base/bind_to_current_loop.h" | 18 #include "media/base/bind_to_current_loop.h" |
19 #include "third_party/opus/src/include/opus.h" | 19 #include "third_party/opus/src/include/opus.h" |
20 | 20 |
21 // Note that this code follows the Chrome media convention of defining a "frame" | 21 // Note that this code follows the Chrome media convention of defining a "frame" |
22 // as "one multi-channel sample" as opposed to another common definition meaning | 22 // as "one multi-channel sample" as opposed to another common definition meaning |
23 // "a chunk of samples". Here this second definition of "frame" is called a | 23 // "a chunk of samples". Here this second definition of "frame" is called a |
24 // "buffer"; so what might be called "frame duration" is instead "buffer | 24 // "buffer"; so what might be called "frame duration" is instead "buffer |
25 // duration", and so on. | 25 // duration", and so on. |
26 | 26 |
27 namespace content { | 27 namespace content { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 350 } |
351 | 351 |
352 void AudioTrackRecorder::Resume() { | 352 void AudioTrackRecorder::Resume() { |
353 DCHECK(main_render_thread_checker_.CalledOnValidThread()); | 353 DCHECK(main_render_thread_checker_.CalledOnValidThread()); |
354 DCHECK(encoder_); | 354 DCHECK(encoder_); |
355 encoder_thread_.task_runner()->PostTask( | 355 encoder_thread_.task_runner()->PostTask( |
356 FROM_HERE, base::Bind(&AudioEncoder::set_paused, encoder_, false)); | 356 FROM_HERE, base::Bind(&AudioEncoder::set_paused, encoder_, false)); |
357 } | 357 } |
358 | 358 |
359 } // namespace content | 359 } // namespace content |
OLD | NEW |