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

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

Issue 2578983003: Add AudioStreamRegistry. Move stream counting logic (Closed)
Patch Set: Thread checking. Created 4 years 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_output_delegate.h
diff --git a/content/browser/renderer_host/media/audio_output_delegate.h b/content/browser/renderer_host/media/audio_output_delegate.h
index 2744295acb9a810d9bd9cc060947e211fa3d5a0e..ad6bb4fb4c721c47b21430ea3338fec2df2588cc 100644
--- a/content/browser/renderer_host/media/audio_output_delegate.h
+++ b/content/browser/renderer_host/media/audio_output_delegate.h
@@ -10,6 +10,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "content/browser/renderer_host/media/audio_stream_registry.h"
#include "content/common/content_export.h"
#include "media/audio/audio_output_controller.h"
@@ -34,7 +35,8 @@ namespace content {
// This class, except for the AudioOutputDelegate::EventHandler implementation,
// is operated on the IO thread.
class CONTENT_EXPORT AudioOutputDelegate
- : public media::AudioOutputController::EventHandler {
+ : public media::AudioOutputController::EventHandler,
+ public AudioStreamRegistry::Stream {
public:
class CONTENT_EXPORT EventHandler {
public:
@@ -42,9 +44,6 @@ class CONTENT_EXPORT AudioOutputDelegate
// All these methods are called on the IO thread.
- // Called when the state changes between playing and not playing.
- virtual void OnStreamStateChanged(bool playing) = 0;
-
// Called when construction is finished and the stream is ready for
// playout.
virtual void OnStreamCreated(int stream_id,
@@ -71,6 +70,7 @@ class CONTENT_EXPORT AudioOutputDelegate
// The AudioOutputDelegate might issue callbacks until the UniquePtr
// destructor finishes, so calling |handler| must be valid until then.
static UniquePtr Create(EventHandler* handler,
+ AudioStreamRegistry* stream_registry,
media::AudioManager* audio_manager,
std::unique_ptr<media::AudioLog> audio_log,
AudioMirroringManager* mirroring_manager,
@@ -80,6 +80,7 @@ class CONTENT_EXPORT AudioOutputDelegate
int render_process_id,
const media::AudioParameters& params,
const std::string& output_device_id);
+
~AudioOutputDelegate() override;
// TODO(maxmorin): Remove this when crbug.com/647185 is closed.
@@ -109,6 +110,7 @@ class CONTENT_EXPORT AudioOutputDelegate
private:
AudioOutputDelegate(EventHandler* handler,
+ AudioStreamRegistry* stream_registry,
media::AudioManager* audio_manager,
std::unique_ptr<media::AudioLog> audio_log,
int stream_id,
@@ -124,6 +126,7 @@ class CONTENT_EXPORT AudioOutputDelegate
// |handler_| is null if we are in the process of destruction. In this case,
// we will ignore events from |controller_|.
EventHandler* handler_;
+ AudioStreamRegistry* const stream_registry_;
std::unique_ptr<media::AudioLog> const audio_log_;
std::unique_ptr<AudioSyncReader> reader_;
scoped_refptr<media::AudioOutputController> controller_;

Powered by Google App Engine
This is Rietveld 408576698