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

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

Issue 16907002: Update Android to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/webrtc_local_audio_track.h" 5 #include "content/renderer/media/webrtc_local_audio_track.h"
6 6
7 #include "content/renderer/media/webrtc_audio_capturer.h" 7 #include "content/renderer/media/webrtc_audio_capturer.h"
8 #include "content/renderer/media/webrtc_audio_capturer_sink_owner.h" 8 #include "content/renderer/media/webrtc_audio_capturer_sink_owner.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 20 matching lines...) Expand all
31 DCHECK(capturer.get()); 31 DCHECK(capturer.get());
32 DVLOG(1) << "WebRtcLocalAudioTrack::WebRtcLocalAudioTrack()"; 32 DVLOG(1) << "WebRtcLocalAudioTrack::WebRtcLocalAudioTrack()";
33 } 33 }
34 34
35 WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack() { 35 WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack() {
36 DCHECK(thread_checker_.CalledOnValidThread()); 36 DCHECK(thread_checker_.CalledOnValidThread());
37 DCHECK(sinks_.empty()); 37 DCHECK(sinks_.empty());
38 DVLOG(1) << "WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack()"; 38 DVLOG(1) << "WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack()";
39 39
40 // Users might not call Stop() on the track. 40 // Users might not call Stop() on the track.
41 if (capturer_) 41 if (capturer_.get())
42 Stop(); 42 Stop();
43 } 43 }
44 44
45 // Content::WebRtcAudioCapturerSink implementation. 45 // Content::WebRtcAudioCapturerSink implementation.
46 void WebRtcLocalAudioTrack::CaptureData(const int16* audio_data, 46 void WebRtcLocalAudioTrack::CaptureData(const int16* audio_data,
47 int number_of_channels, 47 int number_of_channels,
48 int number_of_frames, 48 int number_of_frames,
49 int audio_delay_milliseconds, 49 int audio_delay_milliseconds,
50 double volume) { 50 double volume) {
51 SinkList sinks; 51 SinkList sinks;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // be sent to this sink. Also avoids a possible crash which can happen 122 // be sent to this sink. Also avoids a possible crash which can happen
123 // if this method is called while capturing is active. 123 // if this method is called while capturing is active.
124 (*it)->Reset(); 124 (*it)->Reset();
125 sinks_.erase(it); 125 sinks_.erase(it);
126 } 126 }
127 } 127 }
128 128
129 void WebRtcLocalAudioTrack::Start() { 129 void WebRtcLocalAudioTrack::Start() {
130 DCHECK(thread_checker_.CalledOnValidThread()); 130 DCHECK(thread_checker_.CalledOnValidThread());
131 DVLOG(1) << "WebRtcLocalAudioTrack::Start()"; 131 DVLOG(1) << "WebRtcLocalAudioTrack::Start()";
132 if (capturer_) 132 if (capturer_.get())
133 capturer_->AddSink(this); 133 capturer_->AddSink(this);
134 } 134 }
135 135
136 void WebRtcLocalAudioTrack::Stop() { 136 void WebRtcLocalAudioTrack::Stop() {
137 DCHECK(thread_checker_.CalledOnValidThread()); 137 DCHECK(thread_checker_.CalledOnValidThread());
138 DVLOG(1) << "WebRtcLocalAudioTrack::Stop()"; 138 DVLOG(1) << "WebRtcLocalAudioTrack::Stop()";
139 if (capturer_) { 139 if (capturer_.get()) {
140 capturer_->RemoveSink(this); 140 capturer_->RemoveSink(this);
141 capturer_ = NULL; 141 capturer_ = NULL;
142 } 142 }
143 } 143 }
144 144
145 } // namespace content 145 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/stream_texture_factory_impl_android.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698