Home | History | Annotate | Download | only in gstreamer
      1 /*
      2  * gstxcamfilter.h -gst xcamfilter plugin
      3  *
      4  *  Copyright (c) 2016 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: Yinhang Liu <yinhangx.liu (at) intel.com>
     19  */
     20 
     21 #ifndef GST_XCAM_FILTER_H
     22 #define GST_XCAM_FILTER_H
     23 
     24 #include <gst/gst.h>
     25 #include <gst/video/video.h>
     26 
     27 #include "main_pipe_manager.h"
     28 #include "gst_xcam_utils.h"
     29 
     30 XCAM_BEGIN_DECLARE
     31 
     32 #define GST_TYPE_XCAM_FILTER             (gst_xcam_filter_get_type())
     33 #define GST_XCAM_FILTER(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_XCAM_FILTER,GstXCamFilter))
     34 #define GST_XCAM_FILTER_CAST(obj)        ((GstXCamFilter *) obj)
     35 
     36 
     37 typedef enum {
     38     COPY_MODE_CPU = 0,
     39     COPY_MODE_DMA
     40 } CopyMode;
     41 
     42 typedef enum {
     43     DEFOG_NONE = 0,
     44     DEFOG_RETINEX,
     45     DEFOG_DCP
     46 } DefogModeType;
     47 
     48 typedef enum {
     49     NONE_WAVELET = 0,
     50     HAT_WAVELET_Y,
     51     HAT_WAVELET_UV,
     52     HARR_WAVELET_Y,
     53     HARR_WAVELET_UV,
     54     HARR_WAVELET_YUV,
     55     HARR_WAVELET_BAYES
     56 } WaveletModeType;
     57 
     58 typedef enum {
     59     DENOISE_3D_NONE = 0,
     60     DENOISE_3D_YUV,
     61     DENOISE_3D_UV
     62 } Denoise3DModeType;
     63 
     64 enum StitchResMode {
     65     StitchRes1080P = 0,
     66     StitchRes4K = 2
     67 };
     68 
     69 typedef struct _GstXCamFilter      GstXCamFilter;
     70 typedef struct _GstXCamFilterClass GstXCamFilterClass;
     71 
     72 struct _GstXCamFilter
     73 {
     74     GstBaseTransform                         transform;
     75 
     76     uint32_t                                 buf_count;
     77     CopyMode                                 copy_mode;
     78     DefogModeType                            defog_mode;
     79     WaveletModeType                          wavelet_mode;
     80     Denoise3DModeType                        denoise_3d_mode;
     81     uint8_t                                  denoise_3d_ref_count;
     82     gboolean                                 enable_wireframe;
     83     gboolean                                 enable_image_warp;
     84     gboolean                                 enable_stitch;
     85     gboolean                                 stitch_enable_seam;
     86     gboolean                                 stitch_fisheye_map;
     87     gboolean                                 stitch_fm_ocl;
     88     gboolean                                 stitch_lsc;
     89     XCam::CLBlenderScaleMode                 stitch_scale_mode;
     90     StitchResMode                            stitch_res_mode;
     91 
     92     uint32_t                                 delay_buf_num;
     93     uint32_t                                 cached_buf_num;
     94     GstAllocator                            *allocator;
     95     GstVideoInfo                             gst_sink_video_info;
     96     GstVideoInfo                             gst_src_video_info;
     97     XCam::SmartPtr<XCam::BufferPool>         buf_pool;
     98     XCam::SmartPtr<GstXCam::MainPipeManager> pipe_manager;
     99 };
    100 
    101 struct _GstXCamFilterClass
    102 {
    103     GstBaseTransformClass parent_class;
    104 };
    105 
    106 GType gst_xcam_filter_get_type (void);
    107 
    108 XCAM_END_DECLARE
    109 
    110 #endif // GST_XCAM_FILTER_H
    111