OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ |
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ | 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/common.h" | 16 #include "webrtc/common.h" |
17 | 17 |
18 namespace webrtc { | 18 namespace webrtc { |
19 | 19 |
| 20 // Functor to use when supplying a verifier function for the queue item |
| 21 // verifcation. |
| 22 template <typename T> |
| 23 class RenderQueueItemVerifier { |
| 24 public: |
| 25 explicit RenderQueueItemVerifier(size_t minimum_capacity) |
| 26 : minimum_capacity_(minimum_capacity) {} |
| 27 |
| 28 bool operator()(const std::vector<T>& v) const { |
| 29 return v.capacity() >= minimum_capacity_; |
| 30 } |
| 31 |
| 32 private: |
| 33 size_t minimum_capacity_; |
| 34 }; |
| 35 |
20 class ProcessingComponent { | 36 class ProcessingComponent { |
21 public: | 37 public: |
22 ProcessingComponent(); | 38 ProcessingComponent(); |
23 virtual ~ProcessingComponent(); | 39 virtual ~ProcessingComponent(); |
24 | 40 |
25 virtual int Initialize(); | 41 virtual int Initialize(); |
26 virtual void SetExtraOptions(const Config& config) {} | 42 virtual void SetExtraOptions(const Config& config) {} |
27 virtual int Destroy(); | 43 virtual int Destroy(); |
28 | 44 |
29 bool is_component_enabled() const; | 45 bool is_component_enabled() const; |
(...skipping 14 matching lines...) Expand all Loading... |
44 | 60 |
45 std::vector<void*> handles_; | 61 std::vector<void*> handles_; |
46 bool initialized_; | 62 bool initialized_; |
47 bool enabled_; | 63 bool enabled_; |
48 int num_handles_; | 64 int num_handles_; |
49 }; | 65 }; |
50 | 66 |
51 } // namespace webrtc | 67 } // namespace webrtc |
52 | 68 |
53 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H__ | 69 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H__ |
OLD | NEW |