mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
filter: re-indent all GstVaapiFilter related source code.
This commit is contained in:
parent
c472403bb4
commit
c537648c5b
2 changed files with 1008 additions and 1025 deletions
|
@ -39,7 +39,8 @@
|
|||
((GstVaapiFilter *)(obj))
|
||||
|
||||
typedef struct _GstVaapiFilterOpData GstVaapiFilterOpData;
|
||||
struct _GstVaapiFilterOpData {
|
||||
struct _GstVaapiFilterOpData
|
||||
{
|
||||
GstVaapiFilterOp op;
|
||||
GParamSpec *pspec;
|
||||
volatile gint ref_count;
|
||||
|
@ -53,7 +54,8 @@ struct _GstVaapiFilterOpData {
|
|||
guint is_enabled:1;
|
||||
};
|
||||
|
||||
struct _GstVaapiFilter {
|
||||
struct _GstVaapiFilter
|
||||
{
|
||||
/*< private > */
|
||||
GstVaapiMiniObject parent_instance;
|
||||
|
||||
|
@ -182,8 +184,7 @@ vpp_get_filters(GstVaapiFilter *filter, guint *num_filters_ptr)
|
|||
}
|
||||
|
||||
static gpointer
|
||||
vpp_get_filter_caps_unlocked(
|
||||
GstVaapiFilter *filter, VAProcFilterType type,
|
||||
vpp_get_filter_caps_unlocked (GstVaapiFilter * filter, VAProcFilterType type,
|
||||
guint cap_size, guint * num_caps_ptr)
|
||||
{
|
||||
gpointer caps;
|
||||
|
@ -238,7 +239,8 @@ vpp_get_filter_caps(GstVaapiFilter *filter, VAProcFilterType type,
|
|||
#if USE_VA_VPP
|
||||
#define DEFAULT_FORMAT GST_VIDEO_FORMAT_UNKNOWN
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_FORMAT = GST_VAAPI_FILTER_OP_FORMAT,
|
||||
|
@ -255,6 +257,7 @@ enum {
|
|||
};
|
||||
|
||||
static GParamSpec *g_properties[N_PROPERTIES] = { NULL, };
|
||||
|
||||
static gsize g_properties_initialized = FALSE;
|
||||
|
||||
static void
|
||||
|
@ -265,37 +268,31 @@ init_properties(void)
|
|||
*
|
||||
* The forced output pixel format, expressed as a #GstVideoFormat.
|
||||
*/
|
||||
g_properties[PROP_FORMAT] =
|
||||
g_param_spec_enum("format",
|
||||
g_properties[PROP_FORMAT] = g_param_spec_enum ("format",
|
||||
"Format",
|
||||
"The forced output pixel format",
|
||||
GST_TYPE_VIDEO_FORMAT,
|
||||
DEFAULT_FORMAT,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
DEFAULT_FORMAT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:crop-rect:
|
||||
*
|
||||
* The cropping rectangle, expressed as a #GstVaapiRectangle.
|
||||
*/
|
||||
g_properties[PROP_CROP] =
|
||||
g_param_spec_boxed("crop-rect",
|
||||
g_properties[PROP_CROP] = g_param_spec_boxed ("crop-rect",
|
||||
"Cropping Rectangle",
|
||||
"The cropping rectangle",
|
||||
GST_VAAPI_TYPE_RECTANGLE,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
GST_VAAPI_TYPE_RECTANGLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:denoise:
|
||||
*
|
||||
* The level of noise reduction to apply.
|
||||
*/
|
||||
g_properties[PROP_DENOISE] =
|
||||
g_param_spec_float("denoise",
|
||||
g_properties[PROP_DENOISE] = g_param_spec_float ("denoise",
|
||||
"Denoising Level",
|
||||
"The level of denoising to apply",
|
||||
0.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
0.0, 1.0, 0.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:sharpen:
|
||||
|
@ -303,12 +300,10 @@ init_properties(void)
|
|||
* The level of sharpening to apply for positive values, or the
|
||||
* level of blurring for negative values.
|
||||
*/
|
||||
g_properties[PROP_SHARPEN] =
|
||||
g_param_spec_float("sharpen",
|
||||
g_properties[PROP_SHARPEN] = g_param_spec_float ("sharpen",
|
||||
"Sharpening Level",
|
||||
"The level of sharpening/blurring to apply",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
-1.0, 1.0, 0.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:hue:
|
||||
|
@ -316,25 +311,21 @@ init_properties(void)
|
|||
* The color hue, expressed as a float value. Range is -180.0 to
|
||||
* 180.0. Default value is 0.0 and represents no modification.
|
||||
*/
|
||||
g_properties[PROP_HUE] =
|
||||
g_param_spec_float("hue",
|
||||
g_properties[PROP_HUE] = g_param_spec_float ("hue",
|
||||
"Hue",
|
||||
"The color hue value",
|
||||
-180.0, 180.0, 0.0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
-180.0, 180.0, 0.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:saturation:
|
||||
*
|
||||
* The color saturation, expressed as a float value. Range is 0.0
|
||||
* to 2.0. Default value is 1.0 and represents no modification.
|
||||
* The color saturation, expressed as a float value. Range is 0.0 to
|
||||
* 2.0. Default value is 1.0 and represents no modification.
|
||||
*/
|
||||
g_properties[PROP_SATURATION] =
|
||||
g_param_spec_float("saturation",
|
||||
g_properties[PROP_SATURATION] = g_param_spec_float ("saturation",
|
||||
"Saturation",
|
||||
"The color saturation value",
|
||||
0.0, 2.0, 1.0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
0.0, 2.0, 1.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:brightness:
|
||||
|
@ -342,12 +333,10 @@ init_properties(void)
|
|||
* The color brightness, expressed as a float value. Range is -1.0
|
||||
* to 1.0. Default value is 0.0 and represents no modification.
|
||||
*/
|
||||
g_properties[PROP_BRIGHTNESS] =
|
||||
g_param_spec_float("brightness",
|
||||
g_properties[PROP_BRIGHTNESS] = g_param_spec_float ("brightness",
|
||||
"Brightness",
|
||||
"The color brightness value",
|
||||
-1.0, 1.0, 0.0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
-1.0, 1.0, 0.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:contrast:
|
||||
|
@ -355,12 +344,10 @@ init_properties(void)
|
|||
* The color contrast, expressed as a float value. Range is 0.0 to
|
||||
* 2.0. Default value is 1.0 and represents no modification.
|
||||
*/
|
||||
g_properties[PROP_CONTRAST] =
|
||||
g_param_spec_float("contrast",
|
||||
g_properties[PROP_CONTRAST] = g_param_spec_float ("contrast",
|
||||
"Contrast",
|
||||
"The color contrast value",
|
||||
0.0, 2.0, 1.0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
0.0, 2.0, 1.0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
/**
|
||||
* GstVaapiFilter:deinterlace-method:
|
||||
|
@ -368,8 +355,7 @@ init_properties(void)
|
|||
* The deinterlacing algorithm to apply, expressed a an enum
|
||||
* value. See #GstVaapiDeinterlaceMethod.
|
||||
*/
|
||||
g_properties[PROP_DEINTERLACING] =
|
||||
g_param_spec_enum("deinterlace",
|
||||
g_properties[PROP_DEINTERLACING] = g_param_spec_enum ("deinterlace",
|
||||
"Deinterlacing Method",
|
||||
"Deinterlacing method to apply",
|
||||
GST_VAAPI_TYPE_DEINTERLACE_METHOD,
|
||||
|
@ -436,12 +422,14 @@ op_data_new(GstVaapiFilterOp op, GParamSpec *pspec)
|
|||
op_colorbalance:
|
||||
op_data->va_type = VAProcFilterColorBalance;
|
||||
op_data->va_cap_size = sizeof (VAProcFilterCapColorBalance);
|
||||
op_data->va_buffer_size = sizeof(VAProcFilterParameterBufferColorBalance);
|
||||
op_data->va_buffer_size =
|
||||
sizeof (VAProcFilterParameterBufferColorBalance);
|
||||
break;
|
||||
case GST_VAAPI_FILTER_OP_DEINTERLACING:
|
||||
op_data->va_type = VAProcFilterDeinterlacing;
|
||||
op_data->va_cap_size = sizeof (VAProcFilterCapDeinterlacing);
|
||||
op_data->va_buffer_size = sizeof(VAProcFilterParameterBufferDeinterlacing);
|
||||
op_data->va_buffer_size =
|
||||
sizeof (VAProcFilterParameterBufferDeinterlacing);
|
||||
break;
|
||||
default:
|
||||
g_assert (0 && "unsupported operation");
|
||||
|
@ -499,8 +487,7 @@ op_data_ensure_caps(GstVaapiFilterOpData *op_data, gpointer filter_caps,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
op_data->va_caps = g_memdup(filter_cap,
|
||||
op_data->va_cap_size * va_num_caps);
|
||||
op_data->va_caps = g_memdup (filter_cap, op_data->va_cap_size * va_num_caps);
|
||||
if (!op_data->va_caps)
|
||||
return FALSE;
|
||||
|
||||
|
@ -586,8 +573,7 @@ get_operations_ordered(GstVaapiFilter *filter, GPtrArray *default_ops)
|
|||
|
||||
// Append virtual ops first, i.e. those without an associated VA filter
|
||||
for (i = 0; i < default_ops->len; i++) {
|
||||
GstVaapiFilterOpData * const op_data =
|
||||
g_ptr_array_index(default_ops, i);
|
||||
GstVaapiFilterOpData *const op_data = g_ptr_array_index (default_ops, i);
|
||||
if (op_data->va_type == VAProcFilterNone)
|
||||
g_ptr_array_add (ops, op_data_ref (op_data));
|
||||
}
|
||||
|
@ -599,8 +585,7 @@ get_operations_ordered(GstVaapiFilter *filter, GPtrArray *default_ops)
|
|||
continue;
|
||||
|
||||
for (j = 0; j < default_ops->len; j++) {
|
||||
GstVaapiFilterOpData * const op_data =
|
||||
g_ptr_array_index(default_ops, j);
|
||||
GstVaapiFilterOpData *const op_data = g_ptr_array_index (default_ops, j);
|
||||
if (op_data->va_type != va_type)
|
||||
continue;
|
||||
|
||||
|
@ -709,8 +694,8 @@ op_ensure_buffer(GstVaapiFilter *filter, GstVaapiFilterOpData *op_data)
|
|||
/* Update a generic filter (float value) */
|
||||
#if USE_VA_VPP
|
||||
static gboolean
|
||||
op_set_generic_unlocked(GstVaapiFilter *filter, GstVaapiFilterOpData *op_data,
|
||||
gfloat value)
|
||||
op_set_generic_unlocked (GstVaapiFilter * filter,
|
||||
GstVaapiFilterOpData * op_data, gfloat value)
|
||||
{
|
||||
VAProcFilterParameterBuffer *buf;
|
||||
VAProcFilterCap *filter_cap;
|
||||
|
@ -928,8 +913,8 @@ ensure_formats(GstVaapiFilter *filter)
|
|||
if (!(surface_attrib->flags & VA_SURFACE_ATTRIB_SETTABLE))
|
||||
continue;
|
||||
|
||||
format = gst_vaapi_video_format_from_va_fourcc(
|
||||
surface_attrib->value.value.i);
|
||||
format =
|
||||
gst_vaapi_video_format_from_va_fourcc (surface_attrib->value.value.i);
|
||||
if (format == GST_VIDEO_FORMAT_UNKNOWN)
|
||||
continue;
|
||||
g_array_append_val (filter->formats, format);
|
||||
|
@ -1109,8 +1094,9 @@ gst_vaapi_filter_ref(GstVaapiFilter *filter)
|
|||
{
|
||||
g_return_val_if_fail (filter != NULL, NULL);
|
||||
|
||||
return GST_VAAPI_FILTER(gst_vaapi_mini_object_ref(
|
||||
GST_VAAPI_MINI_OBJECT(filter)));
|
||||
return
|
||||
GST_VAAPI_FILTER (gst_vaapi_mini_object_ref (GST_VAAPI_MINI_OBJECT
|
||||
(filter)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1324,8 +1310,7 @@ gst_vaapi_filter_process_unlocked(GstVaapiFilter *filter,
|
|||
src_rect.y = crop_rect->y;
|
||||
src_rect.width = crop_rect->width;
|
||||
src_rect.height = crop_rect->height;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
src_rect.x = 0;
|
||||
src_rect.y = 0;
|
||||
src_rect.width = GST_VAAPI_SURFACE_WIDTH (src_surface);
|
||||
|
@ -1346,8 +1331,7 @@ gst_vaapi_filter_process_unlocked(GstVaapiFilter *filter,
|
|||
dst_rect.y = target_rect->y;
|
||||
dst_rect.width = target_rect->width;
|
||||
dst_rect.height = target_rect->height;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dst_rect.x = 0;
|
||||
dst_rect.y = 0;
|
||||
dst_rect.width = GST_VAAPI_SURFACE_WIDTH (dst_surface);
|
||||
|
@ -1396,8 +1380,7 @@ gst_vaapi_filter_process_unlocked(GstVaapiFilter *filter,
|
|||
pipeline_param->num_forward_references =
|
||||
MIN (filter->forward_references->len,
|
||||
pipeline_caps.num_forward_references);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pipeline_param->forward_references = NULL;
|
||||
pipeline_param->num_forward_references = 0;
|
||||
}
|
||||
|
@ -1408,8 +1391,7 @@ gst_vaapi_filter_process_unlocked(GstVaapiFilter *filter,
|
|||
pipeline_param->num_backward_references =
|
||||
MIN (filter->backward_references->len,
|
||||
pipeline_caps.num_backward_references);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
pipeline_param->backward_references = NULL;
|
||||
pipeline_param->num_backward_references = 0;
|
||||
}
|
||||
|
@ -1443,8 +1425,8 @@ error:
|
|||
}
|
||||
|
||||
GstVaapiFilterStatus
|
||||
gst_vaapi_filter_process(GstVaapiFilter *filter, GstVaapiSurface *src_surface,
|
||||
GstVaapiSurface *dst_surface, guint flags)
|
||||
gst_vaapi_filter_process (GstVaapiFilter * filter,
|
||||
GstVaapiSurface * src_surface, GstVaapiSurface * dst_surface, guint flags)
|
||||
{
|
||||
GstVaapiFilterStatus status;
|
||||
|
||||
|
|
|
@ -62,7 +62,8 @@ typedef enum {
|
|||
*
|
||||
* A #GstVaapiFilterOp descriptor.
|
||||
*/
|
||||
struct _GstVaapiFilterOpInfo {
|
||||
struct _GstVaapiFilterOpInfo
|
||||
{
|
||||
const GstVaapiFilterOp op;
|
||||
GParamSpec *const pspec;
|
||||
};
|
||||
|
@ -168,8 +169,8 @@ gst_vaapi_filter_set_operation(GstVaapiFilter *filter, GstVaapiFilterOp op,
|
|||
const GValue * value);
|
||||
|
||||
GstVaapiFilterStatus
|
||||
gst_vaapi_filter_process(GstVaapiFilter *filter, GstVaapiSurface *src_surface,
|
||||
GstVaapiSurface *dst_surface, guint flags);
|
||||
gst_vaapi_filter_process (GstVaapiFilter * filter,
|
||||
GstVaapiSurface * src_surface, GstVaapiSurface * dst_surface, guint flags);
|
||||
|
||||
GArray *
|
||||
gst_vaapi_filter_get_formats (GstVaapiFilter * filter);
|
||||
|
|
Loading…
Reference in a new issue