19a19cd78SMatthias Ringwald /* 29a19cd78SMatthias Ringwald * Copyright (C) 2022 BlueKitchen GmbH 39a19cd78SMatthias Ringwald * 49a19cd78SMatthias Ringwald * Redistribution and use in source and binary forms, with or without 59a19cd78SMatthias Ringwald * modification, are permitted provided that the following conditions 69a19cd78SMatthias Ringwald * are met: 79a19cd78SMatthias Ringwald * 89a19cd78SMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 99a19cd78SMatthias Ringwald * notice, this list of conditions and the following disclaimer. 109a19cd78SMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 119a19cd78SMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 129a19cd78SMatthias Ringwald * documentation and/or other materials provided with the distribution. 139a19cd78SMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 149a19cd78SMatthias Ringwald * contributors may be used to endorse or promote products derived 159a19cd78SMatthias Ringwald * from this software without specific prior written permission. 169a19cd78SMatthias Ringwald * 179a19cd78SMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 189a19cd78SMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 199a19cd78SMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 209a19cd78SMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN 219a19cd78SMatthias Ringwald * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 229a19cd78SMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 239a19cd78SMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 249a19cd78SMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 259a19cd78SMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 269a19cd78SMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 279a19cd78SMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 289a19cd78SMatthias Ringwald * SUCH DAMAGE. 299a19cd78SMatthias Ringwald * 309a19cd78SMatthias Ringwald */ 319a19cd78SMatthias Ringwald 329a19cd78SMatthias Ringwald /** 339a19cd78SMatthias Ringwald * @title LC3 Google Adapter 349a19cd78SMatthias Ringwald */ 359a19cd78SMatthias Ringwald 369a19cd78SMatthias Ringwald #ifndef BTSTACK_LC3_GOOGLE_H 379a19cd78SMatthias Ringwald #define BTSTACK_LC3_GOOGLE_H 389a19cd78SMatthias Ringwald 399a19cd78SMatthias Ringwald #include <stdint.h> 409a19cd78SMatthias Ringwald #include "lc3.h" 419a19cd78SMatthias Ringwald #include "btstack_lc3.h" 429a19cd78SMatthias Ringwald 439a19cd78SMatthias Ringwald #if defined __cplusplus 449a19cd78SMatthias Ringwald extern "C" { 459a19cd78SMatthias Ringwald #endif 469a19cd78SMatthias Ringwald 479a19cd78SMatthias Ringwald /* API_START */ 489a19cd78SMatthias Ringwald 499a19cd78SMatthias Ringwald typedef struct { 509a19cd78SMatthias Ringwald lc3_decoder_mem_48k_t decoder_mem; 519a19cd78SMatthias Ringwald lc3_decoder_t decoder; // pointer 529a19cd78SMatthias Ringwald uint32_t sample_rate; 539a19cd78SMatthias Ringwald btstack_lc3_frame_duration_t frame_duration; 54*da364eecSMatthias Ringwald uint16_t octets_per_frame; 559a19cd78SMatthias Ringwald } btstack_lc3_decoder_google_t; 569a19cd78SMatthias Ringwald 579a19cd78SMatthias Ringwald typedef struct { 589a19cd78SMatthias Ringwald lc3_encoder_mem_48k_t encoder_mem; 599a19cd78SMatthias Ringwald lc3_encoder_t encoder; // pointer 609a19cd78SMatthias Ringwald uint32_t sample_rate; 619a19cd78SMatthias Ringwald btstack_lc3_frame_duration_t frame_duration; 62*da364eecSMatthias Ringwald uint16_t octets_per_frame; 639a19cd78SMatthias Ringwald } btstack_lc3_encoder_google_t; 649a19cd78SMatthias Ringwald 659a19cd78SMatthias Ringwald /** 669a19cd78SMatthias Ringwald * Init LC3 Decoder Instance 679a19cd78SMatthias Ringwald * @param context for EHIMA LC3 decoder 689a19cd78SMatthias Ringwald */ 699a19cd78SMatthias Ringwald const btstack_lc3_decoder_t * btstack_lc3_decoder_google_init_instance(btstack_lc3_decoder_google_t * context); 709a19cd78SMatthias Ringwald 719a19cd78SMatthias Ringwald /** 729a19cd78SMatthias Ringwald * Init LC3 Decoder Instance 739a19cd78SMatthias Ringwald * @param context for EHIMA LC3 decoder 749a19cd78SMatthias Ringwald */ 759a19cd78SMatthias Ringwald const btstack_lc3_encoder_t * btstack_lc3_encoder_google_init_instance(btstack_lc3_encoder_google_t * context); 769a19cd78SMatthias Ringwald 779a19cd78SMatthias Ringwald /* API_END */ 789a19cd78SMatthias Ringwald 799a19cd78SMatthias Ringwald #if defined __cplusplus 809a19cd78SMatthias Ringwald } 819a19cd78SMatthias Ringwald #endif 829a19cd78SMatthias Ringwald #endif // BTSTACK_LC3_GOOGLE_H 83