• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*  GStreamer LDAC audio encoder
2  *  Copyright (C) 2020 Asymptotic <sanchayan@asymptotic.io>
3  *
4  *  This library is free software; you can redistribute it and/or
5  *  modify it under the terms of the GNU Lesser General Public
6  *  License as published by the Free Software Foundation; either
7  *  version 2.1 of the License, or (at your option) any later version.
8  *
9  *  This library is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  *  Lesser General Public License for more details.
13  *
14  *  You should have received a copy of the GNU Lesser General Public
15  *  License along with this library; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18 
19 #include <gst/gst.h>
20 #include <gst/audio/audio.h>
21 
22 #include <ldacBT.h>
23 
24 G_BEGIN_DECLS
25 
26 #define GST_TYPE_LDAC_ENC \
27 	(gst_ldac_enc_get_type())
28 #define GST_LDAC_ENC(obj) \
29 	(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_LDAC_ENC,GstLdacEnc))
30 #define GST_LDAC_ENC_CLASS(klass) \
31 	(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_LDAC_ENC,GstLdacEncClass))
32 #define GST_IS_LDAC_ENC(obj) \
33 	(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_LDAC_ENC))
34 #define GST_IS_LDAC_ENC_CLASS(obj) \
35 	(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_LDAC_ENC))
36 
37 typedef struct _GstLdacEnc GstLdacEnc;
38 typedef struct _GstLdacEncClass GstLdacEncClass;
39 
40 typedef enum
41 {
42   GST_LDAC_EQMID_HQ = 0,
43   GST_LDAC_EQMID_SQ,
44   GST_LDAC_EQMID_MQ
45 } GstLdacEqmid;
46 
47 struct _GstLdacEnc {
48     GstAudioEncoder audio_encoder;
49     GstLdacEqmid eqmid;
50 
51     guint rate;
52     guint channels;
53     guint channel_mode;
54     gboolean init_done;
55 
56     LDACBT_SMPL_FMT_T ldac_fmt;
57     HANDLE_LDAC_BT ldac;
58 };
59 
60 struct _GstLdacEncClass {
61     GstAudioEncoderClass audio_encoder_class;
62 };
63 
64 GType gst_ldac_enc_get_type (void);
65 GST_ELEMENT_REGISTER_DECLARE (ldacenc);
66 
67 G_END_DECLS
68