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

Side by Side Diff: content/browser/media/webrtc_internals.h

Issue 1272223003: Implement writing mic audio input data to file for debugging purposes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_WEBRTC_INTERNALS_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
6 #define CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_ 6 #define CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
7 7
8 #include "base/containers/hash_tables.h" 8 #include "base/containers/hash_tables.h"
9 #include "base/gtest_prod_util.h" 9 #include "base/gtest_prod_util.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 const std::string& audio_constraints, 80 const std::string& audio_constraints,
81 const std::string& video_constraints); 81 const std::string& video_constraints);
82 82
83 // Methods for adding or removing WebRTCInternalsUIObserver. 83 // Methods for adding or removing WebRTCInternalsUIObserver.
84 void AddObserver(WebRTCInternalsUIObserver *observer); 84 void AddObserver(WebRTCInternalsUIObserver *observer);
85 void RemoveObserver(WebRTCInternalsUIObserver *observer); 85 void RemoveObserver(WebRTCInternalsUIObserver *observer);
86 86
87 // Sends all update data to |observer|. 87 // Sends all update data to |observer|.
88 void UpdateObserver(WebRTCInternalsUIObserver* observer); 88 void UpdateObserver(WebRTCInternalsUIObserver* observer);
89 89
90 // Enables or disables AEC dump (diagnostic echo canceller recording). 90 // Enables or disables diagnostic audio recordings for debugging purposes.
91 void EnableAecDump(content::WebContents* web_contents); 91 void EnableAudioDebugRecordings(content::WebContents* web_contents);
92 void DisableAecDump(); 92 void DisableAudioDebugRecordings();
93 93
94 bool aec_dump_enabled() { 94 bool audio_debug_recordings_enabled() {
95 return aec_dump_enabled_; 95 return audio_debug_recordings_;
96 } 96 }
97 97
98 base::FilePath aec_dump_file_path() { 98 base::FilePath audio_debug_recordings_file_path() {
tommi (sloooow) - chröme 2015/08/07 12:09:51 nit: return const & and make the method const? al
Henrik Grunell 2015/08/17 15:05:16 Agree, done.
99 return aec_dump_file_path_; 99 return audio_debug_recordings_file_path_;
100 } 100 }
101 101
102 void ResetForTesting(); 102 void ResetForTesting();
103 103
104 private: 104 private:
105 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>; 105 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>;
106 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, CallWithAecDump); 106 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, CallWithAecDump);
107 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, 107 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest,
108 CallWithAecDumpEnabledThenDisabled); 108 CallWithAecDumpEnabledThenDisabled);
109 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, TwoCallsWithAecDump); 109 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, TwoCallsWithAecDump);
(...skipping 11 matching lines...) Expand all
121 // ui::SelectFileDialog::Listener implementation. 121 // ui::SelectFileDialog::Listener implementation.
122 void FileSelected(const base::FilePath& path, 122 void FileSelected(const base::FilePath& path,
123 int index, 123 int index,
124 void* unused_params) override; 124 void* unused_params) override;
125 void FileSelectionCanceled(void* params) override; 125 void FileSelectionCanceled(void* params) override;
126 126
127 // Called when a renderer exits (including crashes). 127 // Called when a renderer exits (including crashes).
128 void OnRendererExit(int render_process_id); 128 void OnRendererExit(int render_process_id);
129 129
130 #if defined(ENABLE_WEBRTC) 130 #if defined(ENABLE_WEBRTC)
131 // Enables AEC dump on all render process hosts using |aec_dump_file_path_|. 131 // Enables diagnostic audio recordings on all render process hosts using
132 void EnableAecDumpOnAllRenderProcessHosts(); 132 // |audio_debug_recordings_file_path_|.
133 void EnableAudioDebugRecordingsOnAllRenderProcessHosts();
133 #endif 134 #endif
134 135
135 // Called whenever an element is added to or removed from 136 // Called whenever an element is added to or removed from
136 // |peer_connection_data_| to impose/release a block on suspending the current 137 // |peer_connection_data_| to impose/release a block on suspending the current
137 // application for power-saving. 138 // application for power-saving.
138 void CreateOrReleasePowerSaveBlocker(); 139 void CreateOrReleasePowerSaveBlocker();
139 140
140 base::ObserverList<WebRTCInternalsUIObserver> observers_; 141 base::ObserverList<WebRTCInternalsUIObserver> observers_;
141 142
142 // |peer_connection_data_| is a list containing all the PeerConnection 143 // |peer_connection_data_| is a list containing all the PeerConnection
(...skipping 17 matching lines...) Expand all
160 // "rid" -- the renderer id. 161 // "rid" -- the renderer id.
161 // "pid" -- proceddId of the renderer. 162 // "pid" -- proceddId of the renderer.
162 // "origin" -- the security origin of the request. 163 // "origin" -- the security origin of the request.
163 // "audio" -- the serialized audio constraints if audio is requested. 164 // "audio" -- the serialized audio constraints if audio is requested.
164 // "video" -- the serialized video constraints if video is requested. 165 // "video" -- the serialized video constraints if video is requested.
165 base::ListValue get_user_media_requests_; 166 base::ListValue get_user_media_requests_;
166 167
167 // For managing select file dialog. 168 // For managing select file dialog.
168 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; 169 scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
169 170
170 // AEC dump (diagnostic echo canceller recording) state. 171 // Diagnostic audio recording state.
171 bool aec_dump_enabled_; 172 bool audio_debug_recordings_;
172 base::FilePath aec_dump_file_path_; 173 base::FilePath audio_debug_recordings_file_path_;
173 174
174 // While |peer_connection_data_| is non-empty, hold an instance of 175 // While |peer_connection_data_| is non-empty, hold an instance of
175 // PowerSaveBlocker. This prevents the application from being suspended while 176 // PowerSaveBlocker. This prevents the application from being suspended while
176 // remoting. 177 // remoting.
177 scoped_ptr<PowerSaveBlocker> power_save_blocker_; 178 scoped_ptr<PowerSaveBlocker> power_save_blocker_;
178 179
179 // Set of render process hosts that |this| is registered as an observer on. 180 // Set of render process hosts that |this| is registered as an observer on.
180 base::hash_set<int> render_process_id_set_; 181 base::hash_set<int> render_process_id_set_;
181 }; 182 };
182 183
183 } // namespace content 184 } // namespace content
184 185
185 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_ 186 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/webrtc_internals.cc » ('j') | content/browser/media/webrtc_internals.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698