Skip to content

Commit 05e3ec1

Browse files
committed
gmf_core:
1. Added `meta_flag` field to `esp_gmf_payload_t` to support audio decoder recovery status tracking 2. Added raw_pcm in `esp_fourcc.h` gmf_audio: 1. Updated `esp_audio_codec` to version v2.3.0 2. Updated `esp_audio_effects` to version v1.1.0 3. Added `reconfig`, `reconfig_by_type`, `set_bitrate`, `get_bitrate` methods to `gmf_audio_enc` 4. Added `SBC` and `LC3` encoders 5. Added `reconfig` method to `gmf_audio_dec` 6. Added `SBC` and `LC3` decoders 7. Added common audio parameter setting interface 8. Redefined audio methods name 9. Added `esp_gmf_audio_dec_reconfig` and `esp_gmf_audio_dec_reconfig_by_sound_info` functions to `gmf_audio_dec` 10. Removed the audio encoder and decoder reconfig interface in `esp_gmf_audio_helper.c` 11. Used the `esp_gmf_element_handle_t` type handle in the `gmf_audio` module gmf_ai_audio: Replaced the interface for decoding reconfig gmf_examples: Replaced the interface for decoding reconfig esp_audio_simple_player: Replaced the interface for decoding reconfig
1 parent 9fbe3ef commit 05e3ec1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1709
-646
lines changed

elements/gmf_ai_audio/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Features
66

77
- Add API `esp_gmf_afe_set_event_cb` to set AFE element event callback
8+
- Replaced the interface for decoding reconfig
89

910
## v0.6.2
1011

elements/gmf_ai_audio/examples/aec_rec/main/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "esp_gmf_rate_cvt.h"
2525
#include "esp_gmf_bit_cvt.h"
2626
#include "esp_gmf_ch_cvt.h"
27-
#include "esp_gmf_audio_helper.h"
27+
#include "esp_gmf_audio_dec.h"
2828
#include "cli.h"
2929
#include "gmf_loader_setup_defaults.h"
3030

@@ -152,6 +152,7 @@ void app_main(void)
152152
esp_gmf_rate_cvt_set_dest_rate(rate_cvt, 16000);
153153

