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

Side by Side Diff: content/renderer/pepper/pepper_platform_audio_output.h

Issue 2065513004: Expose flash playback status and volume control to content renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_focus_manager
Patch Set: addressing nits Created 4 years, 5 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_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_H_ 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_H_ 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 25 matching lines...) Expand all
36 // The following three methods are all called on main thread. 36 // The following three methods are all called on main thread.
37 37
38 // Starts the playback. Returns false on error or if called before the 38 // Starts the playback. Returns false on error or if called before the
39 // stream is created or after the stream is closed. 39 // stream is created or after the stream is closed.
40 bool StartPlayback(); 40 bool StartPlayback();
41 41
42 // Stops the playback. Returns false on error or if called before the stream 42 // Stops the playback. Returns false on error or if called before the stream
43 // is created or after the stream is closed. 43 // is created or after the stream is closed.
44 bool StopPlayback(); 44 bool StopPlayback();
45 45
46 // Sets the volume. Returns false on error or if called before the stream
47 // is created or after the stream is closed.
48 bool SetVolume(double volume);
49
46 // Closes the stream. Make sure to call this before the object is 50 // Closes the stream. Make sure to call this before the object is
47 // destructed. 51 // destructed.
48 void ShutDown(); 52 void ShutDown();
49 53
50 // media::AudioOutputIPCDelegate implementation. 54 // media::AudioOutputIPCDelegate implementation.
51 void OnStateChanged(media::AudioOutputIPCDelegateState state) override; 55 void OnStateChanged(media::AudioOutputIPCDelegateState state) override;
52 void OnDeviceAuthorized(media::OutputDeviceStatus device_status, 56 void OnDeviceAuthorized(media::OutputDeviceStatus device_status,
53 const media::AudioParameters& output_params, 57 const media::AudioParameters& output_params,
54 const std::string& matched_device_id) override; 58 const std::string& matched_device_id) override;
55 void OnStreamCreated(base::SharedMemoryHandle handle, 59 void OnStreamCreated(base::SharedMemoryHandle handle,
(...skipping 11 matching lines...) Expand all
67 71
68 bool Initialize(int sample_rate, 72 bool Initialize(int sample_rate,
69 int frames_per_buffer, 73 int frames_per_buffer,
70 int source_render_frame_id, 74 int source_render_frame_id,
71 AudioHelper* client); 75 AudioHelper* client);
72 76
73 // I/O thread backends to above functions. 77 // I/O thread backends to above functions.
74 void InitializeOnIOThread(const media::AudioParameters& params); 78 void InitializeOnIOThread(const media::AudioParameters& params);
75 void StartPlaybackOnIOThread(); 79 void StartPlaybackOnIOThread();
76 void StopPlaybackOnIOThread(); 80 void StopPlaybackOnIOThread();
81 void SetVolumeOnIOThread(double volume);
77 void ShutDownOnIOThread(); 82 void ShutDownOnIOThread();
78 83
79 // The client to notify when the stream is created. THIS MUST ONLY BE 84 // The client to notify when the stream is created. THIS MUST ONLY BE
80 // ACCESSED ON THE MAIN THREAD. 85 // ACCESSED ON THE MAIN THREAD.
81 AudioHelper* client_; 86 AudioHelper* client_;
82 87
83 // Used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE 88 // Used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE
84 // I/O thread except to send messages and get the message loop. 89 // I/O thread except to send messages and get the message loop.
85 std::unique_ptr<media::AudioOutputIPC> ipc_; 90 std::unique_ptr<media::AudioOutputIPC> ipc_;
86 91
87 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 92 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
88 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; 93 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
89 94
90 DISALLOW_COPY_AND_ASSIGN(PepperPlatformAudioOutput); 95 DISALLOW_COPY_AND_ASSIGN(PepperPlatformAudioOutput);
91 }; 96 };
92 97
93 } // namespace content 98 } // namespace content
94 99
95 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_H_ 100 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_AUDIO_OUTPUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698