• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * GStreamer
3  * Copyright (C) 2017 Vivia Nikolaidou <vivia@toolsonair.com>
4  *
5  * gstaudiomixmatrix.h
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_AUDIO_MIX_MATRIX_H__
24 #define __GST_AUDIO_MIX_MATRIX_H__
25 
26 #include <gst/gst.h>
27 #include <gst/audio/audio.h>
28 
29 #define GST_TYPE_AUDIO_MIX_MATRIX            (gst_audio_mix_matrix_get_type())
30 #define GST_AUDIO_MIX_MATRIX(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_MIX_MATRIX,GstAudioMixMatrix))
31 #define GST_AUDIO_MIX_MATRIX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AUDIO_MIX_MATRIX,GstAudioMixMatrixClass))
32 #define GST_AUDIO_MIX_MATRIX_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_AUDIO_MIX_MATRIX,GstAudioMixMatrixClass))
33 #define GST_IS_AUDIO_MIX_MATRIX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_MIX_MATRIX))
34 #define GST_IS_AUDIO_MIX_MATRIX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AUDIO_MIX_MATRIX))
35 #define GST_TYPE_AUDIO_MIX_MATRIX_MODE (gst_audio_mix_matrix_mode_get_type())
36 
37 typedef struct _GstAudioMixMatrix GstAudioMixMatrix;
38 typedef struct _GstAudioMixMatrixClass GstAudioMixMatrixClass;
39 
40 typedef enum _GstAudioMixMatrixMode
41 {
42   GST_AUDIO_MIX_MATRIX_MODE_MANUAL = 0,
43   GST_AUDIO_MIX_MATRIX_MODE_FIRST_CHANNELS = 1
44 } GstAudioMixMatrixMode;
45 
46 /**
47  * GstAudioMixMatrix:
48  *
49  * Opaque data structure.
50  */
51 struct _GstAudioMixMatrix
52 {
53   GstBaseTransform audiofilter;
54 
55   /* < private > */
56   guint in_channels;
57   guint out_channels;
58   gdouble *matrix;
59   guint64 channel_mask;
60   GstAudioMixMatrixMode mode;
61   gint32 *s16_conv_matrix;
62   gint64 *s32_conv_matrix;
63   gint shift_bytes;
64 
65   GstAudioFormat format;
66 };
67 
68 struct _GstAudioMixMatrixClass
69 {
70   GstBaseTransformClass parent_class;
71 };
72 
73 GType gst_audio_mix_matrix_get_type (void);
74 
75 GST_ELEMENT_REGISTER_DECLARE (audiomixmatrix);
76 
77 GType gst_audio_mix_matrix_mode_get_type (void);
78 
79 G_END_DECLS
80 #endif /* __GST_AUDIO_MIX_MATRIX_H__ */
81