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