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

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: Code review 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 IsAudioDebugRecordingsEnabled() const;
95 return aec_dump_enabled_; 95 const base::FilePath& GetAudioDebugRecordingsFilePath() const;
96 }
97
98 base::FilePath aec_dump_file_path() {
99 return aec_dump_file_path_;
100 }
101 96
102 void ResetForTesting(); 97 void ResetForTesting();
103 98
104 private: 99 private:
105 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>; 100 friend struct base::DefaultLazyInstanceTraits<WebRTCInternals>;
106 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, CallWithAecDump); 101 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, CallWithAecDump);
107 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, 102 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest,
108 CallWithAecDumpEnabledThenDisabled); 103 CallWithAecDumpEnabledThenDisabled);
109 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, TwoCallsWithAecDump); 104 FRIEND_TEST_ALL_PREFIXES(WebRtcAecDumpBrowserTest, TwoCallsWithAecDump);
110 FRIEND_TEST_ALL_PREFIXES(WebRtcInternalsTest, 105 FRIEND_TEST_ALL_PREFIXES(WebRtcInternalsTest,
(...skipping 10 matching lines...) Expand all
121 // ui::SelectFileDialog::Listener implementation. 116 // ui::SelectFileDialog::Listener implementation.
122 void FileSelected(const base::FilePath& path, 117 void FileSelected(const base::FilePath& path,
123 int index, 118 int index,
124 void* unused_params) override; 119 void* unused_params) override;
125 void FileSelectionCanceled(void* params) override; 120 void FileSelectionCanceled(void* params) override;
126 121
127 // Called when a renderer exits (including crashes). 122 // Called when a renderer exits (including crashes).
128 void OnRendererExit(int render_process_id); 123 void OnRendererExit(int render_process_id);
129 124
130 #if defined(ENABLE_WEBRTC) 125 #if defined(ENABLE_WEBRTC)
131 // Enables AEC dump on all render process hosts using |aec_dump_file_path_|. 126 // Enables diagnostic audio recordings on all render process hosts using
132 void EnableAecDumpOnAllRenderProcessHosts(); 127 // |audio_debug_recordings_file_path_|.
128 void EnableAudioDebugRecordingsOnAllRenderProcessHosts();
133 #endif 129 #endif
134 130
135 // Called whenever an element is added to or removed from 131 // Called whenever an element is added to or removed from
136 // |peer_connection_data_| to impose/release a block on suspending the current 132 // |peer_connection_data_| to impose/release a block on suspending the current
137 // application for power-saving. 133 // application for power-saving.
138 void CreateOrReleasePowerSaveBlocker(); 134 void CreateOrReleasePowerSaveBlocker();
139 135
140 base::ObserverList<WebRTCInternalsUIObserver> observers_; 136 base::ObserverList<WebRTCInternalsUIObserver> observers_;
141 137
142 // |peer_connection_data_| is a list containing all the PeerConnection 138 // |peer_connection_data_| is a list containing all the PeerConnection
(...skipping 17 matching lines...) Expand all
160 // "rid" -- the renderer id. 156 // "rid" -- the renderer id.
161 // "pid" -- proceddId of the renderer. 157 // "pid" -- proceddId of the renderer.
162 // "origin" -- the security origin of the request. 158 // "origin" -- the security origin of the request.
163 // "audio" -- the serialized audio constraints if audio is requested. 159 // "audio" -- the serialized audio constraints if audio is requested.
164 // "video" -- the serialized video constraints if video is requested. 160 // "video" -- the serialized video constraints if video is requested.
165 base::ListValue get_user_media_requests_; 161 base::ListValue get_user_media_requests_;
166 162
167 // For managing select file dialog. 163 // For managing select file dialog.
168 scoped_refptr<ui::SelectFileDialog> select_file_dialog_; 164 scoped_refptr<ui::SelectFileDialog> select_file_dialog_;
169 165
170 // AEC dump (diagnostic echo canceller recording) state. 166 // Diagnostic audio recording state.
171 bool aec_dump_enabled_; 167 bool audio_debug_recordings_;
172 base::FilePath aec_dump_file_path_; 168 base::FilePath audio_debug_recordings_file_path_;
173 169
174 // While |peer_connection_data_| is non-empty, hold an instance of 170 // While |peer_connection_data_| is non-empty, hold an instance of
175 // PowerSaveBlocker. This prevents the application from being suspended while 171 // PowerSaveBlocker. This prevents the application from being suspended while
176 // remoting. 172 // remoting.
177 scoped_ptr<PowerSaveBlocker> power_save_blocker_; 173 scoped_ptr<PowerSaveBlocker> power_save_blocker_;
178 174
179 // Set of render process hosts that |this| is registered as an observer on. 175 // Set of render process hosts that |this| is registered as an observer on.
180 base::hash_set<int> render_process_id_set_; 176 base::hash_set<int> render_process_id_set_;
181 }; 177 };
182 178
183 } // namespace content 179 } // namespace content
184 180
185 #endif // CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_ 181 #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