niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 11 | #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ |
| 12 | #define WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
| 14 | #include <vector> |
| 15 | |
andrew@webrtc.org | 56e4a05 | 2014-02-27 22:23:17 +0000 | [diff] [blame] | 16 | #include "webrtc/common.h" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
andrew@webrtc.org | 61e596f | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 19 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 20 | class ProcessingComponent { |
| 21 | public: |
pbos@webrtc.org | 9162080 | 2013-08-02 11:44:11 +0000 | [diff] [blame] | 22 | ProcessingComponent(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 23 | virtual ~ProcessingComponent(); |
| 24 | |
| 25 | virtual int Initialize(); |
andrew@webrtc.org | 61e596f | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 26 | virtual void SetExtraOptions(const Config& config) {} |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 27 | virtual int Destroy(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 28 | |
andrew@webrtc.org | 755b04a | 2011-11-15 16:57:56 +0000 | [diff] [blame] | 29 | bool is_component_enabled() const; |
| 30 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 31 | protected: |
| 32 | virtual int Configure(); |
| 33 | int EnableComponent(bool enable); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 34 | void* handle(int index) const; |
| 35 | int num_handles() const; |
| 36 | |
| 37 | private: |
| 38 | virtual void* CreateHandle() const = 0; |
| 39 | virtual int InitializeHandle(void* handle) const = 0; |
| 40 | virtual int ConfigureHandle(void* handle) const = 0; |
bjornv@webrtc.org | 5964fe0 | 2014-04-22 06:52:28 +0000 | [diff] [blame] | 41 | virtual void DestroyHandle(void* handle) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 42 | virtual int num_handles_required() const = 0; |
| 43 | virtual int GetHandleError(void* handle) const = 0; |
| 44 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 45 | std::vector<void*> handles_; |
| 46 | bool initialized_; |
| 47 | bool enabled_; |
| 48 | int num_handles_; |
| 49 | }; |
andrew@webrtc.org | 61e596f | 2013-07-25 18:28:29 +0000 | [diff] [blame] | 50 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 51 | } // namespace webrtc |
| 52 | |
bjornv@webrtc.org | 0c6f931 | 2012-01-30 09:39:08 +0000 | [diff] [blame] | 53 | #endif // WEBRTC_MODULES_AUDIO_PROCESSING_PROCESSING_COMPONENT_H__ |