Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: content/renderer/media/local_media_stream_audio_source.cc

Issue 2899413004: RL: Stop source and fire MediaStreamTrack ended event if missing audio input callbacks are detected. (Closed)
Patch Set: Only stop timer if created. (We can Stop() without Start()ed.) Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/audio/audio_input_device.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_input_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698