• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * x3a_statistics_queue.h - statistics queue
3  *
4  *  Copyright (c) 2014-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_3A_STATISTIC_QUEUE_H
22 #define XCAM_3A_STATISTIC_QUEUE_H
23 
24 #include <xcam_std.h>
25 #include <xcam_mutex.h>
26 #include <x3a_stats_pool.h>
27 #include <linux/atomisp.h>
28 
29 namespace XCam {
30 
31 class X3aStatisticsQueue;
32 
33 class X3aIspStatsData
34     : public X3aStatsData
35 {
36 public:
37     explicit X3aIspStatsData (struct atomisp_3a_statistics *isp_data, XCam3AStats *data);
38     ~X3aIspStatsData ();
get_isp_stats()39     struct atomisp_3a_statistics *get_isp_stats () {
40         return _isp_data;
41     }
42 
map()43     virtual uint8_t *map () {
44         return (uint8_t*)(void*)(_isp_data);
45     }
unmap()46     virtual bool unmap () {
47         return true;
48     }
49 
50     bool fill_standard_stats ();
51 
52 private:
53     XCAM_DEAD_COPY (X3aIspStatsData);
54 
55 private:
56     struct atomisp_3a_statistics *_isp_data;
57 };
58 
59 class X3aIspStatistics
60     : public X3aStats
61 {
62     friend class X3aStatisticsQueue;
63 protected:
64     explicit X3aIspStatistics (const SmartPtr<X3aIspStatsData> &stats_data);
65 
66 public:
67     virtual ~X3aIspStatistics ();
68     struct atomisp_3a_statistics *get_isp_stats ();
69 
70     bool fill_standard_stats ();
71 
72 private:
73     XCAM_DEAD_COPY (X3aIspStatistics);
74 };
75 
76 class X3aStatisticsQueue
77     : public X3aStatsPool
78 {
79 public:
80     explicit X3aStatisticsQueue ();
81     ~X3aStatisticsQueue();
82 
83     void set_grid_info (const struct atomisp_grid_info &info);
84 
85 protected:
86     virtual bool fixate_video_info (VideoBufferInfo &info);
87     virtual SmartPtr<BufferData> allocate_data (const VideoBufferInfo &buffer_info);
88     virtual SmartPtr<BufferProxy> create_buffer_from_data (SmartPtr<BufferData> &data);
89 
90 
91 private:
92     struct atomisp_3a_statistics *alloc_isp_statsictics ();
93     XCAM_DEAD_COPY (X3aStatisticsQueue);
94 
95 private:
96     struct atomisp_grid_info  _grid_info;
97 };
98 
99 };
100 
101 #endif //XCAM_3A_STATISTIC_QUEUE_H
102