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