• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* -*- c-basic-offset: 2 -*-
2  * vi:si:et:sw=2:sts=8:ts=8:expandtab
3  *
4  * GStreamer
5  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
6  * Copyright (C) 2010 Sebastian Dröge <sebastian.droege@collabora.co.uk>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 #ifndef __GST_VOLUME_H__
25 #define __GST_VOLUME_H__
26 
27 #include <gst/gst.h>
28 #include <gst/base/gstbasetransform.h>
29 #include <gst/audio/streamvolume.h>
30 #include <gst/audio/audio.h>
31 #include <gst/audio/gstaudiofilter.h>
32 
33 G_BEGIN_DECLS
34 
35 #define GST_TYPE_VOLUME (gst_volume_get_type())
36 G_DECLARE_FINAL_TYPE (GstVolume, gst_volume, GST, VOLUME, GstAudioFilter)
37 
38 /**
39  * GstVolume:
40  *
41  * Opaque data structure.
42  */
43 struct _GstVolume {
44   GstAudioFilter element;
45 
46   void (*process)(GstVolume*, gpointer, guint);
47   void (*process_controlled)(GstVolume*, gpointer, gdouble *, guint, guint);
48 
49   gboolean mute;
50   gfloat volume;
51 
52   gboolean current_mute;
53   gdouble current_volume;
54 
55   gint   current_vol_i32;
56   gint   current_vol_i24; /* the _i(nt) values get synchronized with the */
57   gint   current_vol_i16; /* the _i(nt) values get synchronized with the */
58   gint   current_vol_i8;   /* the _i(nt) values get synchronized with the */
59 
60   GList *tracklist;
61   gboolean negotiated;
62 
63   gboolean *mutes;
64   guint mutes_count;
65   gdouble *volumes;
66   guint volumes_count;
67 };
68 
69 GST_ELEMENT_REGISTER_DECLARE (volume);
70 
71 G_END_DECLS
72 
73 #endif /* __GST_VOLUME_H__ */
74