OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 if (use_background_threads && !is_background_stage && | 130 if (use_background_threads && !is_background_stage && |
131 fft_size > max_realtime_fft_size_) | 131 fft_size > max_realtime_fft_size_) |
132 fft_size = max_realtime_fft_size_; | 132 fft_size = max_realtime_fft_size_; |
133 if (fft_size > max_fft_size_) | 133 if (fft_size > max_fft_size_) |
134 fft_size = max_fft_size_; | 134 fft_size = max_fft_size_; |
135 } | 135 } |
136 | 136 |
137 // Start up background thread | 137 // Start up background thread |
138 // FIXME: would be better to up the thread priority here. It doesn't need to | 138 // FIXME: would be better to up the thread priority here. It doesn't need to |
139 // be real-time, but higher than the default... | 139 // be real-time, but higher than the default... |
140 if (use_background_threads && background_stages_.size() > 0) | 140 if (use_background_threads && background_stages_.size() > 0) { |
141 background_thread_ = WTF::WrapUnique(Platform::Current()->CreateThread( | 141 background_thread_ = Platform::Current()->CreateThread( |
142 "Reverb convolution background thread")); | 142 "Reverb convolution background thread"); |
| 143 } |
143 } | 144 } |
144 | 145 |
145 ReverbConvolver::~ReverbConvolver() { | 146 ReverbConvolver::~ReverbConvolver() { |
146 // Wait for background thread to stop | 147 // Wait for background thread to stop |
147 background_thread_.reset(); | 148 background_thread_.reset(); |
148 } | 149 } |
149 | 150 |
150 void ReverbConvolver::ProcessInBackground() { | 151 void ReverbConvolver::ProcessInBackground() { |
151 // Process all of the stages until their read indices reach the input buffer's | 152 // Process all of the stages until their read indices reach the input buffer's |
152 // write index | 153 // write index |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 214 |
214 accumulation_buffer_.Reset(); | 215 accumulation_buffer_.Reset(); |
215 input_buffer_.Reset(); | 216 input_buffer_.Reset(); |
216 } | 217 } |
217 | 218 |
218 size_t ReverbConvolver::LatencyFrames() const { | 219 size_t ReverbConvolver::LatencyFrames() const { |
219 return 0; | 220 return 0; |
220 } | 221 } |
221 | 222 |
222 } // namespace blink | 223 } // namespace blink |
OLD | NEW |