gstlal_insertgap.h 3.11 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
/*
 * Copyright (C) 2016 Aaron Viets <aaron.viets@ligo.org>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */


#ifndef __GSTLAL_INSERTGAP_H__
#define __GSTLAL_INSERTGAP_H__


#include <glib.h>
#include <gst/gst.h>


G_BEGIN_DECLS
#define GSTLAL_INSERTGAP_TYPE \
	(gstlal_insertgap_get_type())
#define GSTLAL_INSERTGAP(obj) \
	(G_TYPE_CHECK_INSTANCE_CAST((obj), GSTLAL_INSERTGAP_TYPE, GSTLALInsertGap))
#define GSTLAL_INSERTGAP_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_CAST((klass), GSTLAL_INSERTGAP_TYPE, GSTLALInsertGapClass))
#define GST_IS_GSTLAL_INSERTGAP(obj) \
	(G_TYPE_CHECK_INSTANCE_TYPE((obj), GSTLAL_INSERTGAP_TYPE))
#define GST_IS_GSTLAL_INSERTGAP_CLASS(klass) \
	(G_TYPE_CHECK_CLASS_TYPE((klass), GSTLAL_INSERTGAP_TYPE))


typedef struct _GSTLALInsertGap GSTLALInsertGap;
typedef struct _GSTLALInsertGapClass GSTLALInsertGapClass;


/**
 * GSTLALInsertGap:
 */


struct _GSTLALInsertGap {
	GstElement element;

62
	/* pads */
63 64 65
	GstPad *sinkpad;
	GstPad *srcpad;

66
	/* stream parameters */
67
	gint rate;
68
	gint channels;
69
	gint unit_size;
70
	enum gstlal_insertgap_data_type {
71 72
		GSTLAL_INSERTGAP_U32 = 0,
		GSTLAL_INSERTGAP_F32,
73 74 75 76 77 78
		GSTLAL_INSERTGAP_F64,
		GSTLAL_INSERTGAP_Z64,
		GSTLAL_INSERTGAP_Z128
	} data_type;

	guint64 last_sinkbuf_ets;
79 80
	guint64 last_sinkbuf_offset_end;
	guint64 discont_offset;
81 82
	guint64 discont_time;
	guint64 empty_bufs;
83 84
	GMutex mutex;
	gboolean finished_running;
85

86 87 88
	/* timestamp bookkeeping */
	GstClockTime t0;

89 90 91 92 93
	/* properties */
	gboolean insert_gap;
	gboolean remove_gap;
	gboolean remove_nan;
	gboolean remove_inf;
94
	gboolean fill_discont;
95 96 97
	double replace_value;
	double *bad_data_intervals;
	gint array_length;
98
	guint64 chop_length;
99
	GstClockTime block_duration;
100
	guint64 wait_time;
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
};


/**
 * GSTLALInsertGapClass:
 * @parent_class:  the parent class
 */


struct _GSTLALInsertGapClass {
	GstElementClass parent_class;
};


GType gstlal_insertgap_get_type(void);


G_END_DECLS


#endif	/* __GSTLAL_INSERTGAP_H__ */