| Index: remoting/host/ipc_audio_capturer.cc
|
| diff --git a/remoting/host/ipc_audio_capturer.cc b/remoting/host/ipc_audio_capturer.cc
|
| index 17c478ec286acbf39188fec7602b3478f020b6c1..51d6c769ef9598f0f031a09e346b997c8b8830ac 100644
|
| --- a/remoting/host/ipc_audio_capturer.cc
|
| +++ b/remoting/host/ipc_audio_capturer.cc
|
| @@ -11,7 +11,8 @@ namespace remoting {
|
|
|
| IpcAudioCapturer::IpcAudioCapturer(
|
| scoped_refptr<DesktopSessionProxy> desktop_session_proxy)
|
| - : desktop_session_proxy_(desktop_session_proxy) {
|
| + : desktop_session_proxy_(desktop_session_proxy),
|
| + started_(false) {
|
| // The audio capturer is created on the network thread while used on the audio
|
| // capture thread. Detach |thread_checker_| from the current thread so that it
|
| // will re-attach to the proper thread when Start() is called for the first
|
| @@ -20,40 +21,31 @@ IpcAudioCapturer::IpcAudioCapturer(
|
| }
|
|
|
| IpcAudioCapturer::~IpcAudioCapturer() {
|
| - DCHECK(callback_.is_null());
|
| + DCHECK(!started_);
|
| }
|
|
|
| bool IpcAudioCapturer::Start(const PacketCapturedCallback& callback) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - DCHECK(callback_.is_null());
|
| - DCHECK(!callback.is_null());
|
| + DCHECK(!started_);
|
|
|
| - callback_ = callback;
|
| - desktop_session_proxy_->StartAudioCapturer(this);
|
| + started_ = true;
|
| + desktop_session_proxy_->StartAudioCapturer(callback);
|
|
|
| return true;
|
| }
|
|
|
| void IpcAudioCapturer::Stop() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| - DCHECK(!callback_.is_null());
|
| + DCHECK(started_);
|
|
|
| desktop_session_proxy_->StopAudioCapturer();
|
| - callback_.Reset();
|
| + started_ = false;
|
| }
|
|
|
| bool IpcAudioCapturer::IsStarted() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
| - return !callback_.is_null();
|
| -}
|
| -
|
| -// Called when an audio packet has been received.
|
| -void IpcAudioCapturer::OnAudioPacket(scoped_ptr<AudioPacket> packet) {
|
| - DCHECK(thread_checker_.CalledOnValidThread());
|
| - DCHECK(!callback_.is_null());
|
| -
|
| - callback_.Run(packet.Pass());
|
| + return started_;
|
| }
|
|
|
| } // namespace remoting
|
|
|