1 /* GStreamer Intel MSDK plugin
2 * Copyright (c) 2018, Intel Corporation, Inc.
3 * Author : Sreerenj Balachandran <sreerenj.balachandran@intel.com>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
9 * 1. Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
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.
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.
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.
33 #ifndef __GST_MSDKVPP_H__
34 #define __GST_MSDKVPP_H__
36 #include "gstmsdkcontext.h"
37 #include "msdk-enums.h"
38 #include <gst/base/gstbasetransform.h>
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))
54 #define MAX_EXTRA_PARAMS 8
56 typedef struct _GstMsdkVPP GstMsdkVPP;
57 typedef struct _GstMsdkVPPClass GstMsdkVPPClass;
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,
76 GstBaseTransform element;
80 GstVideoInfo sinkpad_info;
81 GstVideoInfo sinkpad_buffer_pool_info;
82 GstBufferPool *sinkpad_buffer_pool;
86 GstVideoInfo srcpad_info;
87 GstVideoInfo srcpad_buffer_pool_info;
88 GstBufferPool *srcpad_buffer_pool;
91 GstMsdkContext *context;
92 GstMsdkContext *old_context;
94 guint in_num_surfaces;
97 gboolean use_video_memory;
98 gboolean use_sinkpad_dmabuf;
99 gboolean use_srcpad_dmabuf;
100 gboolean shared_context;
101 gboolean add_video_meta;
105 /* element properties */
108 guint denoise_factor;
110 guint deinterlace_mode;
111 guint deinterlace_method;
119 gboolean keep_aspect;
121 guint video_direction;
127 GstClockTime buffer_duration;
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;
140 /* Extended buffers */
141 mfxExtBuffer *extra_params[MAX_EXTRA_PARAMS];
142 guint num_extra_params;
144 mfxFrameAllocRequest request[2];
145 GList* locked_in_surfaces;
146 GList* locked_out_surfaces;
149 struct _GstMsdkVPPClass
151 GstBaseTransformClass parent_class;
154 GType gst_msdkvpp_get_type (void);
158 #endif /* __GST_MSDKVPP_H__ */