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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_
6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_ 6 #define CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "base/synchronization/lock.h" 15 #include "base/synchronization/lock.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 #include "media/audio/audio_logging.h" 18 #include "media/audio/audio_logging.h"
19 #include "media/video/capture/video_capture_device.h"
20 #include "media/video/capture/video_capture_types.h"
19 21
20 namespace media { 22 namespace media {
21 class AudioParameters; 23 class AudioParameters;
22 struct MediaLogEvent; 24 struct MediaLogEvent;
23 } 25 }
24 26
25 namespace content { 27 namespace content {
26 28
27 // This class stores information about currently active media. 29 // This class stores information about currently active media.
28 class CONTENT_EXPORT MediaInternals 30 class CONTENT_EXPORT MediaInternals
(...skipping 10 matching lines...) Expand all
39 // Called with the update string. 41 // Called with the update string.
40 typedef base::Callback<void(const base::string16&)> UpdateCallback; 42 typedef base::Callback<void(const base::string16&)> UpdateCallback;
41 43
42 // Add/remove update callbacks (see above). Must be called on the IO thread. 44 // Add/remove update callbacks (see above). Must be called on the IO thread.
43 void AddUpdateCallback(const UpdateCallback& callback); 45 void AddUpdateCallback(const UpdateCallback& callback);
44 void RemoveUpdateCallback(const UpdateCallback& callback); 46 void RemoveUpdateCallback(const UpdateCallback& callback);
45 47
46 // Sends all cached data to each registered UpdateCallback. 48 // Sends all cached data to each registered UpdateCallback.
47 void SendEverything(); 49 void SendEverything();
48 50
51 // Called to inform of the capabilities enumerated for a video device.
52 void UpdateVideoCaptureDeviceCapabilities(
53 const media::VideoCaptureDevice::Name& name,
54 const media::VideoCaptureFormats& formats);
burnik 2014/10/05 23:08:55 add const size_t num_devices as last param. You'll
mcasas 2014/10/07 11:25:40 Done.
55 // Cleans up internal cache of all video devices' capabilities.
burnik 2014/10/03 11:15:41 Nit: add empty line.
mcasas 2014/10/07 11:25:40 Done.
56 void PurgeVideoCaptureDeviceCapabilities();
57
49 // AudioLogFactory implementation. Safe to call from any thread. 58 // AudioLogFactory implementation. Safe to call from any thread.
50 virtual scoped_ptr<media::AudioLog> CreateAudioLog( 59 virtual scoped_ptr<media::AudioLog> CreateAudioLog(
51 AudioComponent component) OVERRIDE; 60 AudioComponent component) OVERRIDE;
52 61
53 private: 62 private:
54 friend class AudioLogImpl; 63 friend class AudioLogImpl;
55 friend class MediaInternalsTest; 64 friend class MediaInternalsTest;
56 friend struct base::DefaultLazyInstanceTraits<MediaInternals>; 65 friend struct base::DefaultLazyInstanceTraits<MediaInternals>;
57 66
58 MediaInternals(); 67 MediaInternals();
(...skipping 10 matching lines...) Expand all
69 const std::string& function, 78 const std::string& function,
70 const base::DictionaryValue* value); 79 const base::DictionaryValue* value);
71 void SendUpdateAndPurgeCache(const std::string& cache_key, 80 void SendUpdateAndPurgeCache(const std::string& cache_key,
72 const std::string& function, 81 const std::string& function,
73 const base::DictionaryValue* value); 82 const base::DictionaryValue* value);
74 // Must only be accessed on the IO thread. 83 // Must only be accessed on the IO thread.
75 std::vector<UpdateCallback> update_callbacks_; 84 std::vector<UpdateCallback> update_callbacks_;
76 85
77 // All variables below must be accessed under |lock_|. 86 // All variables below must be accessed under |lock_|.
78 base::Lock lock_; 87 base::Lock lock_;
79 base::DictionaryValue cached_data_; 88 base::DictionaryValue audio_streams_cached_data_;
80 int owner_ids_[AUDIO_COMPONENT_MAX]; 89 int owner_ids_[AUDIO_COMPONENT_MAX];
90 base::DictionaryValue video_devices_cached_data_;
81 91
82 DISALLOW_COPY_AND_ASSIGN(MediaInternals); 92 DISALLOW_COPY_AND_ASSIGN(MediaInternals);
83 }; 93 };
84 94
85 } // namespace content 95 } // namespace content
86 96
87 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_ 97 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/media_internals.cc » ('j') | content/browser/media/media_internals.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698