Home | History | Annotate | Download | only in gstreamer
      1 /*
      2  * gstxcamsrc.h - gst xcamsrc plugin
      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: John Ye <john.ye (at) intel.com>
     19  * Author: Wind Yuan <feng.yuan (at) intel.com>
     20  */
     21 
     22 #ifndef GST_XCAM_SRC_H
     23 #define GST_XCAM_SRC_H
     24 
     25 #include "main_dev_manager.h"
     26 #include <gst/base/gstpushsrc.h>
     27 
     28 XCAM_BEGIN_DECLARE
     29 
     30 #define GST_TYPE_XCAM_SRC \
     31   (gst_xcam_src_get_type ())
     32 #define GST_XCAM_SRC(obj) \
     33   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_XCAM_SRC,GstXCamSrc))
     34 #define GST_XCAM_SRC_CAST(obj)   ((GstXCamSrc *) obj)
     35 
     36 #define GST_XCAM_SRC_MEM_MODE(src) ((GST_XCAM_SRC_CAST(src))->mem_type)
     37 #define GST_XCAM_SRC_FRMAE_DURATION(src) ((GST_XCAM_SRC_CAST(src))->duration)
     38 #define GST_XCAM_SRC_BUF_COUNT(src) ((GST_XCAM_SRC_CAST(src))->buf_count)
     39 #define GST_XCAM_SRC_OUT_VIDEO_INFO(src) (&(GST_XCAM_SRC_CAST(src))->gst_video_info)
     40 
     41 
     42 typedef enum {
     43     ISP_IMAGE_PROCESSOR = 0,
     44     CL_IMAGE_PROCESSOR,
     45 } ImageProcessorType;
     46 
     47 typedef enum {
     48     NONE_WDR = 0,
     49     GAUSSIAN_WDR,
     50     HALEQ_WDR,
     51 } WDRModeType;
     52 
     53 typedef enum {
     54     NONE_WAVELET = 0,
     55     HAT_WAVELET_Y,
     56     HAT_WAVELET_UV,
     57     HARR_WAVELET_Y,
     58     HARR_WAVELET_UV,
     59     HARR_WAVELET_YUV,
     60     HARR_WAVELET_BAYES,
     61 } WaveletModeType;
     62 
     63 typedef enum {
     64     DEFOG_NONE = 0,
     65     DEFOG_RETINEX,
     66     DEFOG_DCP
     67 } DefogModeType;
     68 
     69 typedef enum {
     70     DENOISE_3D_NONE = 0,
     71     DENOISE_3D_YUV,
     72     DENOISE_3D_UV
     73 } Denoise3DModeType;
     74 
     75 typedef enum {
     76     SIMPLE_ANALYZER = 0,
     77     AIQ_TUNER_ANALYZER,
     78     DYNAMIC_ANALYZER,
     79     HYBRID_ANALYZER,
     80 } AnalyzerType;
     81 
     82 typedef struct _GstXCamSrc      GstXCamSrc;
     83 typedef struct _GstXCamSrcClass GstXCamSrcClass;
     84 
     85 struct _GstXCamSrc
     86 {
     87     GstPushSrc                   pushsrc;
     88     GstBufferPool               *pool;
     89 
     90     uint32_t                     buf_count;
     91     uint32_t                     sensor_id;
     92     uint32_t                     capture_mode;
     93     char                        *device;
     94     char                        *path_to_cpf;
     95     char                        *path_to_3alib;
     96     gboolean                     enable_3a;
     97     gboolean                     enable_usb;
     98     DefogModeType                defog_mode;
     99     Denoise3DModeType            denoise_3d_mode;
    100     uint8_t                      denoise_3d_ref_count;
    101     gboolean                     enable_wireframe;
    102     gboolean                     enable_image_warp;
    103     char                        *path_to_fake;
    104 
    105     gboolean                     time_offset_ready;
    106     int64_t                      time_offset;
    107     int64_t                      buf_mark;
    108     GstClockTime                 duration;
    109 
    110     enum v4l2_memory             mem_type;
    111     enum v4l2_field              field;
    112     uint32_t                     in_format;
    113     uint32_t                     out_format;
    114     GstVideoInfo                 gst_video_info;
    115     XCam::VideoBufferInfo        xcam_video_info;
    116     ImageProcessorType           image_processor_type;
    117     WDRModeType                  wdr_mode_type;
    118     AnalyzerType                 analyzer_type;
    119     int32_t                      cl_pipe_profile;
    120     WaveletModeType              wavelet_mode;
    121     XCam::SmartPtr<GstXCam::MainDeviceManager>  device_manager;
    122 };
    123 
    124 struct _GstXCamSrcClass
    125 {
    126     GstPushSrcClass parent_class;
    127 };
    128 
    129 GType gst_xcam_src_get_type (void);
    130 
    131 XCAM_END_DECLARE
    132 
    133 #endif // GST_XCAM_SRC_H
    134