Wind Yuan | 78ec1f7 | 2015-01-26 16:25:59 +0800 | [diff] [blame] | 1 | /* |
| 2 | * analyzer_loader.h - analyzer loader |
| 3 | * |
| 4 | * Copyright (c) 2015 Intel Corporation |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | * |
| 18 | * Author: Wind Yuan <feng.yuan@intel.com> |
| 19 | */ |
| 20 | |
| 21 | #ifndef XCAM_ANALYZER_LOADER_H |
| 22 | #define XCAM_ANALYZER_LOADER_H |
| 23 | |
Wind Yuan | 29a49f5 | 2015-01-26 17:57:37 +0800 | [diff] [blame] | 24 | #include <base/xcam_common.h> |
| 25 | #include <base/xcam_3a_description.h> |
Wind Yuan | 78ec1f7 | 2015-01-26 16:25:59 +0800 | [diff] [blame] | 26 | #include "xcam_utils.h" |
| 27 | #include "x3a_analyzer.h" |
Wind Yuan | 78ec1f7 | 2015-01-26 16:25:59 +0800 | [diff] [blame] | 28 | |
| 29 | namespace XCam { |
| 30 | |
| 31 | class AnalyzerLoader |
| 32 | { |
| 33 | public: |
| 34 | AnalyzerLoader (const char *lib_path); |
| 35 | ~AnalyzerLoader (); |
| 36 | |
| 37 | SmartPtr<X3aAnalyzer> load_analyzer (); |
| 38 | |
| 39 | private: |
| 40 | bool open_handle (); |
| 41 | XCam3ADescription *get_symbol (const char *symbol); |
| 42 | bool close_handle (); |
| 43 | void convert_results (XCam3aResultHead *from, uint32_t num_of_from, X3aResultList &to); |
| 44 | |
| 45 | XCAM_DEAD_COPY(AnalyzerLoader); |
| 46 | |
| 47 | private: |
| 48 | char *_path; |
| 49 | void *_handle; |
| 50 | }; |
| 51 | |
| 52 | }; |
| 53 | |
| 54 | #endif //XCAM_ANALYZER_LOADER_H |