Skip to content

Commit 97f8829

Browse files
committed
Merge branch 'feature/add_load_method_func' into 'main'
Add load element method function See merge request adf/multimedia/esp-gmf!37
2 parents 0029641 + dc7f331 commit 97f8829

File tree

13 files changed

+267
-188
lines changed

13 files changed

+267
-188
lines changed

gmf_core/include/esp_gmf_cap.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,18 @@ esp_gmf_err_t esp_gmf_cap_append(esp_gmf_cap_t **caps, esp_gmf_cap_t *cap_value)
187187
esp_gmf_err_t esp_gmf_cap_destroy(esp_gmf_cap_t *caps);
188188

189189
/**
190-
* @brief Fetch a capability from a given capability list using a 8-character code
190+
* @brief Fetch a capability node from a capability list using an 8-character code
191191
*
192-
* @param[in] caps Pointer to the capability list to search
193-
* @param[in] cc Character code of the capability to find
194-
* @param[out] out_caps Pointer to store the found capability
192+
* @param[in] caps Pointer to the head of the capability list to search
193+
* @param[in] eight_cc 8-character code representing the capability to find (as uint64_t)
194+
* @param[out] out_caps Pointer to the variable that will receive the found capability node
195195
*
196196
* @return
197-
* - ESP_GMF_ERR_OK The capability is found
198-
* - ESP_GMF_ERR_INVALID_ARG The argument is invalid
199-
* - ESP_GMF_ERR_NOT_FOUND The capability is not found
197+
* - ESP_GMF_ERR_OK The capability was found successfully
198+
* - ESP_GMF_ERR_INVALID_ARG One or more arguments are invalid (e.g., NULL pointers)
199+
* - ESP_GMF_ERR_NOT_FOUND No matching capability was found; `*out_caps` will be set to NULL
200200
*/
201-
esp_gmf_err_t esp_gmf_cap_fetch_node(esp_gmf_cap_t *caps, uint64_t cc, esp_gmf_cap_t *out_caps);
201+
esp_gmf_err_t esp_gmf_cap_fetch_node(esp_gmf_cap_t *caps, uint64_t eight_cc, esp_gmf_cap_t **out_caps);
202202

203203
/**
204204
* @brief Iterate over capability attributes by index

gmf_core/include/esp_gmf_element.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,20 @@ typedef struct {
9494
*/
9595
typedef esp_gmf_err_t (*esp_gmf_load_caps_func)(esp_gmf_cap_t **caps);
9696

97+
/**
98+
* @brief Function pointer type for load element method
99+
*/
100+
typedef esp_gmf_err_t (*esp_gmf_load_method_func)(esp_gmf_method_t **method);
97101
/**
98102
* @brief Structure defining the operations of an element
99103
*/
100104
typedef struct {
101-
esp_gmf_job_func open; /*!< Function to open the element */
102-
esp_gmf_job_func process; /*!< Function to process the element */
103-
esp_gmf_job_func close; /*!< Function to close the element */
104-
esp_gmf_load_caps_func load_caps; /*!< Function to load element capability description */
105-
esp_gmf_event_cb event_receiver; /*!< Event receiver function */
105+
esp_gmf_job_func open; /*!< Function to open the element */
106+
esp_gmf_job_func process; /*!< Function to process the element */
107+
esp_gmf_job_func close; /*!< Function to close the element */
108+
esp_gmf_load_caps_func load_caps; /*!< Function to load element capability description */
109+
esp_gmf_load_method_func load_methods; /*!< Function to load element methods */
110+
esp_gmf_event_cb event_receiver; /*!< Event receiver function */
106111
} esp_gmf_element_ops_t;
107112

