xref: /btstack/src/btstack_lc3_google.h (revision c824d78c0a34df89b57d535abafcc7dacf30bb06)
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     uint16_t                        octets_per_frame;
55 } btstack_lc3_decoder_google_t;
56 
57 typedef struct {
58     lc3_encoder_mem_48k_t           encoder_mem;
59     lc3_encoder_t                   encoder;    // pointer
60     uint32_t                        sample_rate;
61     btstack_lc3_frame_duration_t    frame_duration;
62     uint16_t                        octets_per_frame;
63 } btstack_lc3_encoder_google_t;
64 
65 /**
66  * Init LC3 Decoder Instance
67  * @param context for EHIMA LC3 decoder
68  */
69 const btstack_lc3_decoder_t * btstack_lc3_decoder_google_init_instance(btstack_lc3_decoder_google_t * context);
70 
71 /**
72  * Init LC3 Decoder Instance
73  * @param context for EHIMA LC3 decoder
74  */
75 const btstack_lc3_encoder_t * btstack_lc3_encoder_google_init_instance(btstack_lc3_encoder_google_t * context);
76 
77 /* API_END */
78 
79 #if defined __cplusplus
80 }
81 #endif
82 #endif // BTSTACK_LC3_GOOGLE_H
83