154154
esp_gmf_info_sound_t info = {
155+
.format_id = ESP_AUDIO_SIMPLE_DEC_TYPE_MP3,
155156
.sample_rates = 48000,
156157
.channels = INPUT_CH_NUM,
157158
.bits = INPUT_CH_BITS,
@@ -188,7 +189,7 @@ void app_main(void)
188189
esp_gmf_ch_cvt_set_dest_channel(ch_cvt, DAC_I2S_CH);
189190
esp_gmf_obj_handle_t dec_el = NULL;
190191
esp_gmf_pipeline_get_el_by_name(play_pipe, "aud_simp_dec", &dec_el);
191-
esp_gmf_audio_helper_reconfig_dec_by_uri("/sdcard/test.mp3", &info, OBJ_GET_CFG(dec_el));
192+
esp_gmf_audio_dec_reconfig_by_sound_info(dec_el, &info);
192193

193194
esp_gmf_pipeline_set_in_uri(play_pipe, "/sdcard/test.mp3");
194195

elements/gmf_audio/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## *Unreleased*
4+
5+
### Features
6+
7+
- Updated `esp_audio_codec` to version v2.3.0
8+
- Updated `esp_audio_effects` to version v1.1.0
9+
- Added `esp_gmf_audio_enc_get_frame_size`, `esp_gmf_audio_enc_set_bitrate`, `esp_gmf_audio_enc_get_bitrate`, `esp_gmf_audio_enc_reconfig` and `esp_gmf_audio_enc_reconfig_by_sound_info` functions to `gmf_audio_enc`
10+
- Added `SBC` and `LC3` encoders
11+
- Added `esp_gmf_audio_dec_reconfig` and `esp_gmf_audio_dec_reconfig_by_sound_info` functions to `gmf_audio_dec`
12+
- Added `SBC` and `LC3` decoders
13+
- Added `meta_flag` in `gmf_audio_dec` to support audio decoder recovery status tracking
14+
- Added common audio parameter setting interface
15+
- Redefined audio methods name
16+
- Removed the audio encoder and decoder reconfig interface in `esp_gmf_audio_helper.c`
17+
- Used the `esp_gmf_element_handle_t` type handle in the `gmf_audio` module
18+
319
## v0.6.3
420

521
### Bug Fixes

elements/gmf_audio/esp_gmf_alc.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "esp_gmf_audio_methods_def.h"
1717
#include "esp_gmf_cap.h"
1818
#include "esp_gmf_caps_def.h"
19+
#include "esp_gmf_audio_element.h"
1920

2021
#define GMF_ALC_DEFAULT_MAX_CHANNEL 2
2122
/**
@@ -34,7 +35,7 @@ typedef struct {
3435

3536
static const char *TAG = "ESP_GMF_ALC";
3637

37-
static esp_gmf_err_t __alc_set_gain(esp_gmf_audio_element_handle_t handle, esp_gmf_args_desc_t *arg_desc,
38+
static esp_gmf_err_t __alc_set_gain(esp_gmf_element_handle_t handle, esp_gmf_args_desc_t *arg_desc,
3839
uint8_t *buf, int buf_len)
3940
{
4041
ESP_GMF_NULL_CHECK(TAG, arg_desc, { return ESP_GMF_ERR_INVALID_ARG;});
@@ -46,11 +47,11 @@ static esp_gmf_err_t __alc_set_gain(esp_gmf_audio_element_handle_t handle, esp_g
4647
return esp_gmf_alc_set_gain(handle, idx, gain);
4748
}
4849

49-
static esp_gmf_err_t __alc_get_gain(esp_gmf_audio_element_handle_t handle, esp_gmf_args_desc_t *arg_desc,
50+
static esp_gmf_err_t __alc_get_gain(esp_gmf_element_handle_t handle, esp_gmf_args_desc_t *arg_desc,
5051
uint8_t *buf, int buf_len)
5152
{
52-
ESP_GMF_NULL_CHECK(TAG, arg_desc, { return ESP_GMF_ERR_INVALID_ARG;});
53-
ESP_GMF_NULL_CHECK(TAG, buf, { return ESP_GMF_ERR_INVALID_ARG;});
53+
ESP_GMF_NULL_CHECK(TAG, arg_desc, {return ESP_GMF_ERR_INVALID_ARG;});
54+
ESP_GMF_NULL_CHECK(TAG, buf, {return ESP_GMF_ERR_INVALID_ARG;});
5455
esp_gmf_args_desc_t *alc_desc = arg_desc;
5556
uint8_t idx = (uint8_t)(*buf);
5657
alc_desc = alc_desc->next;
@@ -60,10 +61,10 @@ static esp_gmf_err_t __alc_get_gain(esp_gmf_audio_element_handle_t handle, esp_g
6061

6162
static esp_gmf_err_t esp_gmf_alc_new(void *cfg, esp_gmf_obj_handle_t *handle)
6263
{
63-
return esp_gmf_alc_init(cfg, handle);
64+
return esp_gmf_alc_init(cfg, (esp_gmf_element_handle_t *)handle);
6465
}
6566

66-
static esp_gmf_job_err_t esp_gmf_alc_open(esp_gmf_audio_element_handle_t self, void *para)
67+
static esp_gmf_job_err_t esp_gmf_alc_open(esp_gmf_element_handle_t self, void *para)
6768
{
6869
esp_gmf_alc_t *alc = (esp_gmf_alc_t *)self;
6970
esp_ae_alc_cfg_t *config = (esp_ae_alc_cfg_t *)OBJ_GET_CFG(self);
@@ -83,7 +84,7 @@ static esp_gmf_job_err_t esp_gmf_alc_open(esp_gmf_audio_element_handle_t self, v
8384
return ESP_GMF_JOB_ERR_OK;
8485
}
8586

86-
static esp_gmf_job_err_t esp_gmf_alc_close(esp_gmf_audio_element_handle_t self, void *para)
87+
static esp_gmf_job_err_t esp_gmf_alc_close(esp_gmf_element_handle_t self, void *para)
8788
{
8889
esp_gmf_alc_t *alc = (esp_gmf_alc_t *)self;
8990
ESP_LOGD(TAG, "Closed, %p", self);
@@ -94,7 +95,7 @@ static esp_gmf_job_err_t esp_gmf_alc_close(esp_gmf_audio_element_handle_t self,
9495
return ESP_GMF_ERR_OK;
9596
}
9697

97-
static esp_gmf_job_err_t esp_gmf_alc_process(esp_gmf_audio_element_handle_t self, void *para)
98+
static esp_gmf_job_err_t esp_gmf_alc_process(esp_gmf_element_handle_t self, void *para)
9899
{
99100
esp_gmf_alc_t *alc = (esp_gmf_alc_t *)self;
100101
esp_gmf_job_err_t out_len = ESP_GMF_JOB_ERR_OK;
@@ -195,7 +196,7 @@ static esp_gmf_err_t alc_received_event_handler(esp_gmf_event_pkt_t *evt, void *
195196
return ESP_GMF_ERR_OK;
196197
}
197198

198-
static esp_gmf_err_t esp_gmf_alc_destroy(esp_gmf_audio_element_handle_t self)
199+
static esp_gmf_err_t esp_gmf_alc_destroy(esp_gmf_element_handle_t self)
199200
{
200201
esp_gmf_alc_t *alc = (esp_gmf_alc_t *)self;
201202
ESP_LOGD(TAG, "Destroyed, %p", self);
@@ -231,26 +232,26 @@ static esp_gmf_err_t _load_alc_methods_func(esp_gmf_element_handle_t handle)
231232
esp_gmf_method_t *method = NULL;
232233
esp_gmf_args_desc_t *set_args = NULL;
233234
esp_gmf_args_desc_t *get_args = NULL;
234-
esp_gmf_err_t ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_ALC_SET_GAIN_ARG_IDX,
235+
esp_gmf_err_t ret = esp_gmf_args_desc_append(&set_args, AMETHOD_ARG(ALC, SET_GAIN, IDX),
235236
ESP_GMF_ARGS_TYPE_UINT8, sizeof(uint8_t), 0);
236237
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append index argument");
237-
ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_ALC_SET_GAIN_ARG_GAIN, ESP_GMF_ARGS_TYPE_INT8,
238+
ret = esp_gmf_args_desc_append(&set_args, AMETHOD_ARG(ALC, SET_GAIN, GAIN), ESP_GMF_ARGS_TYPE_INT8,
238239
sizeof(int8_t), sizeof(uint8_t));
239240
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append gain argument");
240-
ret = esp_gmf_method_append(&method, ESP_GMF_METHOD_ALC_SET_GAIN, __alc_set_gain, set_args);
241-
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", ESP_GMF_METHOD_ALC_SET_GAIN);
241+
ret = esp_gmf_method_append(&method, AMETHOD(ALC, SET_GAIN), __alc_set_gain, set_args);
242+
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", AMETHOD(ALC, SET_GAIN));
242243

243244
ret = esp_gmf_args_desc_copy(set_args, &get_args);
244245
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to copy argument");
245-
ret = esp_gmf_method_append(&method, ESP_GMF_METHOD_ALC_GET_GAIN, __alc_get_gain, get_args);
246-
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", ESP_GMF_METHOD_ALC_GET_GAIN);
246+
ret = esp_gmf_method_append(&method, AMETHOD(ALC, GET_GAIN), __alc_get_gain, get_args);
247+
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", AMETHOD(ALC, GET_GAIN));
247248

248249
esp_gmf_element_t *el = (esp_gmf_element_t *)handle;
249250
el->method = method;
250251
return ESP_GMF_ERR_OK;
251252
}
252253

253-
esp_gmf_err_t esp_gmf_alc_set_gain(esp_gmf_audio_element_handle_t handle, uint8_t idx, int8_t gain)
254+
esp_gmf_err_t esp_gmf_alc_set_gain(esp_gmf_element_handle_t handle, uint8_t idx, int8_t gain)
254255
{
255256
ESP_GMF_NULL_CHECK(TAG, handle, { return ESP_GMF_ERR_INVALID_ARG;});
256257
esp_gmf_alc_t *alc = (esp_gmf_alc_t *)handle;
@@ -270,7 +271,7 @@ esp_gmf_err_t esp_gmf_alc_set_gain(esp_gmf_audio_element_handle_t handle, uint8_
270271
return ESP_GMF_JOB_ERR_OK;
271272
}
272273

273-
esp_gmf_err_t esp_gmf_alc_get_gain(esp_gmf_audio_element_handle_t handle, uint8_t idx, int8_t *gain)
274+
esp_gmf_err_t esp_gmf_alc_get_gain(esp_gmf_element_handle_t handle, uint8_t idx, int8_t *gain)
274275
{
275276
ESP_GMF_NULL_CHECK(TAG, handle, { return ESP_GMF_ERR_INVALID_ARG;});
276277
ESP_GMF_NULL_CHECK(TAG, gain, { return ESP_GMF_ERR_INVALID_ARG;});
@@ -290,7 +291,7 @@ esp_gmf_err_t esp_gmf_alc_get_gain(esp_gmf_audio_element_handle_t handle, uint8_
290291
return ESP_GMF_JOB_ERR_OK;
291292
}
292293

293-
esp_gmf_err_t esp_gmf_alc_init(esp_ae_alc_cfg_t *config, esp_gmf_obj_handle_t *handle)
294+
esp_gmf_err_t esp_gmf_alc_init(esp_ae_alc_cfg_t *config, esp_gmf_element_handle_t *handle)
294295
{
295296
ESP_GMF_NULL_CHECK(TAG, handle, {return ESP_GMF_ERR_INVALID_ARG;});
296297
*handle = NULL;

0 commit comments

Comments
 (0)