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

Unified Diff: chromecast/media/cma/backend/media_pipeline_backend_manager.h

Issue 1845783002: [chromecast] Pass media task runner to MediaPipelineBackendManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: minor fixes Created 4 years, 9 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: chromecast/media/cma/backend/media_pipeline_backend_manager.h
diff --git a/chromecast/media/cma/backend/media_pipeline_backend_manager.h b/chromecast/media/cma/backend/media_pipeline_backend_manager.h
index 890dfc8610ef4488efa800efe403391b97ba5ff0..bd9bcc116053629abcdb2d26037f70b5c4dae2c6 100644
--- a/chromecast/media/cma/backend/media_pipeline_backend_manager.h
+++ b/chromecast/media/cma/backend/media_pipeline_backend_manager.h
@@ -9,13 +9,13 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chromecast/public/media/media_pipeline_backend.h"
#include "chromecast/public/media/media_pipeline_device_params.h"
namespace base {
-template <typename T>
-struct DefaultLazyInstanceTraits;
+class SingleThreadTaskRunner;
} // namespace base
namespace chromecast {
@@ -26,37 +26,37 @@ namespace media {
// All functions in this class should be called on the media thread.
class MediaPipelineBackendManager {
public:
+ explicit MediaPipelineBackendManager(
+ scoped_refptr<base::SingleThreadTaskRunner> media_task_runner);
+ ~MediaPipelineBackendManager();
+
// Create media pipeline backend.
- static MediaPipelineBackend* CreateMediaPipelineBackend(
+ scoped_ptr<MediaPipelineBackend> CreateMediaPipelineBackend(
const MediaPipelineDeviceParams& params);
// Create media pipeline backend with a specific stream_type.
- static MediaPipelineBackend* CreateMediaPipelineBackend(
+ scoped_ptr<MediaPipelineBackend> CreateMediaPipelineBackend(
const MediaPipelineDeviceParams& params,
int stream_type);
// Internal clean up when a new media pipeline backend is destroyed.
- static void OnMediaPipelineBackendDestroyed(
- const MediaPipelineBackend* backend);
+ void OnMediaPipelineBackendDestroyed(const MediaPipelineBackend* backend);
// Sets the relative volume for a specified stream type,
// with range [0.0, 1.0] inclusive. If |multiplier| is outside the
// range [0.0, 1.0], it is clamped to that range.
// TODO(tianyuwang): change stream_type to use a enum.
- static void SetVolumeMultiplier(int stream_type, float volume);
+ void SetVolumeMultiplier(int stream_type, float volume);
private:
- friend struct base::DefaultLazyInstanceTraits<MediaPipelineBackendManager>;
-
// Returns a pointer to a singleton instance of the
// MediaPipelineBackendManager.
static MediaPipelineBackendManager* Get();
- MediaPipelineBackendManager();
- ~MediaPipelineBackendManager();
-
float GetVolumeMultiplier(int stream_type);
+ const scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
+
// A vector that stores all of the existing media_pipeline_backends_.
std::vector<MediaPipelineBackend*> media_pipeline_backends_;

Powered by Google App Engine
This is Rietveld 408576698