| Index: content/browser/media/media_internals.h
|
| diff --git a/content/browser/media/media_internals.h b/content/browser/media/media_internals.h
|
| index afa22a1f005843dd5e1db1a951c5f39ffa7448d6..40c57aba89b29916b9eae501147377221e983508 100644
|
| --- a/content/browser/media/media_internals.h
|
| +++ b/content/browser/media/media_internals.h
|
| @@ -13,9 +13,12 @@
|
| #include "base/lazy_instance.h"
|
| #include "base/strings/string16.h"
|
| #include "base/synchronization/lock.h"
|
| +#include "base/tuple.h"
|
| #include "base/values.h"
|
| #include "content/common/content_export.h"
|
| #include "media/audio/audio_logging.h"
|
| +#include "media/video/capture/video_capture_device.h"
|
| +#include "media/video/capture/video_capture_types.h"
|
|
|
| namespace media {
|
| class AudioParameters;
|
| @@ -28,6 +31,9 @@ namespace content {
|
| class CONTENT_EXPORT MediaInternals
|
| : NON_EXPORTED_BASE(public media::AudioLogFactory) {
|
| public:
|
| + // Called with the update string.
|
| + typedef base::Callback<void(const base::string16&)> UpdateCallback;
|
| +
|
| static MediaInternals* GetInstance();
|
|
|
| virtual ~MediaInternals();
|
| @@ -36,15 +42,17 @@ class CONTENT_EXPORT MediaInternals
|
| void OnMediaEvents(int render_process_id,
|
| const std::vector<media::MediaLogEvent>& events);
|
|
|
| - // Called with the update string.
|
| - typedef base::Callback<void(const base::string16&)> UpdateCallback;
|
| -
|
| // Add/remove update callbacks (see above). Must be called on the IO thread.
|
| void AddUpdateCallback(const UpdateCallback& callback);
|
| void RemoveUpdateCallback(const UpdateCallback& callback);
|
|
|
| - // Sends all cached data to each registered UpdateCallback.
|
| - void SendEverything();
|
| + // Sends all audio cached data to each registered UpdateCallback.
|
| + void SendAudioStreamData();
|
| +
|
| + // Called to inform of the capabilities enumerated for a video device.
|
| + void UpdateVideoCaptureDeviceCapabilities(
|
| + const std::vector<Tuple2<media::VideoCaptureDevice::Name,
|
| + media::VideoCaptureFormats> >& name_and_formats);
|
|
|
| // AudioLogFactory implementation. Safe to call from any thread.
|
| virtual scoped_ptr<media::AudioLog> CreateAudioLog(
|
| @@ -61,23 +69,25 @@ class CONTENT_EXPORT MediaInternals
|
| // thread, but will forward to the IO thread.
|
| void SendUpdate(const base::string16& update);
|
|
|
| - // Caches |value| under |cache_key| so that future SendEverything() calls will
|
| - // include the current data. Calls JavaScript |function|(|value|) for each
|
| - // registered UpdateCallback. SendUpdateAndPurgeCache() is similar but purges
|
| - // the cache entry after completion instead.
|
| - void SendUpdateAndCache(const std::string& cache_key,
|
| - const std::string& function,
|
| - const base::DictionaryValue* value);
|
| - void SendUpdateAndPurgeCache(const std::string& cache_key,
|
| - const std::string& function,
|
| - const base::DictionaryValue* value);
|
| + // Caches |value| under |cache_key| so that future SendAudioStreamData() calls
|
| + // will include the current data. Calls JavaScript |function|(|value|) for
|
| + // each registered UpdateCallback. SendUpdateAndPurgeCache() is similar but
|
| + // purges the cache entry after completion instead.
|
| + void SendUpdateAndCacheAudioStreamKey(const std::string& cache_key,
|
| + const std::string& function,
|
| + const base::DictionaryValue* value);
|
| + void SendUpdateAndPurgeAudioStreamCache(const std::string& cache_key,
|
| + const std::string& function,
|
| + const base::DictionaryValue* value);
|
| +
|
| // Must only be accessed on the IO thread.
|
| std::vector<UpdateCallback> update_callbacks_;
|
|
|
| // All variables below must be accessed under |lock_|.
|
| base::Lock lock_;
|
| - base::DictionaryValue cached_data_;
|
| + base::DictionaryValue audio_streams_cached_data_;
|
| int owner_ids_[AUDIO_COMPONENT_MAX];
|
| + base::DictionaryValue video_devices_cached_data_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(MediaInternals);
|
| };
|
|
|