/* * ============================================================================ * * Preamble * * ============================================================================ */ /* * stuff from the C library */ #include /* * stuff from gobject/gstreamer */ #include #include #include #include /* * stuff from gstlal */ #include /* * ============================================================================ * * GStreamer Boiler Plate * * ============================================================================ */ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE( GST_BASE_TRANSFORM_SINK_NAME, GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS( "audio/x-raw-float, " \ "rate = (int) [1, MAX], " \ "channels = (int) 1, " \ "endianness = (int) BYTE_ORDER, " \ "width = (int) 64" ) ); static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE( GST_BASE_TRANSFORM_SRC_NAME, GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS( "audio/x-raw-float, " \ "rate = (int) [1, MAX], " \ "channels = (int) 1, " \ "endianness = (int) BYTE_ORDER, " \ "width = (int) 64" ) ); GST_BOILERPLATE( GSTLALMean, gstlal_mean, GstBaseTransform, GST_TYPE_BASE_TRANSFORM ); /* * ============================================================================ * * GObject Method Overrides * * ============================================================================ */ /* * base_init() */ static void gstlal_mean_base_init(gpointer gclass) { GstElementClass *element_class = GST_ELEMENT_CLASS(gclass); GstBaseTransformClass *transform_class = GST_BASE_TRANSFORM_CLASS(gclass); gst_element_class_set_details_simple(element_class, "Average of last N samples", "Filter/Audio", "Each output sample is the average of the N most recent samples", "Kipp Cannon "); gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&src_factory)); gst_element_class_add_pad_template(element_class, gst_static_pad_template_get(&sink_factory)); } /* * class_init() */ static void gstlal_mean_class_init(GSTLALMeanClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS(klass); } /* * init() */ static void gstlal_mean_init(GSTLALMean *filter, GSTLALMeanClass *kclass) { gst_base_transform_set_gap_aware(GST_BASE_TRANSFORM(filter), TRUE); }