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

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host.cc

Issue 1175003004: Change audio IPC enums from kConstantStyle to MACRO_STYLE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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
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/browser/renderer_host/media/audio_renderer_host.h" 5 #include "content/browser/renderer_host/media/audio_renderer_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 void AudioRendererHost::DoNotifyStreamStateChanged(int stream_id, 269 void AudioRendererHost::DoNotifyStreamStateChanged(int stream_id,
270 bool is_playing) { 270 bool is_playing) {
271 DCHECK_CURRENTLY_ON(BrowserThread::IO); 271 DCHECK_CURRENTLY_ON(BrowserThread::IO);
272 272
273 AudioEntry* const entry = LookupById(stream_id); 273 AudioEntry* const entry = LookupById(stream_id);
274 if (!entry) 274 if (!entry)
275 return; 275 return;
276 276
277 Send(new AudioMsg_NotifyStreamStateChanged( 277 Send(new AudioMsg_NotifyStreamStateChanged(
278 stream_id, 278 stream_id,
279 is_playing ? media::AudioOutputIPCDelegate::kPlaying 279 is_playing ? media::AUDIO_OUTPUT_IPC_DELEGATE_STATE_PLAYING
280 : media::AudioOutputIPCDelegate::kPaused)); 280 : media::AUDIO_OUTPUT_IPC_DELEGATE_STATE_PAUSED));
281 281
282 if (is_playing) { 282 if (is_playing) {
283 AudioStreamMonitor::StartMonitoringStream( 283 AudioStreamMonitor::StartMonitoringStream(
284 render_process_id_, 284 render_process_id_,
285 entry->render_frame_id(), 285 entry->render_frame_id(),
286 entry->stream_id(), 286 entry->stream_id(),
287 base::Bind(&media::AudioOutputController::ReadCurrentPowerAndClip, 287 base::Bind(&media::AudioOutputController::ReadCurrentPowerAndClip,
288 entry->controller())); 288 entry->controller()));
289 } else { 289 } else {
290 AudioStreamMonitor::StopMonitoringStream( 290 AudioStreamMonitor::StopMonitoringStream(
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 574
575 void AudioRendererHost::DoOutputDeviceSwitched(int stream_id, int request_id) { 575 void AudioRendererHost::DoOutputDeviceSwitched(int stream_id, int request_id) {
576 DCHECK_CURRENTLY_ON(BrowserThread::IO); 576 DCHECK_CURRENTLY_ON(BrowserThread::IO);
577 DVLOG(1) << __FUNCTION__ << "(" << stream_id << ", " << request_id << ")"; 577 DVLOG(1) << __FUNCTION__ << "(" << stream_id << ", " << request_id << ")";
578 Send(new AudioMsg_NotifyOutputDeviceSwitched( 578 Send(new AudioMsg_NotifyOutputDeviceSwitched(
579 stream_id, request_id, media::SWITCH_OUTPUT_DEVICE_RESULT_SUCCESS)); 579 stream_id, request_id, media::SWITCH_OUTPUT_DEVICE_RESULT_SUCCESS));
580 } 580 }
581 581
582 void AudioRendererHost::SendErrorMessage(int stream_id) { 582 void AudioRendererHost::SendErrorMessage(int stream_id) {
583 Send(new AudioMsg_NotifyStreamStateChanged( 583 Send(new AudioMsg_NotifyStreamStateChanged(
584 stream_id, media::AudioOutputIPCDelegate::kError)); 584 stream_id, media::AUDIO_OUTPUT_IPC_DELEGATE_STATE_ERROR));
585 } 585 }
586 586
587 void AudioRendererHost::OnCloseStream(int stream_id) { 587 void AudioRendererHost::OnCloseStream(int stream_id) {
588 DCHECK_CURRENTLY_ON(BrowserThread::IO); 588 DCHECK_CURRENTLY_ON(BrowserThread::IO);
589 589
590 // Prevent oustanding callbacks from attempting to close/delete the same 590 // Prevent oustanding callbacks from attempting to close/delete the same
591 // AudioEntry twice. 591 // AudioEntry twice.
592 AudioEntryMap::iterator i = audio_entries_.find(stream_id); 592 AudioEntryMap::iterator i = audio_entries_.find(stream_id);
593 if (i == audio_entries_.end()) 593 if (i == audio_entries_.end())
594 return; 594 return;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 it != audio_entries_.end(); 677 it != audio_entries_.end();
678 ++it) { 678 ++it) {
679 AudioEntry* entry = it->second; 679 AudioEntry* entry = it->second;
680 if (entry->render_frame_id() == render_frame_id && entry->playing()) 680 if (entry->render_frame_id() == render_frame_id && entry->playing())
681 return true; 681 return true;
682 } 682 }
683 return false; 683 return false;
684 } 684 }
685 685
686 } // namespace content 686 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698