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

Unified Diff: content/renderer/pepper/pepper_audio_controller.h

Issue 2755613002: Support audio output device enumeration and selection in PPAPI (Closed)
Patch Set: Fix format, Rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper/pepper_audio_controller.h
diff --git a/content/renderer/pepper/pepper_audio_controller.h b/content/renderer/pepper/pepper_audio_controller.h
index 29241ab8e63963eb256cc3e2621d387e3b7e4660..8e8b87412004427cbe196fbd186fca0f9243f419 100644
--- a/content/renderer/pepper/pepper_audio_controller.h
+++ b/content/renderer/pepper/pepper_audio_controller.h
@@ -11,6 +11,7 @@
namespace content {
+class PepperAudioOutputHost;
class PepperPluginInstanceImpl;
class PPB_Audio_Impl;
@@ -25,9 +26,11 @@ class PepperAudioController {
// Adds an audio instance to the controller.
void AddInstance(PPB_Audio_Impl* audio);
+ void AddInstance(PepperAudioOutputHost* audio_output);
// Removes an audio instance from the controller.
void RemoveInstance(PPB_Audio_Impl* audio);
+ void RemoveInstance(PepperAudioOutputHost* audio_output);
// Sets the volume of all audio instances.
void SetVolume(double volume);
@@ -42,9 +45,18 @@ class PepperAudioController {
// only be called when |ppb_audios_| turns from non-empty to empty.
void NotifyPlaybackStopsOnEmpty();
- // All active audio instances.
+ // Helper functions to deal with the first and last audio instance.
+ void StartPlaybackIfFirstInstance();
+ void StopPlaybackIfLastInstance();
+
+ // All active audio instances that are using the old
+ // PPB_Audio interface.
std::set<PPB_Audio_Impl*> ppb_audios_;
+ // All active audio output instances that are using the new
+ // PPB_AudioOutput interface.
+ std::set<PepperAudioOutputHost*> audio_output_hosts_;
+
// The Pepper instance which this controller is for. Will be null after
// OnPepperInstanceDeleted() is called.
PepperPluginInstanceImpl* instance_;
« no previous file with comments | « content/renderer/pepper/content_renderer_pepper_host_factory.cc ('k') | content/renderer/pepper/pepper_audio_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698