108113
/**

gmf_core/src/esp_gmf_cap.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ esp_gmf_err_t esp_gmf_cap_iterate_attr(esp_gmf_cap_t *caps, uint32_t attr_index,
6767
return ESP_GMF_ERR_NOT_SUPPORT;
6868
}
6969

70+
esp_gmf_err_t esp_gmf_cap_fetch_node(esp_gmf_cap_t *caps, uint64_t eight_cc, esp_gmf_cap_t **out_caps)
71+
{
72+
ESP_GMF_NULL_CHECK(TAG, caps, return ESP_GMF_ERR_INVALID_ARG);
73+
ESP_GMF_NULL_CHECK(TAG, out_caps, return ESP_GMF_ERR_INVALID_ARG);
74+
esp_gmf_cap_t *current = caps;
75+
*out_caps = NULL;
76+
while (current != NULL) {
77+
if (current->cap_eightcc == eight_cc) {
78+
*out_caps = current;
79+
return ESP_GMF_ERR_OK;
80+
}
81+
current = current->next;
82+
}
83+
return ESP_GMF_ERR_NOT_FOUND;
84+
}
85+
7086
esp_gmf_err_t esp_gmf_cap_find_attr(esp_gmf_cap_t *caps, uint32_t cc, esp_gmf_cap_attr_t *out_attr)
7187
{
7288
ESP_GMF_NULL_CHECK(TAG, caps, return ESP_GMF_ERR_INVALID_ARG);

gmf_core/src/esp_gmf_element.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,13 @@ esp_gmf_err_t esp_gmf_element_get_method(esp_gmf_element_handle_t handle, esp_gm
467467
ESP_GMF_NULL_CHECK(TAG, handle, return ESP_GMF_ERR_INVALID_ARG);
468468
ESP_GMF_NULL_CHECK(TAG, mthd, return ESP_GMF_ERR_INVALID_ARG);
469469
esp_gmf_element_t *el = (esp_gmf_element_t *)handle;
470+
if ((el->method == NULL) && el->ops.load_methods) {
471+
int ret = el->ops.load_methods(&el->method);
472+
if (ret != ESP_GMF_ERR_OK) {
473+
ESP_LOGE(TAG, "Load method failed, ret:%x, [%p-%s]\r\n", ret, el, OBJ_GET_TAG(el));
474+
return ret;
475+
}
476+
}
470477
*mthd = el->method;
471478
return ESP_GMF_ERR_OK;
472479
}

gmf_core/test_apps/main/common/gmf_fake_dec.c

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -351,29 +351,14 @@ static esp_gmf_err_t _load_caps_func(esp_gmf_cap_t **caps)
351351
return ESP_GMF_ERR_OK;
352352
}
353353

354-
esp_err_t fake_dec_cast(fake_dec_cfg_t *config, esp_gmf_obj_handle_t handle)
354+
static esp_gmf_err_t _load_methods_func(esp_gmf_method_t **method)
355355
{
356-
ESP_GMF_MEM_CHECK(TAG, config, return ESP_ERR_INVALID_ARG);
357-
ESP_GMF_MEM_CHECK(TAG, handle, return ESP_ERR_INVALID_ARG);
358-
esp_gmf_audio_element_t *fake_el = (esp_gmf_audio_element_t *)handle;
359-
fake_el->base.ops.open = fake_dec_open;
360-
fake_el->base.ops.process = fake_dec_process;
361-
fake_el->base.ops.close = fake_dec_close;
362-
fake_el->base.ops.load_caps = _load_caps_func;
363-
364-
fake_dec_cfg_t *cfg = esp_gmf_oal_calloc(1, sizeof(*config));
365-
ESP_GMF_MEM_CHECK(TAG, cfg, return ESP_GMF_ERR_MEMORY_LACK);
366-
memcpy(cfg, config, sizeof(*config));
367-
// Free memory before overwriting
368-
esp_gmf_oal_free(OBJ_GET_CFG(handle));
369-
esp_gmf_obj_set_config(handle, cfg, sizeof(*config));
370-
356+
ESP_GMF_MEM_CHECK(TAG, method, return ESP_ERR_INVALID_ARG);
371357
esp_gmf_args_desc_t *set_args = NULL;
372358
esp_gmf_args_desc_t *pointer_args = NULL;
373359
esp_gmf_args_desc_t *get_args = NULL;
374360

375361
//// Register structure, two parameters, one for in, one for out
376-
377362
esp_gmf_args_desc_append(&pointer_args, "filter_type", ESP_GMF_ARGS_TYPE_UINT32, sizeof(uint32_t), offsetof(mock_para_t, type));
378363
esp_gmf_args_desc_append(&pointer_args, "fc", ESP_GMF_ARGS_TYPE_UINT32, sizeof(uint32_t), offsetof(mock_para_t, fc));
379364
esp_gmf_args_desc_append(&pointer_args, "q", ESP_GMF_ARGS_TYPE_FLOAT, sizeof(float), offsetof(mock_para_t, q));
@@ -382,11 +367,12 @@ esp_err_t fake_dec_cast(fake_dec_cfg_t *config, esp_gmf_obj_handle_t handle)
382367

383368
esp_gmf_args_desc_append(&set_args, "index", ESP_GMF_ARGS_TYPE_UINT8, sizeof(uint8_t), 0);
384369
esp_gmf_args_desc_append_array(&set_args, "para", pointer_args, sizeof(mock_para_t), sizeof(uint8_t));
385-
esp_gmf_element_register_method(fake_el, "set_para", __set_para, set_args);
370+
int ret = esp_gmf_method_append(method, "set_para", __set_para, set_args);
371+
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", "set_para");
386372
ESP_GMF_ARGS_DESC_PRINT(set_args);
387373

388374
esp_gmf_args_desc_copy(set_args, &get_args);
389-
esp_gmf_element_register_method(fake_el, "get_para", __get_para, get_args);
375+
ret = esp_gmf_method_append(method, "get_para", __get_para, get_args);
390376
ESP_GMF_ARGS_DESC_PRINT(get_args);
391377

392378
//// Register nested structure
@@ -409,12 +395,12 @@ esp_err_t fake_dec_cast(fake_dec_cfg_t *config, esp_gmf_obj_handle_t handle)
409395
ESP_GMF_ARGS_DESC_PRINT(nested_args);
410396

411397
esp_gmf_args_desc_append_array(&set_args, "desc", nested_args, sizeof(mock_dec_desc_t), offsetof(mock_dec_el_args_t, desc));
412-
esp_gmf_args_desc_append(&set_args, "label", ESP_GMF_ARGS_TYPE_INT8, sizeof(((fake_decoder_t *)fake_el)->args.label), offsetof(mock_dec_el_args_t, label));
413-
esp_gmf_element_register_method(fake_el, "set_args", __set_args, set_args);
398+
esp_gmf_args_desc_append(&set_args, "label", ESP_GMF_ARGS_TYPE_INT8, 16, offsetof(mock_dec_el_args_t, label));
399+
ret = esp_gmf_method_append(method, "set_args", __set_args, set_args);
414400
ESP_GMF_ARGS_DESC_PRINT(set_args);
415401

416402
esp_gmf_args_desc_copy(set_args, &get_args);
417-
esp_gmf_element_register_method(fake_el, "get_args", __get_args, get_args);
403+
ret = esp_gmf_method_append(method, "get_args", __get_args, get_args);
418404
ESP_GMF_ARGS_DESC_PRINT(get_args);
419405

420406
// Register integer parameters
@@ -423,34 +409,55 @@ esp_err_t fake_dec_cast(fake_dec_cfg_t *config, esp_gmf_obj_handle_t handle)
423409
esp_gmf_args_desc_append(&set_args, "ch", ESP_GMF_ARGS_TYPE_UINT16, sizeof(uint16_t), sizeof(uint32_t));
424410
esp_gmf_args_desc_append(&set_args, "bits", ESP_GMF_ARGS_TYPE_UINT16, sizeof(uint16_t), sizeof(uint16_t) + sizeof(uint32_t));
425411
esp_gmf_args_desc_copy(set_args, &get_args);
426-
esp_gmf_element_register_method(fake_el, "set_info", __set_info, set_args);
412+
ret = esp_gmf_method_append(method, "set_info", __set_info, set_args);
427413
ESP_GMF_ARGS_DESC_PRINT(get_args);
428-
esp_gmf_element_register_method(fake_el, "get_info", __get_info, get_args);
414+
ret = esp_gmf_method_append(method, "get_info", __get_info, get_args);
429415

430416
// Register string parameters
431417
set_args = NULL;
432-
esp_gmf_args_desc_append(&set_args, "dec_name", ESP_GMF_ARGS_TYPE_INT8, sizeof(((fake_decoder_t *)fake_el)->fake_name), 0);
418+
esp_gmf_args_desc_append(&set_args, "dec_name", ESP_GMF_ARGS_TYPE_INT8, 32, 0);
433419
esp_gmf_args_desc_copy(set_args, &get_args);
434-
esp_gmf_element_register_method(fake_el, "set_name", __set_name, set_args);
420+
ret = esp_gmf_method_append(method, "set_name", __set_name, set_args);
435421
ESP_GMF_ARGS_DESC_PRINT(get_args);
436-
esp_gmf_element_register_method(fake_el, "get_name", __get_name, get_args);
422+
ret = esp_gmf_method_append(method, "get_name", __get_name, get_args);
437423

438424
// Register 64bits integer parameters
439425
set_args = NULL;
440-
esp_gmf_args_desc_append(&set_args, "size", ESP_GMF_ARGS_TYPE_UINT64, sizeof(((fake_decoder_t *)fake_el)->data_size), 0);
426+
esp_gmf_args_desc_append(&set_args, "size", ESP_GMF_ARGS_TYPE_UINT64, 8, 0);
441427
esp_gmf_args_desc_copy(set_args, &get_args);
442428
ESP_GMF_ARGS_DESC_PRINT(set_args);
443-
esp_gmf_element_register_method(fake_el, "set_size", __set_size, set_args);
444-
esp_gmf_element_register_method(fake_el, "get_size", __get_size, get_args);
429+
ret = esp_gmf_method_append(method, "set_size", __set_size, set_args);
430+
ret = esp_gmf_method_append(method, "get_size", __get_size, get_args);
445431

446432
// Register two parameters, one for in, one for out
447433
set_args = NULL;
448434
esp_gmf_args_desc_append(&set_args, "index", ESP_GMF_ARGS_TYPE_UINT8, sizeof(uint8_t), 0);
449-
esp_gmf_args_desc_append(&set_args, "filter", ESP_GMF_ARGS_TYPE_UINT64, sizeof(((fake_decoder_t *)fake_el)->filter[0]), sizeof(uint8_t));
435+
esp_gmf_args_desc_append(&set_args, "filter", ESP_GMF_ARGS_TYPE_UINT64, 8, sizeof(uint8_t));
450436
esp_gmf_args_desc_copy(set_args, &get_args);
451437
ESP_GMF_ARGS_DESC_PRINT(set_args);
452-
esp_gmf_element_register_method(fake_el, "set_filter", __set_filter, set_args);
453-
esp_gmf_element_register_method(fake_el, "get_filter", __get_filter, get_args);
438+
ret = esp_gmf_method_append(method, "set_filter", __set_filter, set_args);
439+
ret = esp_gmf_method_append(method, "get_filter", __get_filter, get_args);
440+
441+
return ESP_GMF_ERR_OK;
442+
}
443+
444+
esp_err_t fake_dec_cast(fake_dec_cfg_t *config, esp_gmf_obj_handle_t handle)
445+
{
446+
ESP_GMF_MEM_CHECK(TAG, config, return ESP_ERR_INVALID_ARG);
447+
ESP_GMF_MEM_CHECK(TAG, handle, return ESP_ERR_INVALID_ARG);
448+
esp_gmf_audio_element_t *fake_el = (esp_gmf_audio_element_t *)handle;
449+
fake_el->base.ops.open = fake_dec_open;
450+
fake_el->base.ops.process = fake_dec_process;
451+
fake_el->base.ops.close = fake_dec_close;
452+
fake_el->base.ops.load_caps = _load_caps_func;
453+
fake_el->base.ops.load_methods = _load_methods_func;
454+
455+
fake_dec_cfg_t *cfg = esp_gmf_oal_calloc(1, sizeof(*config));
456+
ESP_GMF_MEM_CHECK(TAG, cfg, return ESP_GMF_ERR_MEMORY_LACK);
457+
memcpy(cfg, config, sizeof(*config));
458+
// Free memory before overwriting
459+
esp_gmf_oal_free(OBJ_GET_CFG(handle));
460+
esp_gmf_obj_set_config(handle, cfg, sizeof(*config));
454461

455462
return ESP_OK;
456463
}

gmf_elements/gmf_audio/esp_gmf_alc.c

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,27 @@ static esp_gmf_err_t _load_alc_caps_func(esp_gmf_cap_t **caps)
256256
return ESP_GMF_ERR_OK;
257257
}
258258

259+
static esp_gmf_err_t _load_alc_methods_func(esp_gmf_method_t **method)
260+
{
261+
ESP_GMF_MEM_CHECK(TAG, method, return ESP_ERR_INVALID_ARG);
262+
esp_gmf_args_desc_t *set_args = NULL;
263+
esp_gmf_args_desc_t *get_args = NULL;
264+
esp_gmf_err_t ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_ALC_SET_GAIN_ARG_IDX,
265+
ESP_GMF_ARGS_TYPE_UINT8, sizeof(uint8_t), 0);
266+
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append index argument");
267+
ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_ALC_SET_GAIN_ARG_GAIN, ESP_GMF_ARGS_TYPE_INT8,
268+
sizeof(int8_t), sizeof(uint8_t));
269+
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append gain argument");
270+
ret = esp_gmf_method_append(method, ESP_GMF_METHOD_ALC_SET_GAIN, __alc_set_gain, set_args);
271+
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", ESP_GMF_METHOD_ALC_SET_GAIN);
272+
273+
ret = esp_gmf_args_desc_copy(set_args, &get_args);
274+
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to copy argument");
275+
ret = esp_gmf_method_append(method, ESP_GMF_METHOD_ALC_GET_GAIN, __alc_get_gain, get_args);
276+
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", ESP_GMF_METHOD_ALC_GET_GAIN);
277+
return ESP_GMF_ERR_OK;
278+
}
279+
259280
esp_gmf_err_t esp_gmf_alc_set_gain(esp_gmf_audio_element_handle_t handle, uint8_t idx, int8_t gain)
260281
{
261282
ESP_GMF_NULL_CHECK(TAG, handle, {return ESP_GMF_ERR_INVALID_ARG;});
@@ -331,27 +352,12 @@ esp_gmf_err_t esp_gmf_alc_cast(esp_ae_alc_cfg_t *config, esp_gmf_obj_handle_t ha
331352
esp_gmf_oal_free(OBJ_GET_CFG(handle));
332353
esp_gmf_obj_set_config(handle, cfg, sizeof(*config));
333354
esp_gmf_audio_element_t *alc_el = (esp_gmf_audio_element_t *)handle;
334-
esp_gmf_args_desc_t *set_args = NULL;
335-
esp_gmf_args_desc_t *get_args = NULL;
336-
337-
esp_gmf_err_t ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_ALC_SET_GAIN_ARG_IDX,
338-
ESP_GMF_ARGS_TYPE_UINT8, sizeof(uint8_t), 0);
339-
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append argument");
340-
ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_ALC_SET_GAIN_ARG_GAIN, ESP_GMF_ARGS_TYPE_INT8,
341-
sizeof(int8_t), sizeof(uint8_t));
342-
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append argument");
343-
ret = esp_gmf_element_register_method(alc_el, ESP_GMF_METHOD_ALC_SET_GAIN, __alc_set_gain, set_args);
344-
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to register method");
345-
346-
ret = esp_gmf_args_desc_copy(set_args, &get_args);
347-
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to copy argument");
348-
ret = esp_gmf_element_register_method(alc_el, ESP_GMF_METHOD_ALC_GET_GAIN, __alc_get_gain, get_args);
349-
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to register method");
350355

351356
alc_el->base.ops.open = esp_gmf_alc_open;
352357
alc_el->base.ops.process = esp_gmf_alc_process;
353358
alc_el->base.ops.close = esp_gmf_alc_close;
354359
alc_el->base.ops.event_receiver = alc_received_event_handler;
355360
alc_el->base.ops.load_caps = _load_alc_caps_func;
361+
alc_el->base.ops.load_methods = _load_alc_methods_func;
356362
return ESP_GMF_ERR_OK;
357363
}

gmf_elements/gmf_audio/esp_gmf_bit_cvt.c

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,18 @@ static esp_gmf_err_t _load_bit_cvt_caps_func(esp_gmf_cap_t **caps)
226226
return ESP_GMF_ERR_OK;
227227
}
228228

229+
static esp_gmf_err_t _load_bit_cvt_methods_func(esp_gmf_method_t **method)
230+
{
231+
ESP_GMF_MEM_CHECK(TAG, method, return ESP_ERR_INVALID_ARG);
232+
esp_gmf_args_desc_t *set_args = NULL;
233+
esp_gmf_err_t ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_BIT_CVT_SET_DEST_BITS_ARG_BITS,
234+
ESP_GMF_ARGS_TYPE_UINT8, sizeof(uint8_t), 0);
235+
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append argument");
236+
ret = esp_gmf_method_append(method, ESP_GMF_METHOD_BIT_CVT_SET_DEST_BITS, __set_dest_bits, set_args);
237+
ESP_GMF_RET_ON_ERROR(TAG, ret, {return ret;}, "Failed to register %s method", ESP_GMF_METHOD_BIT_CVT_SET_DEST_BITS);
238+
return ESP_GMF_ERR_OK;
239+
}
240+
229241
esp_gmf_err_t esp_gmf_bit_cvt_set_dest_bits(esp_gmf_audio_element_handle_t handle, uint8_t dest_bits)
230242
{
231243
ESP_GMF_NULL_CHECK(TAG, handle, {return ESP_GMF_ERR_INVALID_ARG;});
@@ -277,26 +289,19 @@ esp_gmf_err_t esp_gmf_bit_cvt_cast(esp_ae_bit_cvt_cfg_t *config, esp_gmf_obj_han
277289
{
278290
ESP_GMF_NULL_CHECK(TAG, config, {return ESP_GMF_ERR_INVALID_ARG;});
279291
ESP_GMF_NULL_CHECK(TAG, handle, {return ESP_GMF_ERR_INVALID_ARG;});
280-
esp_gmf_err_t ret = ESP_GMF_ERR_OK;
281292
esp_ae_bit_cvt_cfg_t *cfg = esp_gmf_oal_calloc(1, sizeof(*config));
282293
ESP_GMF_MEM_VERIFY(TAG, cfg, {return ESP_GMF_ERR_MEMORY_LACK;}, "bit conversion configuration", sizeof(*config));
283294
memcpy(cfg, config, sizeof(*config));
284295
// Free memory before overwriting
285296
esp_gmf_oal_free(OBJ_GET_CFG(handle));
286297
esp_gmf_obj_set_config(handle, cfg, sizeof(*config));
287298
esp_gmf_audio_element_t *bit_cvt_el = (esp_gmf_audio_element_t *)handle;
288-
esp_gmf_args_desc_t *set_args = NULL;
289-
290-
ret = esp_gmf_args_desc_append(&set_args, ESP_GMF_METHOD_BIT_CVT_SET_DEST_BITS_ARG_BITS,
291-
ESP_GMF_ARGS_TYPE_UINT8, sizeof(uint8_t), 0);
292-
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to append argument");
293-
ret = esp_gmf_element_register_method(bit_cvt_el, ESP_GMF_METHOD_BIT_CVT_SET_DEST_BITS, __set_dest_bits, set_args);
294-
ESP_GMF_RET_ON_NOT_OK(TAG, ret, {return ret;}, "Failed to register method");
295299

296300
bit_cvt_el->base.ops.open = esp_gmf_bit_cvt_open;
297301
bit_cvt_el->base.ops.process = esp_gmf_bit_cvt_process;
298302
bit_cvt_el->base.ops.close = esp_gmf_bit_cvt_close;
299303
bit_cvt_el->base.ops.event_receiver = bit_cvt_received_event_handler;
300304
bit_cvt_el->base.ops.load_caps = _load_bit_cvt_caps_func;
305+
bit_cvt_el->base.ops.load_methods = _load_bit_cvt_methods_func;
301306
return ESP_GMF_ERR_OK;
302307
}

0 commit comments

Comments
 (0)