style: run gst-indent
This commit is contained in:
@@ -12,25 +12,20 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
static gboolean
|
||||
plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "sensorfx", 0, "sensorfx");
|
||||
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "sensorfx", 0, "sensorfx");
|
||||
|
||||
GST_DEBUG ("plugin_init");
|
||||
GST_DEBUG ("plugin_init");
|
||||
|
||||
if ( !gst_element_register (plugin, "sfx3dnoise", GST_RANK_NONE,
|
||||
GST_TYPE_SFX3DNOISE)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
if (!gst_element_register (plugin, "sfx3dnoise", GST_RANK_NONE,
|
||||
GST_TYPE_SFX3DNOISE)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||
GST_VERSION_MINOR,
|
||||
"sensorfx",
|
||||
"Filters to simulate the effects of real sensors",
|
||||
plugin_init,
|
||||
VERSION,
|
||||
GST_LICENSE,
|
||||
PACKAGE_NAME,
|
||||
GST_PACKAGE_ORIGIN
|
||||
);
|
||||
GST_VERSION_MINOR,
|
||||
"sensorfx",
|
||||
"Filters to simulate the effects of real sensors",
|
||||
plugin_init, VERSION, GST_LICENSE, PACKAGE_NAME, GST_PACKAGE_ORIGIN);
|
||||
|
||||
@@ -90,23 +90,28 @@ static void gst_sfx3dnoise_set_property (GObject * object, guint prop_id,
|
||||
static void gst_sfx3dnoise_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
|
||||
static GstFlowReturn gst_sfx3dnoise_cv_transform (GstOpencvBaseTransform * filter,
|
||||
GstBuffer * buf, IplImage * img, GstBuffer * outbuf, IplImage * outimg);
|
||||
static GstFlowReturn gst_sfx3dnoise_cv_transform (GstOpencvBaseTransform *
|
||||
filter, GstBuffer * buf, IplImage * img, GstBuffer * outbuf,
|
||||
IplImage * outimg);
|
||||
static gboolean gst_sfx3dnoise_cv_set_caps (GstOpencvBaseTransform * trans,
|
||||
gint in_width, gint in_height, gint in_depth, gint in_channels,
|
||||
gint out_width, gint out_height, gint out_depth, gint out_channels);
|
||||
|
||||
void gst_sfx3dnoise_create_fixed_noise (GstSfx3DNoise * filter, CvMat * arr);
|
||||
void gst_sfx3dnoise_add_sigma_t (GstSfx3DNoise * filter, CvMat * arr, double sigma);
|
||||
void gst_sfx3dnoise_add_sigma_tv (GstSfx3DNoise * filter, CvMat * arr, double sigma);
|
||||
void gst_sfx3dnoise_add_sigma_th (GstSfx3DNoise * filter, CvMat * arr, double sigma);
|
||||
void gst_sfx3dnoise_add_sigma_tvh (GstSfx3DNoise * filter, CvMat * arr, double sigma);
|
||||
void gst_sfx3dnoise_add_sigma_t (GstSfx3DNoise * filter, CvMat * arr,
|
||||
double sigma);
|
||||
void gst_sfx3dnoise_add_sigma_tv (GstSfx3DNoise * filter, CvMat * arr,
|
||||
double sigma);
|
||||
void gst_sfx3dnoise_add_sigma_th (GstSfx3DNoise * filter, CvMat * arr,
|
||||
double sigma);
|
||||
void gst_sfx3dnoise_add_sigma_tvh (GstSfx3DNoise * filter, CvMat * arr,
|
||||
double sigma);
|
||||
|
||||
/* Clean up */
|
||||
static void
|
||||
gst_sfx3dnoise_finalize (GObject * obj)
|
||||
{
|
||||
GstSfx3DNoise * filter = GST_SFX3DNOISE (obj);
|
||||
GstSfx3DNoise *filter = GST_SFX3DNOISE (obj);
|
||||
|
||||
if (filter->fixed_noise)
|
||||
cvReleaseMat (&filter->fixed_noise);
|
||||
@@ -129,9 +134,9 @@ gst_sfx3dnoise_base_init (gpointer gclass)
|
||||
GstPadTemplate *templ;
|
||||
|
||||
/* add sink and source pad templates */
|
||||
caps = gst_caps_from_string (GST_VIDEO_CAPS_GRAY16("1234"));
|
||||
caps = gst_caps_from_string (GST_VIDEO_CAPS_GRAY16 ("1234"));
|
||||
templ = gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
|
||||
gst_caps_ref (caps));
|
||||
gst_caps_ref (caps));
|
||||
gst_element_class_add_pad_template (element_class, templ);
|
||||
templ = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, caps);
|
||||
gst_element_class_add_pad_template (element_class, templ);
|
||||
@@ -139,8 +144,7 @@ gst_sfx3dnoise_base_init (gpointer gclass)
|
||||
gst_element_class_set_details_simple (element_class,
|
||||
"sfx3dnoise",
|
||||
"Transform/Effect/Video",
|
||||
"Add 3D noise to video",
|
||||
"Joshua M. Doe <oss@nvl.army.mil>");
|
||||
"Add 3D noise to video", "Joshua M. Doe <oss@nvl.army.mil>");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -175,37 +179,37 @@ gst_sfx3dnoise_class_init (GstSfx3DNoiseClass * klass)
|
||||
g_param_spec_double ("sigma-v", "sigma-v",
|
||||
"Adds fixed row noise (horizontal lines)",
|
||||
0.0, 1.0, DEFAULT_SIGMA_T, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
||||
);
|
||||
);
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_SIGMA_H,
|
||||
g_param_spec_double ("sigma-h", "sigma-h",
|
||||
"Adds fixed column noise (vertical lines)",
|
||||
0.0, 1.0, DEFAULT_SIGMA_T, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
||||
);
|
||||
);
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_SIGMA_TV,
|
||||
g_param_spec_double ("sigma-tv", "sigma-tv",
|
||||
"Adds temporal row bounce (random horizontal lines)",
|
||||
0.0, 1.0, DEFAULT_SIGMA_T, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
||||
);
|
||||
);
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_SIGMA_TH,
|
||||
g_param_spec_double ("sigma-th", "sigma-th",
|
||||
"Adds temporal column bounce (random vertical lines)",
|
||||
0.0, 1.0, DEFAULT_SIGMA_T, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
||||
);
|
||||
);
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_SIGMA_VH,
|
||||
g_param_spec_double ("sigma-vh", "sigma-vh",
|
||||
"Adds random time-independent spatial noise (fixed pattern noise)",
|
||||
0.0, 1.0, DEFAULT_SIGMA_T, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
||||
);
|
||||
);
|
||||
|
||||
g_object_class_install_property (gobject_class, PROP_SIGMA_TVH,
|
||||
g_param_spec_double ("sigma-tvh", "sigma-tvh",
|
||||
"Adds random spatio-temporal noise",
|
||||
0.0, 1.0, DEFAULT_SIGMA_T, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -221,7 +225,7 @@ gst_sfx3dnoise_init (GstSfx3DNoise * filter, GstSfx3DNoiseClass * gclass)
|
||||
filter->sigma_vh = filter->sigma_vh_old = DEFAULT_SIGMA_VH;
|
||||
filter->sigma_tvh = DEFAULT_SIGMA_TVH;
|
||||
|
||||
filter->rng = cvRNG(-1);
|
||||
filter->rng = cvRNG (-1);
|
||||
filter->fixed_noise = NULL;
|
||||
filter->intermediary = NULL;
|
||||
|
||||
@@ -239,25 +243,25 @@ gst_sfx3dnoise_set_property (GObject * object, guint prop_id,
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_SIGMA_T:
|
||||
filter->sigma_t= g_value_get_double (value);
|
||||
filter->sigma_t = g_value_get_double (value);
|
||||
break;
|
||||
case PROP_SIGMA_V:
|
||||
filter->sigma_v= g_value_get_double (value);
|
||||
filter->sigma_v = g_value_get_double (value);
|
||||
break;
|
||||
case PROP_SIGMA_H:
|
||||
filter->sigma_h= g_value_get_double (value);
|
||||
filter->sigma_h = g_value_get_double (value);
|
||||
break;
|
||||
case PROP_SIGMA_TV:
|
||||
filter->sigma_tv= g_value_get_double (value);
|
||||
filter->sigma_tv = g_value_get_double (value);
|
||||
break;
|
||||
case PROP_SIGMA_TH:
|
||||
filter->sigma_th= g_value_get_double (value);
|
||||
filter->sigma_th = g_value_get_double (value);
|
||||
break;
|
||||
case PROP_SIGMA_VH:
|
||||
filter->sigma_vh= g_value_get_double (value);
|
||||
filter->sigma_vh = g_value_get_double (value);
|
||||
break;
|
||||
case PROP_SIGMA_TVH:
|
||||
filter->sigma_tvh= g_value_get_double (value);
|
||||
filter->sigma_tvh = g_value_get_double (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
@@ -320,20 +324,24 @@ gst_sfx3dnoise_cv_transform (GstOpencvBaseTransform * base, GstBuffer * buf,
|
||||
filter->sigma_vh_old = filter->sigma_vh;
|
||||
}
|
||||
|
||||
if (filter->sigma_h != 0.0 || filter->sigma_v != 0.0 || filter->sigma_vh != 0.0) {
|
||||
if (filter->sigma_h != 0.0 || filter->sigma_v != 0.0
|
||||
|| filter->sigma_vh != 0.0) {
|
||||
cvAdd (filter->intermediary, filter->fixed_noise, filter->intermediary, 0);
|
||||
}
|
||||
|
||||
if (filter->sigma_tvh > 0.0) {
|
||||
gst_sfx3dnoise_add_sigma_tvh (filter, filter->intermediary, filter->sigma_tvh);
|
||||
gst_sfx3dnoise_add_sigma_tvh (filter, filter->intermediary,
|
||||
filter->sigma_tvh);
|
||||
}
|
||||
|
||||
if (filter->sigma_tv > 0.0) {
|
||||
gst_sfx3dnoise_add_sigma_tv (filter, filter->intermediary, filter->sigma_tv);
|
||||
gst_sfx3dnoise_add_sigma_tv (filter, filter->intermediary,
|
||||
filter->sigma_tv);
|
||||
}
|
||||
|
||||
if (filter->sigma_th > 0.0) {
|
||||
gst_sfx3dnoise_add_sigma_th (filter, filter->intermediary, filter->sigma_th);
|
||||
gst_sfx3dnoise_add_sigma_th (filter, filter->intermediary,
|
||||
filter->sigma_th);
|
||||
}
|
||||
|
||||
if (filter->sigma_t > 0.0) {
|
||||
@@ -347,8 +355,8 @@ gst_sfx3dnoise_cv_transform (GstOpencvBaseTransform * base, GstBuffer * buf,
|
||||
|
||||
static gboolean
|
||||
gst_sfx3dnoise_cv_set_caps (GstOpencvBaseTransform * trans, gint in_width,
|
||||
gint in_height, gint in_depth, gint in_channels, gint out_width,
|
||||
gint out_height, gint out_depth, gint out_channels)
|
||||
gint in_height, gint in_depth, gint in_channels, gint out_width,
|
||||
gint out_height, gint out_depth, gint out_channels)
|
||||
{
|
||||
GstSfx3DNoise *filter = GST_SFX3DNOISE (trans);
|
||||
|
||||
@@ -400,12 +408,13 @@ gst_sfx3dnoise_create_fixed_noise (GstSfx3DNoise * filter, CvMat * arr)
|
||||
|
||||
/* Add sigma-vh or sigma-tvh noise, which adds random noise to every pixel */
|
||||
void
|
||||
gst_sfx3dnoise_add_sigma_tvh (GstSfx3DNoise * filter, CvMat * arr, double sigma) {
|
||||
CvMat * noise = cvCreateMat (filter->height, filter->width, CV_32F);
|
||||
|
||||
gst_sfx3dnoise_add_sigma_tvh (GstSfx3DNoise * filter, CvMat * arr, double sigma)
|
||||
{
|
||||
CvMat *noise = cvCreateMat (filter->height, filter->width, CV_32F);
|
||||
|
||||
/* TODO move scaling of sigma somewhere else? */
|
||||
cvRandArr (&filter->rng, noise, CV_RAND_NORMAL, cvScalarAll (0),
|
||||
cvScalarAll (sigma*(G_MAXUINT16-1)));
|
||||
cvScalarAll (sigma * (G_MAXUINT16 - 1)));
|
||||
|
||||
cvAdd (arr, noise, arr, 0);
|
||||
|
||||
@@ -415,24 +424,25 @@ gst_sfx3dnoise_add_sigma_tvh (GstSfx3DNoise * filter, CvMat * arr, double sigma)
|
||||
|
||||
/* Add sigma-v or sigma-tv noise, which adds random horizontal lines */
|
||||
void
|
||||
gst_sfx3dnoise_add_sigma_tv (GstSfx3DNoise * filter, CvMat * arr, double sigma) {
|
||||
CvMat * noise = cvCreateMat (1, filter->height, CV_32F);
|
||||
gfloat * data;
|
||||
gfloat * noisedata;
|
||||
gst_sfx3dnoise_add_sigma_tv (GstSfx3DNoise * filter, CvMat * arr, double sigma)
|
||||
{
|
||||
CvMat *noise = cvCreateMat (1, filter->height, CV_32F);
|
||||
gfloat *data;
|
||||
gfloat *noisedata;
|
||||
int step, x, y;
|
||||
|
||||
/* TODO move scaling of sigma somewhere else? */
|
||||
cvRandArr (&filter->rng, noise, CV_RAND_NORMAL, cvScalarAll (0),
|
||||
cvScalarAll (sigma*(G_MAXUINT16-1)));
|
||||
cvScalarAll (sigma * (G_MAXUINT16 - 1)));
|
||||
|
||||
cvGetRawData (arr, (uchar**)&data, &step, NULL);
|
||||
cvGetRawData (noise, (uchar**)&noisedata, NULL, NULL);
|
||||
cvGetRawData (arr, (uchar **) & data, &step, NULL);
|
||||
cvGetRawData (noise, (uchar **) & noisedata, NULL, NULL);
|
||||
|
||||
step /= sizeof(gfloat);
|
||||
step /= sizeof (gfloat);
|
||||
|
||||
for (y = 0; y < filter->height; y++) {
|
||||
for (x = 0; x < filter->width; x++) {
|
||||
data[y*step + x] += noisedata[y];
|
||||
data[y * step + x] += noisedata[y];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,24 +452,25 @@ gst_sfx3dnoise_add_sigma_tv (GstSfx3DNoise * filter, CvMat * arr, double sigma)
|
||||
|
||||
/* Add sigma-h and sigma-th noise, which adds random vertical lines */
|
||||
void
|
||||
gst_sfx3dnoise_add_sigma_th (GstSfx3DNoise * filter, CvMat * arr, double sigma) {
|
||||
CvMat * noise = cvCreateMat (1, filter->width, CV_32F);
|
||||
gfloat * data;
|
||||
gfloat * noisedata;
|
||||
gst_sfx3dnoise_add_sigma_th (GstSfx3DNoise * filter, CvMat * arr, double sigma)
|
||||
{
|
||||
CvMat *noise = cvCreateMat (1, filter->width, CV_32F);
|
||||
gfloat *data;
|
||||
gfloat *noisedata;
|
||||
int step, x, y;
|
||||
|
||||
/* TODO move scaling of sigma somewhere else? */
|
||||
cvRandArr (&filter->rng, noise, CV_RAND_NORMAL, cvScalarAll (0),
|
||||
cvScalarAll (sigma*(G_MAXUINT16-1)));
|
||||
cvScalarAll (sigma * (G_MAXUINT16 - 1)));
|
||||
|
||||
cvGetRawData (arr, (uchar**)&data, &step, NULL);
|
||||
cvGetRawData (noise, (uchar**)&noisedata, NULL, NULL);
|
||||
cvGetRawData (arr, (uchar **) & data, &step, NULL);
|
||||
cvGetRawData (noise, (uchar **) & noisedata, NULL, NULL);
|
||||
|
||||
step /= sizeof(gfloat);
|
||||
step /= sizeof (gfloat);
|
||||
|
||||
for (y = 0; y < filter->height; y++) {
|
||||
for (x = 0; x < filter->width; x++) {
|
||||
data[y*step + x] += noisedata[x];
|
||||
data[y * step + x] += noisedata[x];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,16 +481,16 @@ gst_sfx3dnoise_add_sigma_th (GstSfx3DNoise * filter, CvMat * arr, double sigma)
|
||||
void
|
||||
gst_sfx3dnoise_add_sigma_t (GstSfx3DNoise * filter, CvMat * arr, double sigma)
|
||||
{
|
||||
CvMat * noise = cvCreateMat (1, 1, CV_32F);
|
||||
float * data;
|
||||
CvMat *noise = cvCreateMat (1, 1, CV_32F);
|
||||
float *data;
|
||||
|
||||
/* TODO move scaling of sigma somewhere else? */
|
||||
cvRandArr (&filter->rng, noise, CV_RAND_NORMAL, cvScalarAll (0),
|
||||
cvScalarAll (sigma*(G_MAXUINT16-1)));
|
||||
cvScalarAll (sigma * (G_MAXUINT16 - 1)));
|
||||
|
||||
cvGetRawData (noise, (uchar**)&data, NULL, NULL);
|
||||
cvGetRawData (noise, (uchar **) & data, NULL, NULL);
|
||||
|
||||
cvAddS (arr, cvScalarAll (*data), arr, 0);
|
||||
|
||||
cvReleaseMat (&noise);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,55 +71,51 @@ GST_ELEMENT_DETAILS ("Blurs video",
|
||||
|
||||
/* the capabilities of the inputs and outputs */
|
||||
static GstStaticPadTemplate gst_sfxblur_src_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (
|
||||
"video/x-raw-gray, " \
|
||||
"bpp = (int) 16, " \
|
||||
"depth = (int) 16, " \
|
||||
"endianness = (int) BYTE_ORDER, " \
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"framerate = " GST_VIDEO_FPS_RANGE ";" \
|
||||
"video/x-raw-gray-float, " \
|
||||
"bpp = (int) 32, " \
|
||||
"depth = (int) 32, " \
|
||||
"endianness = (int) BYTE_ORDER, " \
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"framerate = " GST_VIDEO_FPS_RANGE
|
||||
)
|
||||
);
|
||||
GST_STATIC_CAPS ("video/x-raw-gray, "
|
||||
"bpp = (int) 16, "
|
||||
"depth = (int) 16, "
|
||||
"endianness = (int) BYTE_ORDER, "
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"framerate = " GST_VIDEO_FPS_RANGE ";"
|
||||
"video/x-raw-gray-float, "
|
||||
"bpp = (int) 32, "
|
||||
"depth = (int) 32, "
|
||||
"endianness = (int) BYTE_ORDER, "
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"framerate = " GST_VIDEO_FPS_RANGE)
|
||||
);
|
||||
|
||||
static GstStaticPadTemplate gst_sfxblur_sink_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (
|
||||
"video/x-raw-gray, " \
|
||||
"bpp = (int) 16, " \
|
||||
"depth = (int) 16, " \
|
||||
"endianness = (int) BYTE_ORDER, " \
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"framerate = " GST_VIDEO_FPS_RANGE ";" \
|
||||
"video/x-raw-gray-float, " \
|
||||
"bpp = (int) 32, " \
|
||||
"depth = (int) 32, " \
|
||||
"endianness = (int) BYTE_ORDER, " \
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", " \
|
||||
"framerate = " GST_VIDEO_FPS_RANGE
|
||||
)
|
||||
);
|
||||
GST_STATIC_PAD_TEMPLATE ("src",
|
||||
GST_PAD_SRC,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS ("video/x-raw-gray, "
|
||||
"bpp = (int) 16, "
|
||||
"depth = (int) 16, "
|
||||
"endianness = (int) BYTE_ORDER, "
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"framerate = " GST_VIDEO_FPS_RANGE ";"
|
||||
"video/x-raw-gray-float, "
|
||||
"bpp = (int) 32, "
|
||||
"depth = (int) 32, "
|
||||
"endianness = (int) BYTE_ORDER, "
|
||||
"width = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"height = " GST_VIDEO_SIZE_RANGE ", "
|
||||
"framerate = " GST_VIDEO_FPS_RANGE)
|
||||
);
|
||||
|
||||
/* GObject vmethod declarations */
|
||||
static void gst_sfxblur_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_sfxblur_get_property (GObject * object, guint prop_id,
|
||||
GValue * value, GParamSpec * pspec);
|
||||
static void gst_sfxblur_finalize (GObject *object);
|
||||
static void gst_sfxblur_finalize (GObject * object);
|
||||
|
||||
/* GstBaseTransform vmethod declarations */
|
||||
static gboolean gst_sfxblur_set_caps (GstBaseTransform * base,
|
||||
@@ -128,7 +124,7 @@ static GstFlowReturn gst_sfxblur_transform_ip (GstBaseTransform * base,
|
||||
GstBuffer * buf);
|
||||
|
||||
/* GstSensorFxBlur method declarations */
|
||||
static void gst_sfxblur_reset(GstSensorFxBlur* filter);
|
||||
static void gst_sfxblur_reset (GstSensorFxBlur * filter);
|
||||
|
||||
/* setup debug */
|
||||
GST_DEBUG_CATEGORY_STATIC (sfxblur_debug);
|
||||
@@ -138,7 +134,7 @@ GST_DEBUG_CATEGORY_STATIC (sfxblur_debug);
|
||||
"sfxblur");
|
||||
|
||||
GST_BOILERPLATE_FULL (GstSensorFxBlur, gst_sfxblur, GstVideoFilter,
|
||||
GST_TYPE_VIDEO_FILTER, DEBUG_INIT);\
|
||||
GST_TYPE_VIDEO_FILTER, DEBUG_INIT);
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
@@ -156,7 +152,7 @@ gst_sfxblur_base_init (gpointer klass)
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
||||
|
||||
GST_DEBUG ("base init");
|
||||
|
||||
|
||||
gst_element_class_set_details (element_class, &sfxblur_details);
|
||||
|
||||
gst_element_class_add_pad_template (element_class,
|
||||
@@ -171,14 +167,14 @@ gst_sfxblur_base_init (gpointer klass)
|
||||
*
|
||||
*/
|
||||
static void
|
||||
gst_sfxblur_finalize (GObject *object)
|
||||
gst_sfxblur_finalize (GObject * object)
|
||||
{
|
||||
GstSensorFxBlur *sfxblur = GST_SENSORFXBLUR (object);
|
||||
|
||||
GST_DEBUG ("finalize");
|
||||
|
||||
|
||||
gst_sfxblur_reset (sfxblur);
|
||||
|
||||
|
||||
/* chain up to the parent class */
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
@@ -195,8 +191,8 @@ gst_sfxblur_class_init (GstSensorFxBlurClass * object)
|
||||
GstBaseTransformClass *trans_class = GST_BASE_TRANSFORM_CLASS (object);
|
||||
|
||||
GST_DEBUG ("class init");
|
||||
|
||||
|
||||
|
||||
|
||||
/* Register GObject vmethods */
|
||||
obj_class->finalize = GST_DEBUG_FUNCPTR (gst_sfxblur_finalize);
|
||||
obj_class->set_property = GST_DEBUG_FUNCPTR (gst_sfxblur_set_property);
|
||||
@@ -204,8 +200,9 @@ gst_sfxblur_class_init (GstSensorFxBlurClass * object)
|
||||
|
||||
/* Install GObject properties */
|
||||
g_object_class_install_property (obj_class, PROP_LOWIN,
|
||||
g_param_spec_double ("lower-input-level", "Lower Input Level", "Lower Input Level",
|
||||
0.0, 1.0, DEFAULT_PROP_LOWIN, G_PARAM_READWRITE));
|
||||
g_param_spec_double ("lower-input-level", "Lower Input Level",
|
||||
"Lower Input Level", 0.0, 1.0, DEFAULT_PROP_LOWIN,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
/* Register GstBaseTransform vmethods */
|
||||
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_sfxblur_set_caps);
|
||||
@@ -220,8 +217,7 @@ gst_sfxblur_class_init (GstSensorFxBlurClass * object)
|
||||
* Initialize the new element
|
||||
*/
|
||||
static void
|
||||
gst_sfxblur_init (GstSensorFxBlur * sfxblur,
|
||||
GstSensorFxBlurClass * g_class)
|
||||
gst_sfxblur_init (GstSensorFxBlur * sfxblur, GstSensorFxBlurClass * g_class)
|
||||
{
|
||||
GST_DEBUG_OBJECT (sfxblur, "init class instance");
|
||||
|
||||
@@ -317,17 +313,17 @@ gst_sfxblur_set_caps (GstBaseTransform * base, GstCaps * incaps,
|
||||
"height", G_TYPE_INT, &levels->height,
|
||||
"bpp", G_TYPE_INT, &levels->bpp,
|
||||
"depth", G_TYPE_INT, &levels->depth,
|
||||
"endianness", G_TYPE_INT, &levels->endianness,
|
||||
NULL);
|
||||
"endianness", G_TYPE_INT, &levels->endianness, NULL);
|
||||
if (!res)
|
||||
return FALSE;
|
||||
|
||||
levels->stride = GST_ROUND_UP_4 (levels->width * levels->depth/8);
|
||||
levels->stride = GST_ROUND_UP_4 (levels->width * levels->depth / 8);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
GstFlowReturn gst_sfxblur_transform_ip( GstBaseTransform * base, GstBuffer * buf )
|
||||
GstFlowReturn
|
||||
gst_sfxblur_transform_ip (GstBaseTransform * base, GstBuffer * buf)
|
||||
{
|
||||
|
||||
return GST_FLOW_OK;
|
||||
@@ -344,7 +340,7 @@ GstFlowReturn gst_sfxblur_transform_ip( GstBaseTransform * base, GstBuffer * buf
|
||||
* Reset instance variables and free memory
|
||||
*/
|
||||
static void
|
||||
gst_sfxblur_reset(GstSensorFxBlur* sfxblur)
|
||||
gst_sfxblur_reset (GstSensorFxBlur * sfxblur)
|
||||
{
|
||||
sfxblur->width = 0;
|
||||
sfxblur->height = 0;
|
||||
@@ -358,5 +354,5 @@ gboolean
|
||||
gst_sfxblur_plugin_init (GstPlugin * plugin)
|
||||
{
|
||||
return gst_element_register (plugin, "sfxblur", GST_RANK_NONE,
|
||||
GST_TYPE_SENSORFXBLUR);
|
||||
GST_TYPE_SENSORFXBLUR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user