-
Notifications
You must be signed in to change notification settings - Fork 41
/
aac_decoder.h
54 lines (45 loc) · 1.7 KB
/
aac_decoder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2018 Espressif Systems (Shanghai) PTE LTD
// All rights reserved.
#ifndef _AAC_DECODER_H_
#define _AAC_DECODER_H_
#include "esp_err.h"
#include "audio_element.h"
#include "audio_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define AAC_DECODER_TASK_STACK_SIZE (5 * 1024)
#define AAC_DECODER_TASK_CORE (0)
#define AAC_DECODER_TASK_PRIO (5)
#define AAC_DECODER_RINGBUFFER_SIZE (2 * 1024)
#define DEFAULT_AAC_DECODER_CONFIG() { \
.out_rb_size = AAC_DECODER_RINGBUFFER_SIZE, \
.task_stack = AAC_DECODER_TASK_STACK_SIZE, \
.task_core = AAC_DECODER_TASK_CORE, \
.task_prio = AAC_DECODER_TASK_PRIO, \
.stack_in_ext = true, \
.plus_enable = false, \
}
/**
* @brief AAC Decoder configuration
*/
typedef struct {
int out_rb_size; /*!< Size of output ringbuffer */
int task_stack; /*!< Task stack size */
int task_core; /*!< CPU core number (0 or 1) where decoder task in running */
int task_prio; /*!< Task priority (based on freeRTOS priority) */
bool stack_in_ext; /*!< Try to allocate stack in external memory */
bool plus_enable; /*!< Dynamically enable HE-AAC (v1 v2) decoding */
} aac_decoder_cfg_t;
/**
* @brief Create an Audio Element handle to decode incoming AAC data
*
* @param config The configuration
*
* @return The audio element handle
*/
audio_element_handle_t aac_decoder_init(aac_decoder_cfg_t *config);
#ifdef __cplusplus
}
#endif
#endif