gstcutter.h 2.41 KB
Newer Older
Andy Wingo's avatar
Andy Wingo committed
1
/* GStreamer
Andy Wingo's avatar
Andy Wingo committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15
 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
Tim-Philipp Müller's avatar
Tim-Philipp Müller committed
16 17
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
Andy Wingo's avatar
Andy Wingo committed
18 19 20 21 22 23 24 25
 */


#ifndef __GST_CUTTER_H__
#define __GST_CUTTER_H__


#include <gst/gst.h>
26
/* #include <gst/meta/audioraw.h> */
Andy Wingo's avatar
Andy Wingo committed
27 28 29


#ifdef __cplusplus
Johan Dahlin's avatar
Johan Dahlin committed
30 31
extern "C" {
#endif /* __cplusplus */
Andy Wingo's avatar
Andy Wingo committed
32 33 34 35 36 37 38


#define GST_TYPE_CUTTER \
  (gst_cutter_get_type())
#define GST_CUTTER(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CUTTER,GstCutter))
#define GST_CUTTER_CLASS(klass) \
39
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CUTTER,GstCutterClass))
Andy Wingo's avatar
Andy Wingo committed
40 41
#define GST_IS_CUTTER(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CUTTER))
42
#define GST_IS_CUTTER_CLASS(klass) \
Andy Wingo's avatar
Andy Wingo committed
43 44
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CUTTER))

Johan Dahlin's avatar
Johan Dahlin committed
45 46
typedef struct _GstCutter GstCutter;
typedef struct _GstCutterClass GstCutterClass;
Andy Wingo's avatar
Andy Wingo committed
47

Johan Dahlin's avatar
Johan Dahlin committed
48 49 50
struct _GstCutter
{
  GstElement element;
Andy Wingo's avatar
Andy Wingo committed
51

Johan Dahlin's avatar
Johan Dahlin committed
52
  GstPad *sinkpad, *srcpad;
Andy Wingo's avatar
Andy Wingo committed
53

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
54 55 56 57
  double threshold_level;       /* level below which to cut */
  double threshold_length;      /* how long signal has to remain
                                 * below this level before cutting */
  double silent_run_length;     /* how long has it been below threshold ? */
Johan Dahlin's avatar
Johan Dahlin committed
58
  gboolean silent;
59
  gboolean silent_prev;
Andy Wingo's avatar
Andy Wingo committed
60

Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
61
  double pre_length;            /* how long can the pre-record buffer be ? */
Johan Dahlin's avatar
Johan Dahlin committed
62
  double pre_run_length;        /* how long is it currently ? */
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
63 64
  GList *pre_buffer;            /* list of GstBuffers in pre-record buffer */
  gboolean leaky;               /* do we leak an overflowing prebuffer ? */
Thomas Vander Stichele's avatar
Thomas Vander Stichele committed
65

66
  GstAudioInfo info;
Johan Dahlin's avatar
Johan Dahlin committed
67
};
Andy Wingo's avatar
Andy Wingo committed
68

Johan Dahlin's avatar
Johan Dahlin committed
69 70 71 72 73 74
struct _GstCutterClass
{
  GstElementClass parent_class;
  void (*cut_start) (GstCutter* filter);
  void (*cut_stop) (GstCutter* filter);
};
Andy Wingo's avatar
Andy Wingo committed
75

Johan Dahlin's avatar
Johan Dahlin committed
76
GType gst_cutter_get_type (void);
Andy Wingo's avatar
Andy Wingo committed
77 78 79

#ifdef __cplusplus
}
Johan Dahlin's avatar
Johan Dahlin committed
80
#endif /* __cplusplus */
Andy Wingo's avatar
Andy Wingo committed
81 82


Johan Dahlin's avatar
Johan Dahlin committed
83
#endif /* __GST_STEREO_H__ */