xref: /btstack/src/btstack_lc3_google.h (revision 9a19cd786042b1fc78813d984efdd045e84593df)
1*9a19cd78SMatthias Ringwald /*
2*9a19cd78SMatthias Ringwald  * Copyright (C) 2022 BlueKitchen GmbH
3*9a19cd78SMatthias Ringwald  *
4*9a19cd78SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5*9a19cd78SMatthias Ringwald  * modification, are permitted provided that the following conditions
6*9a19cd78SMatthias Ringwald  * are met:
7*9a19cd78SMatthias Ringwald  *
8*9a19cd78SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9*9a19cd78SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10*9a19cd78SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11*9a19cd78SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12*9a19cd78SMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13*9a19cd78SMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14*9a19cd78SMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15*9a19cd78SMatthias Ringwald  *    from this software without specific prior written permission.
16*9a19cd78SMatthias Ringwald  *
17*9a19cd78SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
18*9a19cd78SMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19*9a19cd78SMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20*9a19cd78SMatthias Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
21*9a19cd78SMatthias Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22*9a19cd78SMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23*9a19cd78SMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
24*9a19cd78SMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25*9a19cd78SMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26*9a19cd78SMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27*9a19cd78SMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*9a19cd78SMatthias Ringwald  * SUCH DAMAGE.
29*9a19cd78SMatthias Ringwald  *
30*9a19cd78SMatthias Ringwald  */
31*9a19cd78SMatthias Ringwald 
32*9a19cd78SMatthias Ringwald /**
33*9a19cd78SMatthias Ringwald  * @title LC3 Google Adapter
34*9a19cd78SMatthias Ringwald  */
35*9a19cd78SMatthias Ringwald 
36*9a19cd78SMatthias Ringwald #ifndef BTSTACK_LC3_GOOGLE_H
37*9a19cd78SMatthias Ringwald #define BTSTACK_LC3_GOOGLE_H
38*9a19cd78SMatthias Ringwald 
39*9a19cd78SMatthias Ringwald #include <stdint.h>
40*9a19cd78SMatthias Ringwald #include "lc3.h"
41*9a19cd78SMatthias Ringwald #include "btstack_lc3.h"
42*9a19cd78SMatthias Ringwald 
43*9a19cd78SMatthias Ringwald #if defined __cplusplus
44*9a19cd78SMatthias Ringwald extern "C" {
45*9a19cd78SMatthias Ringwald #endif
46*9a19cd78SMatthias Ringwald 
47*9a19cd78SMatthias Ringwald /* API_START */
48*9a19cd78SMatthias Ringwald 
49*9a19cd78SMatthias Ringwald typedef struct {
50*9a19cd78SMatthias Ringwald     lc3_decoder_mem_48k_t           decoder_mem;
51*9a19cd78SMatthias Ringwald     lc3_decoder_t                   decoder;    // pointer
52*9a19cd78SMatthias Ringwald     uint32_t                        sample_rate;
53*9a19cd78SMatthias Ringwald     btstack_lc3_frame_duration_t    frame_duration;
54*9a19cd78SMatthias Ringwald } btstack_lc3_decoder_google_t;
55*9a19cd78SMatthias Ringwald 
56*9a19cd78SMatthias Ringwald typedef struct {
57*9a19cd78SMatthias Ringwald     lc3_encoder_mem_48k_t           encoder_mem;
58*9a19cd78SMatthias Ringwald     lc3_encoder_t                   encoder;    // pointer
59*9a19cd78SMatthias Ringwald     uint32_t                        sample_rate;
60*9a19cd78SMatthias Ringwald     btstack_lc3_frame_duration_t    frame_duration;
61*9a19cd78SMatthias Ringwald } btstack_lc3_encoder_google_t;
62*9a19cd78SMatthias Ringwald 
63*9a19cd78SMatthias Ringwald /**
64*9a19cd78SMatthias Ringwald  * Init LC3 Decoder Instance
65*9a19cd78SMatthias Ringwald  * @param context for EHIMA LC3 decoder
66*9a19cd78SMatthias Ringwald  */
67*9a19cd78SMatthias Ringwald const btstack_lc3_decoder_t * btstack_lc3_decoder_google_init_instance(btstack_lc3_decoder_google_t * context);
68*9a19cd78SMatthias Ringwald 
69*9a19cd78SMatthias Ringwald /**
70*9a19cd78SMatthias Ringwald  * Init LC3 Decoder Instance
71*9a19cd78SMatthias Ringwald  * @param context for EHIMA LC3 decoder
72*9a19cd78SMatthias Ringwald  */
73*9a19cd78SMatthias Ringwald const btstack_lc3_encoder_t * btstack_lc3_encoder_google_init_instance(btstack_lc3_encoder_google_t * context);
74*9a19cd78SMatthias Ringwald 
75*9a19cd78SMatthias Ringwald /* API_END */
76*9a19cd78SMatthias Ringwald 
77*9a19cd78SMatthias Ringwald #if defined __cplusplus
78*9a19cd78SMatthias Ringwald }
79*9a19cd78SMatthias Ringwald #endif
80*9a19cd78SMatthias Ringwald #endif // BTSTACK_LC3_GOOGLE_H
81