Skip to content

Commit

Permalink
Merge branch 'bugfix/correct_typo_of_destroy' into 'master'
Browse files Browse the repository at this point in the history
Correct all instances of "destory" to "destroy"

See merge request adf/esp-adf-internal!1335
  • Loading branch information
jason-mao committed Sep 10, 2024
2 parents 7a7eef2 + b414984 commit fd51a44
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
22 changes: 11 additions & 11 deletions components/bluetooth_service/a2dp_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ typedef struct {
typedef struct {
enum {
A2DP_TYPE_SINK ,
A2DP_TYPE_DESTORY,
A2DP_TYPE_DESTROY,
} type;
void *data;
size_t size;
Expand Down Expand Up @@ -96,7 +96,7 @@ static void audio_a2dp_stream_thread(void *pvParameters)
audio_free(recv_msg.data);
recv_msg.data = NULL;
break;
case A2DP_TYPE_DESTORY:
case A2DP_TYPE_DESTROY:
_aadp_task_run = false;
break;
default:
Expand Down Expand Up @@ -267,23 +267,23 @@ static int32_t bt_a2d_source_data_cb(uint8_t *data, int32_t len)
return 0;
}

static esp_err_t a2dp_sink_destory(audio_element_handle_t self)
static esp_err_t a2dp_sink_destroy(audio_element_handle_t self)
{
ESP_LOGI(TAG, "a2dp_sink_destory");
ESP_LOGI(TAG, "a2dp_sink_destroy");

a2dp_data_t destory_msg = {
.type = A2DP_TYPE_DESTORY,
a2dp_data_t destroy_msg = {
.type = A2DP_TYPE_DESTROY,
};
if ( xQueueSend( s_aadp_handler.a2dp_queue, &destory_msg, 0 ) != pdPASS ) {
ESP_LOGE(TAG, "Destory audio_a2dp_stream_thread failed");
if ( xQueueSend( s_aadp_handler.a2dp_queue, &destroy_msg, 0 ) != pdPASS ) {
ESP_LOGE(TAG, "Destroy audio_a2dp_stream_thread failed");
return ESP_FAIL;
}
s_aadp_handler.sink_stream = NULL;
memset(&s_aadp_handler.user_callback, 0, sizeof(a2dp_stream_user_callback_t));
return ESP_OK;
}

static esp_err_t a2dp_source_destory(audio_element_handle_t self)
static esp_err_t a2dp_source_destroy(audio_element_handle_t self)
{
s_aadp_handler.source_stream = NULL;
memset(&s_aadp_handler.user_callback, 0, sizeof(a2dp_stream_user_callback_t));
Expand Down Expand Up @@ -322,7 +322,7 @@ audio_element_handle_t a2dp_stream_init(a2dp_stream_config_t *config)
if (config->type == AUDIO_STREAM_READER) {
// A2DP sink
s_aadp_handler.stream_type = AUDIO_STREAM_READER;
cfg.destroy = a2dp_sink_destory;
cfg.destroy = a2dp_sink_destroy;
el = s_aadp_handler.sink_stream = audio_element_init(&cfg);

esp_a2d_sink_register_data_callback(bt_a2d_sink_data_cb);
Expand All @@ -331,7 +331,7 @@ audio_element_handle_t a2dp_stream_init(a2dp_stream_config_t *config)
} else {
// A2DP source
s_aadp_handler.stream_type = AUDIO_STREAM_WRITER;
cfg.destroy = a2dp_source_destory;
cfg.destroy = a2dp_source_destroy;
el = s_aadp_handler.source_stream = audio_element_init(&cfg);

esp_a2d_register_callback(bt_a2d_source_cb);
Expand Down
6 changes: 3 additions & 3 deletions components/bluetooth_service/test/test_bluetooth_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ TEST_CASE("Initialize a2dp sink, create bluetooth stream and destroy stream late
TEST_ASSERT_FALSE(esp_periph_start(set, bt_periph));
vTaskDelay(100 / portTICK_PERIOD_MS);

ESP_LOGI(TAG, "Destory stream");
ESP_LOGI(TAG, "Destroy stream");
TEST_ASSERT_EQUAL(ESP_OK, esp_periph_set_stop_all(set));
TEST_ASSERT_EQUAL(ESP_OK, audio_element_stop(bt_stream_reader));
TEST_ASSERT_EQUAL(ESP_OK, audio_element_deinit(bt_stream_reader));
Expand Down Expand Up @@ -135,7 +135,7 @@ TEST_CASE("Initialize a2dp source, create bluetooth stream and destroy stream la
ESP_LOGI(TAG, "Start bt peripheral");
TEST_ASSERT_FALSE(esp_periph_start(set, bt_periph));
vTaskDelay(100 / portTICK_PERIOD_MS);
ESP_LOGI(TAG, "Destory stream");
ESP_LOGI(TAG, "Destroy stream");
TEST_ASSERT_EQUAL(ESP_OK, esp_periph_set_stop_all(set));
TEST_ASSERT_EQUAL(ESP_OK, audio_element_stop(bt_stream_writer));
TEST_ASSERT_EQUAL(ESP_OK, audio_element_deinit(bt_stream_writer));
Expand Down Expand Up @@ -181,7 +181,7 @@ TEST_CASE("Initialize a2dp sink, test discovery and cancel discovery", "[bluetoo
TEST_ASSERT_EQUAL(ESP_OK, periph_bluetooth_cancel_discover(bt_periph));
audio_element_run(bt_stream_reader);

ESP_LOGI(TAG, "Destory stream");
ESP_LOGI(TAG, "Destroy stream");
TEST_ASSERT_EQUAL(ESP_OK, esp_periph_set_stop_all(set));
TEST_ASSERT_EQUAL(ESP_OK, audio_element_stop(bt_stream_reader));
TEST_ASSERT_EQUAL(ESP_OK, audio_element_deinit(bt_stream_reader));
Expand Down
2 changes: 1 addition & 1 deletion components/esp_peripherals/lib/sdcard/sdcard.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ esp_err_t sdcard_unmount(const char *base_path, periph_sdcard_mode_t mode);
*
* @return
* - ESP_OK on success
* - ESP_FAIL destory sdcard gpio handle failed
* - ESP_FAIL destroy sdcard gpio handle failed
*/
esp_err_t sdcard_destroy(void);

Expand Down
4 changes: 2 additions & 2 deletions components/esp_peripherals/periph_gpio_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static esp_err_t _gpio_isr_run(esp_periph_handle_t self, audio_event_iface_msg_t
return ESP_FAIL;
}

static esp_err_t _gpio_isr_destory(esp_periph_handle_t self)
static esp_err_t _gpio_isr_destroy(esp_periph_handle_t self)
{
esp_err_t ret = ESP_OK;
gpio_isr_node_t *tmp, *item;
Expand Down Expand Up @@ -151,7 +151,7 @@ esp_periph_handle_t periph_gpio_isr_init(periph_gpio_isr_cfg_t *isr_config)
}

esp_periph_set_data(periph, &gpio_isr_info_list);
esp_periph_set_function(periph, _gpio_isr_init, _gpio_isr_run, _gpio_isr_destory);
esp_periph_set_function(periph, _gpio_isr_init, _gpio_isr_run, _gpio_isr_destroy);
g_handle = periph;
return periph;
}
6 changes: 3 additions & 3 deletions examples/advanced_examples/audio_mixer_tone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Refer to the table below for the supported commands:
|03| pmixer| Play a single audio channel. Multiple channels can be played simultaneously using different slots to achieve mixing effects |cli_play_mixer|
|04| smixer| Stop playback initiated by `pmixer` |cli_replay_mixer|
|05| rpmixer| Replay the audio of the `pmixer`. Ensure that the pmixer is in a stopped or completed state before replay |cli_stop_mixer|
|06| dmixer| Destroy the PMixer, which allows the released slots to be reused by other channels after destruction |cli_destory_mixer|
|06| dmixer| Destroy the PMixer, which allows the released slots to be reused by other channels after destruction |cli_destroy_mixer|
|07| gmixer| Set the gain value for the corresponding slot |cli_mixer_gain_set|
|08| record| Starting or stopping recording while playing or pausing can simulate a karaoke scene |recorder_fn|

Expand Down Expand Up @@ -385,7 +385,7 @@ I (210661) MIXER_PIPE: Mixer manager REC CMD:8,dat:14 src:0x3c16c014, Mixer:0x3c
```c
esp32> dmixer 0
I (230031) MIXER_PIPE: Waiting the task destroied...
I (230031) MIXER_PIPE: mixer pipeline destory
I (230031) MIXER_PIPE: mixer pipeline destroy
W (230041) AUDIO_ELEMENT: [mixing_in] Element has not create when AUDIO_ELEMENT_TERMINATE
W (230051) AUDIO_ELEMENT: [mixing_dec] Element has not create when AUDIO_ELEMENT_TERMINATE
I (230061) CODEC_ELEMENT_HELPER: The element is 0x3c1579a0. The reserve data 2 is 0x0.
Expand All @@ -410,4 +410,4 @@ Please use the following feedback channels:
* For technical queries, go to the [esp32.com](https://esp32.com/viewforum.php?f=20) forum
* For a feature request or bug report, create a [GitHub issue](https://github.com/espressif/esp-adf/issues)
We will get back to you as soon as possible.
We will get back to you as soon as possible.
6 changes: 3 additions & 3 deletions examples/advanced_examples/audio_mixer_tone/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
|03| pmixer| 播放单一音频通道。可以同时使用不同的槽位播放多个通道,做到混音的效果|cli_play_mixer|
|04| smixer| 停止由 pmixer启动的播放 |cli_replay_mixer|
|05| rpmixer| 重新播放pmixer的音频。确保pmixer处于停止或完成的状态后再重新播放|cli_stop_mixer|
|06| dmixer| 销毁pmixer,销毁后可以让被释放的槽位被其他通道重新使用|cli_destory_mixer|
|06| dmixer| 销毁pmixer,销毁后可以让被释放的槽位被其他通道重新使用|cli_destroy_mixer|
|07| gmixer| 设置相应槽位银牌的增益值|cli_mixer_gain_set|
|08| record| 开始录音或者停止录音并同时播放出来或暂停, 可以模拟卡拉ok场景|recorder_fn|
## 环境配置
Expand Down Expand Up @@ -385,7 +385,7 @@ I (210661) MIXER_PIPE: Mixer manager REC CMD:8,dat:14 src:0x3c16c014, Mixer:0x3c
```c
esp32> dmixer 0
I (230031) MIXER_PIPE: Waiting the task destroied...
I (230031) MIXER_PIPE: mixer pipeline destory
I (230031) MIXER_PIPE: mixer pipeline destroy
W (230041) AUDIO_ELEMENT: [mixing_in] Element has not create when AUDIO_ELEMENT_TERMINATE
W (230051) AUDIO_ELEMENT: [mixing_dec] Element has not create when AUDIO_ELEMENT_TERMINATE
I (230061) CODEC_ELEMENT_HELPER: The element is 0x3c1579a0. The reserve data 2 is 0x0.
Expand All @@ -409,4 +409,4 @@ W (230091) AUDIO_ELEMENT: [mixing_raw] Element has not create when AUDIO_ELEMENT
- 技术支持参见 [esp32.com](https://esp32.com/viewforum.php?f=20) 论坛
- 故障和新功能需求,请创建 [GitHub issue](https://github.com/espressif/esp-adf/issues)
我们会尽快回复。
我们会尽快回复。
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void mixer_manager(void *para)
xEventGroupSetBits(mixer_pipe->evt_sync, MP_DESTROYED);
audio_mixer_set_read_cb(mixer_pipe->mixer, mixer_pipe->idx, NULL, NULL);
_mixer_pipeline_event_dispatcher(MIXER_PIP_EVENT_DESTROY, mixer_pipe, mixer_pipe->idx);
ESP_LOGI(TAG, "mixer pipeline destory");
ESP_LOGI(TAG, "mixer pipeline destroy");
vTaskDelete(NULL);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static esp_err_t cli_stop_mixer(esp_periph_handle_t periph, int argc, char *argv
return ESP_OK;
}

static esp_err_t cli_destory_mixer(esp_periph_handle_t periph, int argc, char *argv[])
static esp_err_t cli_destroy_mixer(esp_periph_handle_t periph, int argc, char *argv[])
{
if (argc < 1) {
ESP_LOGE(TAG, "Usage: stop_mixer paramsters");
Expand Down Expand Up @@ -331,7 +331,7 @@ const periph_console_cmd_t cli_cmd[] = {
" example: pmixer /sdcard/test.mp3 1\n pmixer flash://tone/1_wozai.mp3 2\n pmixer https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp3 3", .func = cli_play_mixer },
{ .cmd = "rpmixer", .id = 11, .help = "Replays the audio from pmixer. Ensures that pmixer is in a stopped or finished state before replaying.\n example: rpmixer 1\n", .func = cli_replay_mixer },
{ .cmd = "smixer", .id = 12, .help = "Stop pmixer, temporarily halting audio playback.\n example: smixer 1\n", .func = cli_stop_mixer },
{ .cmd = "dmixer", .id = 13, .help = "Destroys pmixer, allowing the freed slots to be used by other channels after destruction.\n example: dmixer 1\n", .func = cli_destory_mixer },
{ .cmd = "dmixer", .id = 13, .help = "Destroys pmixer, allowing the freed slots to be used by other channels after destruction.\n example: dmixer 1\n", .func = cli_destroy_mixer },
{ .cmd = "gmixer", .id = 14, .help = "Set the gain value for the output of the corresponding slot.\n example: gmixer 1 -3\\n", .func = cli_mixer_gain_set },

{ .cmd = "setvol", .id = 15, .help = "Set volume", .func = cli_set_vol },
Expand Down
4 changes: 2 additions & 2 deletions examples/korvo_du1906/patches/a2dp_stream_du1906.patch
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ index 1d5c1905..1ddc0346 100644
audio_free(recv_msg.data);
recv_msg.data = NULL;
- break;
- case A2DP_TYPE_DESTORY:
- case A2DP_TYPE_DESTROY:
- _aadp_task_run = false;
- break;
- default:
- break;
+ break;
+ case A2DP_TYPE_DESTORY:
+ case A2DP_TYPE_DESTROY:
+ _aadp_task_run = false;
+ break;
+ default:
Expand Down

0 comments on commit fd51a44

Please sign in to comment.