taglist, plugins: fix compiler warnings with GLib >= 2.76
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / sys / msdk / gstmsdkvpp.h
1 /* GStreamer Intel MSDK plugin
2  * Copyright (c) 2018, Intel Corporation, Inc.
3  * Author : Sreerenj Balachandran <sreerenj.balachandran@intel.com>
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright notice,
10  *    this list of conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright notice,
13  *    this list of conditions and the following disclaimer in the documentation
14  *    and/or other materials provided with the distribution.
15  *
16  * 3. Neither the name of the copyright holder nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32
33 #ifndef __GST_MSDKVPP_H__
34 #define __GST_MSDKVPP_H__
35
36 #include "gstmsdkcontext.h"
37 #include "msdk-enums.h"
38 #include <gst/base/gstbasetransform.h>
39 G_BEGIN_DECLS
40
41 #define GST_TYPE_MSDKVPP \
42   (gst_msdkvpp_get_type())
43 #define GST_MSDKVPP(obj) \
44   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MSDKVPP,GstMsdkVPP))
45 #define GST_MSDKVPP_CLASS(klass) \
46   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MSDKVPP,GstMsdkVPPClass))
47 #define GST_MSDKVPP_GET_CLASS(obj) \
48   (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_MSDKVPP,GstMsdkVPPClass))
49 #define GST_IS_MSDKVPP(obj) \
50   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MSDKVPP))
51 #define GST_IS_MSDKVPP_CLASS(klass) \
52   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MSDKVPP))
53
54 #define MAX_EXTRA_PARAMS                 8
55
56 typedef struct _GstMsdkVPP GstMsdkVPP;
57 typedef struct _GstMsdkVPPClass GstMsdkVPPClass;
58
59 typedef enum {
60   GST_MSDK_FLAG_DENOISE      = 1 << 0,
61   GST_MSDK_FLAG_ROTATION     = 1 << 1,
62   GST_MSDK_FLAG_DEINTERLACE  = 1 << 2,
63   GST_MSDK_FLAG_HUE          = 1 << 3,
64   GST_MSDK_FLAG_SATURATION   = 1 << 4,
65   GST_MSDK_FLAG_BRIGHTNESS   = 1 << 5,
66   GST_MSDK_FLAG_CONTRAST     = 1 << 6,
67   GST_MSDK_FLAG_DETAIL       = 1 << 7,
68   GST_MSDK_FLAG_MIRRORING    = 1 << 8,
69   GST_MSDK_FLAG_SCALING_MODE = 1 << 9,
70   GST_MSDK_FLAG_FRC          = 1 << 10,
71   GST_MSDK_FLAG_VIDEO_DIRECTION = 1 << 11,
72 } GstMsdkVppFlags;
73
74 struct _GstMsdkVPP
75 {
76   GstBaseTransform element;
77
78   /* sinkpad info */
79   GstPad *sinkpad;
80   GstVideoInfo sinkpad_info;
81   GstVideoInfo sinkpad_buffer_pool_info;
82   GstBufferPool *sinkpad_buffer_pool;
83
84   /* srcpad info */
85   GstPad *srcpad;
86   GstVideoInfo srcpad_info;
87   GstVideoInfo srcpad_buffer_pool_info;
88   GstBufferPool *srcpad_buffer_pool;
89
90   /* MFX context */
91   GstMsdkContext *context;
92   GstMsdkContext *old_context;
93   mfxVideoParam param;
94   guint in_num_surfaces;
95
96   gboolean initialized;
97   gboolean use_video_memory;
98   gboolean use_sinkpad_dmabuf;
99   gboolean use_srcpad_dmabuf;
100   gboolean shared_context;
101   gboolean add_video_meta;
102   gboolean need_vpp;
103   guint flags;
104
105   /* element properties */
106   gboolean hardware;
107   guint async_depth;
108   guint denoise_factor;
109   guint rotation;
110   guint deinterlace_mode;
111   guint deinterlace_method;
112   gfloat hue;
113   gfloat saturation;
114   gfloat brightness;
115   gfloat contrast;
116   guint detail;
117   guint mirroring;
118   guint scaling_mode;
119   gboolean keep_aspect;
120   guint frc_algm;
121   guint video_direction;
122   guint crop_left;
123   guint crop_right;
124   guint crop_top;
125   guint crop_bottom;
126
127   GstClockTime buffer_duration;
128
129   /* MFX Filters */
130   mfxExtVPPDoUse mfx_vpp_douse;
131   mfxExtVPPDenoise mfx_denoise;
132   mfxExtVPPRotation mfx_rotation;
133   mfxExtVPPDeinterlacing mfx_deinterlace;
134   mfxExtVPPProcAmp mfx_procamp;
135   mfxExtVPPDetail mfx_detail;
136   mfxExtVPPMirroring mfx_mirroring;
137   mfxExtVPPScaling mfx_scaling;
138   mfxExtVPPFrameRateConversion mfx_frc;
139
140   /* Extended buffers */
141   mfxExtBuffer *extra_params[MAX_EXTRA_PARAMS];
142   guint num_extra_params;
143
144   mfxFrameAllocRequest request[2];
145   GList* locked_in_surfaces;
146   GList* locked_out_surfaces;
147 };
148
149 struct _GstMsdkVPPClass
150 {
151   GstBaseTransformClass parent_class;
152 };
153
154 GType gst_msdkvpp_get_type (void);
155
156 G_END_DECLS
157
158 #endif /* __GST_MSDKVPP_H__ */