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

Unified Diff: content/browser/renderer_host/media/audio_renderer_host.h

Issue 1856673002: Mojofication of the Chrome Audio Rendering Prototype Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/browser/renderer_host/media/audio_renderer_host.h
diff --git a/content/browser/renderer_host/media/audio_renderer_host.h b/content/browser/renderer_host/media/audio_renderer_host.h
index e549df20cc94f0778b29efcfc7bc0f93e3b23677..a2f2696f5c385c1a25208669a8ca478a1956d86c 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.h
+++ b/content/browser/renderer_host/media/audio_renderer_host.h
@@ -55,6 +55,7 @@
#include "base/sequenced_task_runner_helpers.h"
#include "content/browser/renderer_host/media/audio_output_device_enumerator.h"
#include "content/common/content_export.h"
+#include "content/common/media/audio_output.mojom.h"
#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
@@ -106,6 +107,25 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// |render_frame_id| are actively playing. Can be called from any thread.
bool RenderFrameHasActiveAudio(int render_frame_id) const;
+ // Creates an audio output stream with the specified format.
+ // Upon success/failure, the peer is notified via the NotifyStreamCreated
+ // message.
+ void OnCreateStream(int stream_id,
+ int render_frame_id,
+ const media::AudioParameters& params);
+
+ // Creates an audio output stream with the specified format.
+ // Upon success/failure, the peer is notified via the NotifyStreamCreated
+ // message.
+ void OnCreateStreamMojo(int stream_id,
+ int render_frame_id,
+ const media::AudioParameters& params,
+ AudioOutputStreamPtr stream,
+ const AudioOutput::CreateStreamCallback& callback);
+
+ // Close the audio stream referenced by |stream_id|.
+ void OnCloseStream(int stream_id);
+
private:
friend class AudioRendererHostTest;
friend class BrowserThread;
@@ -149,12 +169,6 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
const std::string& device_id,
const url::Origin& gurl_security_origin);
- // Creates an audio output stream with the specified format.
- // Upon success/failure, the peer is notified via the NotifyStreamCreated
- // message.
- void OnCreateStream(int stream_id,
- int render_frame_id,
- const media::AudioParameters& params);
// Play the audio stream referenced by |stream_id|.
void OnPlayStream(int stream_id);
@@ -162,9 +176,6 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// Pause the audio stream referenced by |stream_id|.
void OnPauseStream(int stream_id);
- // Close the audio stream referenced by |stream_id|.
- void OnCloseStream(int stream_id);
-
// Set the volume of the audio stream referenced by |stream_id|.
void OnSetVolume(int stream_id, double volume);
@@ -186,6 +197,15 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
void DoCreateStream(int stream_id,
int render_frame_id,
const media::AudioParameters& params,
+ const std::string& device_unique_id,
+ AudioOutputStreamPtr stream,
+ const AudioOutput::CreateStreamCallback& callback);
+
+ // Start the actual creation of an audio stream, after the device
+ // authorization process is complete.
+ void DoCreateStream(int stream_id,
+ int render_frame_id,
+ const media::AudioParameters& params,
const std::string& device_unique_id);
// Complete the process of creating an audio stream. This will set up the
@@ -193,6 +213,12 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// NotifyStreamCreated message to the peer.
void DoCompleteCreation(int stream_id);
+ // Complete the process of creating an audio stream. This will set up the
+ // shared memory or shared socket in low latency mode and send the
+ // NotifyStreamCreated message to the peer.
+ void DoCompleteCreationMojo(
+ int stream_id,
+ const AudioOutput::CreateStreamCallback& callback);
// Send playing/paused status to the renderer.
void DoNotifyStreamStateChanged(int stream_id, bool is_playing);
@@ -267,6 +293,8 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// host. Reported as UMA stat at shutdown.
size_t max_simultaneous_streams_;
+ AudioOutputStreamPtr stream_ptr_;
+
DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
};
« no previous file with comments | « content/browser/media/audio_output_impl.cc ('k') | content/browser/renderer_host/media/audio_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698