OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/local_media_stream_audio_source.h" | 5 #include "content/renderer/media/local_media_stream_audio_source.h" |
6 | 6 |
7 #include "content/common/media/media_stream_options.h" | 7 #include "content/common/media/media_stream_options.h" |
8 #include "content/renderer/media/audio_device_factory.h" | 8 #include "content/renderer/media/audio_device_factory.h" |
| 9 #include "content/renderer/media/webrtc_logging.h" |
9 #include "content/renderer/render_frame_impl.h" | 10 #include "content/renderer/render_frame_impl.h" |
10 | 11 |
11 namespace content { | 12 namespace content { |
12 | 13 |
13 LocalMediaStreamAudioSource::LocalMediaStreamAudioSource( | 14 LocalMediaStreamAudioSource::LocalMediaStreamAudioSource( |
14 int consumer_render_frame_id, | 15 int consumer_render_frame_id, |
15 const StreamDeviceInfo& device_info, | 16 const StreamDeviceInfo& device_info, |
16 const ConstraintsCallback& started_callback) | 17 const ConstraintsCallback& started_callback) |
17 : MediaStreamAudioSource(true /* is_local_source */), | 18 : MediaStreamAudioSource(true /* is_local_source */), |
18 consumer_render_frame_id_(consumer_render_frame_id), | 19 consumer_render_frame_id_(consumer_render_frame_id), |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // TODO(miu): Plumbing is needed to determine the actual capture timestamp | 99 // TODO(miu): Plumbing is needed to determine the actual capture timestamp |
99 // of the audio, instead of just snapshotting TimeTicks::Now(), for proper | 100 // of the audio, instead of just snapshotting TimeTicks::Now(), for proper |
100 // audio/video sync. http://crbug.com/335335 | 101 // audio/video sync. http://crbug.com/335335 |
101 MediaStreamAudioSource::DeliverDataToTracks( | 102 MediaStreamAudioSource::DeliverDataToTracks( |
102 *audio_bus, | 103 *audio_bus, |
103 base::TimeTicks::Now() - | 104 base::TimeTicks::Now() - |
104 base::TimeDelta::FromMilliseconds(audio_delay_milliseconds)); | 105 base::TimeDelta::FromMilliseconds(audio_delay_milliseconds)); |
105 } | 106 } |
106 | 107 |
107 void LocalMediaStreamAudioSource::OnCaptureError(const std::string& why) { | 108 void LocalMediaStreamAudioSource::OnCaptureError(const std::string& why) { |
| 109 WebRtcLogMessage("LocalMediaStreamAudioSource::OnCaptureError: " + why); |
108 StopSourceOnError(why); | 110 StopSourceOnError(why); |
109 } | 111 } |
110 | 112 |
111 } // namespace content | 113 } // namespace content |
OLD | NEW |