OLD | NEW |
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 |
(...skipping 29 matching lines...) Expand all Loading... |
40 void OnMediaEvents(int render_process_id, | 40 void OnMediaEvents(int render_process_id, |
41 const std::vector<media::MediaLogEvent>& events); | 41 const std::vector<media::MediaLogEvent>& events); |
42 | 42 |
43 // Add/remove update callbacks (see above). Must be called on the IO thread. | 43 // Add/remove update callbacks (see above). Must be called on the IO thread. |
44 void AddUpdateCallback(const UpdateCallback& callback); | 44 void AddUpdateCallback(const UpdateCallback& callback); |
45 void RemoveUpdateCallback(const UpdateCallback& callback); | 45 void RemoveUpdateCallback(const UpdateCallback& callback); |
46 | 46 |
47 // Sends all audio cached data to each registered UpdateCallback. | 47 // Sends all audio cached data to each registered UpdateCallback. |
48 void SendAudioStreamData(); | 48 void SendAudioStreamData(); |
49 | 49 |
| 50 // Sends all video capture capabilities cached data to each registered |
| 51 // UpdateCallback. |
| 52 void SendVideoCaptureDeviceCapabilities(); |
| 53 |
50 // Called to inform of the capabilities enumerated for video devices. | 54 // Called to inform of the capabilities enumerated for video devices. |
51 void UpdateVideoCaptureDeviceCapabilities( | 55 void UpdateVideoCaptureDeviceCapabilities( |
52 const media::VideoCaptureDeviceInfos& video_capture_device_infos); | 56 const media::VideoCaptureDeviceInfos& video_capture_device_infos); |
53 | 57 |
54 // AudioLogFactory implementation. Safe to call from any thread. | 58 // AudioLogFactory implementation. Safe to call from any thread. |
55 virtual scoped_ptr<media::AudioLog> CreateAudioLog( | 59 virtual scoped_ptr<media::AudioLog> CreateAudioLog( |
56 AudioComponent component) override; | 60 AudioComponent component) override; |
57 | 61 |
58 private: | 62 private: |
59 friend class AudioLogImpl; | 63 friend class AudioLogImpl; |
(...skipping 12 matching lines...) Expand all Loading... |
72 // purges the cache entry after completion instead. | 76 // purges the cache entry after completion instead. |
73 void SendUpdateAndCacheAudioStreamKey(const std::string& cache_key, | 77 void SendUpdateAndCacheAudioStreamKey(const std::string& cache_key, |
74 const std::string& function, | 78 const std::string& function, |
75 const base::DictionaryValue* value); | 79 const base::DictionaryValue* value); |
76 void SendUpdateAndPurgeAudioStreamCache(const std::string& cache_key, | 80 void SendUpdateAndPurgeAudioStreamCache(const std::string& cache_key, |
77 const std::string& function, | 81 const std::string& function, |
78 const base::DictionaryValue* value); | 82 const base::DictionaryValue* value); |
79 | 83 |
80 // Must only be accessed on the IO thread. | 84 // Must only be accessed on the IO thread. |
81 std::vector<UpdateCallback> update_callbacks_; | 85 std::vector<UpdateCallback> update_callbacks_; |
| 86 base::ListValue video_capture_capabilities_cached_data_; |
82 | 87 |
83 // All variables below must be accessed under |lock_|. | 88 // All variables below must be accessed under |lock_|. |
84 base::Lock lock_; | 89 base::Lock lock_; |
85 base::DictionaryValue audio_streams_cached_data_; | 90 base::DictionaryValue audio_streams_cached_data_; |
86 int owner_ids_[AUDIO_COMPONENT_MAX]; | 91 int owner_ids_[AUDIO_COMPONENT_MAX]; |
87 | 92 |
88 DISALLOW_COPY_AND_ASSIGN(MediaInternals); | 93 DISALLOW_COPY_AND_ASSIGN(MediaInternals); |
89 }; | 94 }; |
90 | 95 |
91 } // namespace content | 96 } // namespace content |
92 | 97 |
93 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_ | 98 #endif // CONTENT_BROWSER_MEDIA_MEDIA_INTERNALS_H_ |
OLD | NEW |