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

Unified Diff: content/browser/media/media_internals.h

Issue 616833004: chrome://media-internals: update MediaInternals when devices capabilities are enumerated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FakeVCDFactory needs to specify capture API for Win. Linux/CrOs MediaInternalsVideoCaptureDeviceTes… Created 6 years, 2 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
« no previous file with comments | « no previous file | content/browser/media/media_internals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1e6379363dfbc1ec70e871d28056b865bc9b0fa3 100644
--- a/content/browser/media/media_internals.h
+++ b/content/browser/media/media_internals.h
@@ -16,6 +16,7 @@
#include "base/values.h"
#include "content/common/content_export.h"
#include "media/audio/audio_logging.h"
+#include "media/video/capture/video_capture_device_info.h"
namespace media {
class AudioParameters;
@@ -28,6 +29,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 +40,16 @@ 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 video devices.
+ void UpdateVideoCaptureDeviceCapabilities(
+ const media::VideoCaptureDeviceInfos& video_capture_device_infos);
// AudioLogFactory implementation. Safe to call from any thread.
virtual scoped_ptr<media::AudioLog> CreateAudioLog(
@@ -61,22 +66,23 @@ 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];
DISALLOW_COPY_AND_ASSIGN(MediaInternals);
« no previous file with comments | « no previous file | content/browser/media/media_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698