Home | History | Annotate | Download | only in xcore
      1 /*
      2  * x3a_stats_pool.h -  3a stats pool
      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 (at) intel.com>
     19  */
     20 
     21 #ifndef XCAM_3A_STATS_POOL_H
     22 #define XCAM_3A_STATS_POOL_H
     23 
     24 #include <xcam_std.h>
     25 #include <buffer_pool.h>
     26 #include <base/xcam_3a_stats.h>
     27 
     28 namespace XCam {
     29 
     30 class X3aStatsData
     31     : public BufferData
     32 {
     33 public:
     34     explicit X3aStatsData (XCam3AStats *data);
     35     ~X3aStatsData ();
     36     XCam3AStats *get_stats () {
     37         return _data;
     38     }
     39 
     40     virtual uint8_t *map ();
     41     virtual bool unmap ();
     42 
     43 private:
     44     XCAM_DEAD_COPY (X3aStatsData);
     45 private:
     46     XCam3AStats   *_data;
     47 };
     48 
     49 class X3aStats
     50     : public BufferProxy
     51 {
     52     friend class X3aStatsPool;
     53 public:
     54     XCam3AStats *get_stats ();
     55 
     56 protected:
     57     explicit X3aStats (const SmartPtr<X3aStatsData> &data);
     58     XCAM_DEAD_COPY (X3aStats);
     59 
     60 };
     61 
     62 class X3aStatsPool
     63     : public BufferPool
     64 {
     65 public:
     66     explicit X3aStatsPool ();
     67     XCam3AStatsInfo &get_stats_info () {
     68         return _stats_info;
     69     }
     70     void set_bit_depth (uint32_t bit_depth) {
     71         _bit_depth = bit_depth;
     72     }
     73     void set_stats_info (const XCam3AStatsInfo &info);
     74 
     75 protected:
     76     virtual bool fixate_video_info (VideoBufferInfo &info);
     77     virtual SmartPtr<BufferData> allocate_data (const VideoBufferInfo &buffer_info);
     78     virtual SmartPtr<BufferProxy> create_buffer_from_data (SmartPtr<BufferData> &data);
     79 
     80 private:
     81     XCAM_DEAD_COPY (X3aStatsPool);
     82 
     83 private:
     84     XCam3AStatsInfo    _stats_info;
     85     uint32_t           _bit_depth;
     86 };
     87 
     88 };
     89 
     90 #endif //XCAM_3A_STATS_POOL_H
     91 
     92