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

Side by Side Diff: content/renderer/media/webrtc_local_audio_renderer.h

Issue 1666363005: Switching audio clients to using RestartableAudioRendererSink interface as a sink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: export fix Created 4 years, 10 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
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 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "base/synchronization/lock.h" 17 #include "base/synchronization/lock.h"
18 #include "base/threading/thread_checker.h" 18 #include "base/threading/thread_checker.h"
19 #include "content/common/content_export.h" 19 #include "content/common/content_export.h"
20 #include "content/public/renderer/media_stream_audio_renderer.h" 20 #include "content/public/renderer/media_stream_audio_renderer.h"
21 #include "content/public/renderer/media_stream_audio_sink.h" 21 #include "content/public/renderer/media_stream_audio_sink.h"
22 #include "content/renderer/media/webrtc_audio_device_impl.h" 22 #include "content/renderer/media/webrtc_audio_device_impl.h"
23 #include "content/renderer/media/webrtc_local_audio_track.h" 23 #include "content/renderer/media/webrtc_local_audio_track.h"
24 #include "media/base/audio_renderer_sink.h"
24 #include "media/base/output_device.h" 25 #include "media/base/output_device.h"
25 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 26 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
26 27
27 namespace media { 28 namespace media {
28 class AudioBus; 29 class AudioBus;
29 class AudioShifter; 30 class AudioShifter;
30 class AudioOutputDevice;
31 class AudioParameters; 31 class AudioParameters;
32 } 32 }
33 33
34 namespace content { 34 namespace content {
35 35
36 class WebRtcAudioCapturer; 36 class WebRtcAudioCapturer;
37 37
38 // WebRtcLocalAudioRenderer is a MediaStreamAudioRenderer designed for rendering 38 // WebRtcLocalAudioRenderer is a MediaStreamAudioRenderer designed for rendering
39 // local audio media stream tracks, 39 // local audio media stream tracks,
40 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack 40 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#mediastreamtrack
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 // The render view and frame in which the audio is rendered into |sink_|. 127 // The render view and frame in which the audio is rendered into |sink_|.
128 const int source_render_frame_id_; 128 const int source_render_frame_id_;
129 const int session_id_; 129 const int session_id_;
130 130
131 // MessageLoop associated with the single thread that performs all control 131 // MessageLoop associated with the single thread that performs all control
132 // tasks. Set to the MessageLoop that invoked the ctor. 132 // tasks. Set to the MessageLoop that invoked the ctor.
133 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 133 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
134 134
135 // The sink (destination) for rendered audio. 135 // The sink (destination) for rendered audio.
136 scoped_refptr<media::AudioOutputDevice> sink_; 136 scoped_refptr<media::AudioRendererSink> sink_;
137 137
138 // This does all the synchronization/resampling/smoothing. 138 // This does all the synchronization/resampling/smoothing.
139 scoped_ptr<media::AudioShifter> audio_shifter_; 139 scoped_ptr<media::AudioShifter> audio_shifter_;
140 140
141 // Stores last time a render callback was received. The time difference 141 // Stores last time a render callback was received. The time difference
142 // between a new time stamp and this value can be used to derive the 142 // between a new time stamp and this value can be used to derive the
143 // total render time. 143 // total render time.
144 base::TimeTicks last_render_time_; 144 base::TimeTicks last_render_time_;
145 145
146 // Keeps track of total time audio has been rendered. 146 // Keeps track of total time audio has been rendered.
(...skipping 27 matching lines...) Expand all
174 174
175 // Used to DCHECK that some methods are called on the capture audio thread. 175 // Used to DCHECK that some methods are called on the capture audio thread.
176 base::ThreadChecker capture_thread_checker_; 176 base::ThreadChecker capture_thread_checker_;
177 177
178 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioRenderer); 178 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioRenderer);
179 }; 179 };
180 180
181 } // namespace content 181 } // namespace content
182 182
183 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ 183 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698