| 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 54e6f205ad0e4d2cdfdbedb5c4fa01c2035ae031..1a4059c2298f8a293a16fe772749cee7e768a054 100644
|
| --- a/chromecast/media/cma/backend/media_pipeline_backend_manager.h
|
| +++ b/chromecast/media/cma/backend/media_pipeline_backend_manager.h
|
| @@ -7,7 +7,6 @@
|
|
|
| #include <map>
|
| #include <memory>
|
| -#include <vector>
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| @@ -49,15 +48,29 @@ class MediaPipelineBackendManager {
|
| private:
|
| friend class MediaPipelineBackendWrapper;
|
|
|
| + struct BackendInfo {
|
| + int audio_decoder_count_ = 0;
|
| + int video_decoder_count_ = 0;
|
| + };
|
| +
|
| + // MediaPipelineBackendWrapper instances must check with these functions
|
| + // before creating decoders, so the manager can enforce global limits.
|
| + // If these return true, the count is incremented (i.e. it's assumed that the
|
| + // wrapper will create one). It's decreased when backend is destroyed.
|
| + bool CanCreateAudioDecoder(MediaPipelineBackend* backend);
|
| + bool CanCreateVideoDecoder(MediaPipelineBackend* backend);
|
| +
|
| // Internal clean up when a new media pipeline backend is destroyed.
|
| - void OnMediaPipelineBackendDestroyed(const MediaPipelineBackend* backend);
|
| + void OnMediaPipelineBackendDestroyed(MediaPipelineBackend* backend);
|
|
|
| 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_;
|
| + // Collection of all existing media_pipeline_backends_
|
| + std::map<MediaPipelineBackend*, BackendInfo> media_pipeline_backends_;
|
| + int audio_decoder_count_;
|
| + int video_decoder_count_;
|
|
|
| // Volume multiplier for each type of audio streams.
|
| std::map<int, float> volume_by_stream_type_;
|
|
|