1 /* GStreamer 2 * Copyright (C) 2011 Tiago Katcipis <tiagokatcipis@gmail.com> 3 * Copyright (C) 2011 Paulo Pizarro <paulo.pizarro@gmail.com> 4 * Copyright (C) 2012-2016 Nicola Murino <nicola.murino@gmail.com> 5 * 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Library General Public 9 * License as published by the Free Software Foundation; either 10 * version 2 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Library General Public License for more details. 16 * 17 * You should have received a copy of the GNU Library General Public 18 * License along with this library; if not, write to the 19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 20 * Boston, MA 02110-1301, USA. 21 */ 22 23 #ifndef __GST_REMOVE_SILENCE_H__ 24 #define __GST_REMOVE_SILENCE_H__ 25 26 #include <gst/gst.h> 27 #include <gst/base/gstbasetransform.h> 28 #include "vad_private.h" 29 30 G_BEGIN_DECLS 31 32 #define GST_TYPE_REMOVE_SILENCE \ 33 (gst_remove_silence_get_type()) 34 #define GST_REMOVE_SILENCE(obj) \ 35 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_REMOVE_SILENCE,GstRemoveSilence)) 36 #define GST_REMOVE_SILENCE_CLASS(klass) \ 37 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_REMOVE_SILENCE,GstRemoveSilenceClass)) 38 #define GST_IS_REMOVESILENCE(obj) \ 39 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_REMOVE_SILENCE)) 40 #define GST_IS_REMOVESILENCE_CLASS(klass) \ 41 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_REMOVE_SILENCE)) 42 43 typedef struct _GstRemoveSilence { 44 GstBaseTransform parent; 45 VADFilter* vad; 46 gboolean remove; 47 gboolean squash; 48 gboolean silent; 49 guint16 minimum_silence_buffers; 50 guint64 minimum_silence_time; 51 /* filter params protected by STREAM_LOCK */ 52 guint64 ts_offset; 53 gboolean silence_detected; 54 guint64 consecutive_silence_buffers; 55 guint64 consecutive_silence_time; 56 } GstRemoveSilence; 57 58 typedef struct _GstRemoveSilenceClass { 59 GstBaseTransformClass parent_class; 60 } GstRemoveSilenceClass; 61 62 GType gst_remove_silence_get_type (void); 63 64 G_END_DECLS 65 66 #endif /* __GST_REMOVE_SILENCE_H__ */ 67