• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * smart_analyzer.h - smart analyzer
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: Zong Wei <wei.zong@intel.com>
19  */
20 #ifndef XCAM_SMART_ANALYZER_H
21 #define XCAM_SMART_ANALYZER_H
22 
23 #include <xcam_std.h>
24 #include <xcam_analyzer.h>
25 #include <smart_analysis_handler.h>
26 #include <x3a_result_factory.h>
27 
28 namespace XCam {
29 
30 class VideoBuffer;
31 
32 class SmartAnalyzer
33     : public XAnalyzer
34 {
35 public:
36     SmartAnalyzer (const char *name = "SmartAnalyzer");
37     ~SmartAnalyzer ();
38 
39     XCamReturn add_handler (SmartPtr<SmartAnalysisHandler> handler);
40     XCamReturn update_params (XCamSmartAnalysisParam &params);
41     void post_smart_results (X3aResultList &results, int64_t timestamp);
42 
43 protected:
44     virtual XCamReturn create_handlers ();
45     virtual XCamReturn release_handlers ();
46     virtual XCamReturn internal_init (uint32_t width, uint32_t height, double framerate);
47     virtual XCamReturn internal_deinit ();
48     virtual XCamReturn configure ();
49     virtual XCamReturn analyze (const SmartPtr<VideoBuffer> &buffer);
50 
51 private:
52     XCAM_DEAD_COPY (SmartAnalyzer);
53 
54 private:
55     SmartHandlerList   _handlers;
56     X3aResultList      _results;
57 
58     XCAM_OBJ_PROFILING_DEFINES;
59 
60 };
61 
62 }
63 
64 #endif //XCAM_SMART_ANALYZER_H
65