Skip to content

Commit

Permalink
[AUTO] Update native headers to rtc_4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe authored Nov 25, 2024
1 parent bc2d246 commit 2d98f12
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion headers/rtc_4.5.0/include/rte_base/c/c_rte.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ AGORA_RTE_API_C void RteConfigGetJsonParameter(RteConfig *config,
RteError *err);

AGORA_RTE_API_C Rte RteCreate(RteInitialConfig *config, RteError *err);
AGORA_RTE_API_C void RteDestroy(Rte *self, RteError *err);
AGORA_RTE_API_C bool RteDestroy(Rte *self, RteError *err);

AGORA_RTE_API_C bool RteInitMediaEngine(Rte *self,
void (*cb)(Rte *self, void *cb_data,
Expand Down
16 changes: 15 additions & 1 deletion headers/rtc_4.5.0/include/rte_base/rte_cpp_rte.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class Rte {
* @param config Rte object initialization configuration object.
*/
explicit Rte(InitialConfig *config = nullptr): c_rte(::RteCreate(config != nullptr ? &config->c_rte_init_cfg : nullptr, nullptr)) {}
~Rte(){RteDestroy(&c_rte, nullptr);};
~Rte(){Destroy();};

/**
* Construct a new Rte object.
Expand Down Expand Up @@ -375,6 +375,20 @@ class Rte {
return RteSetConfigs(&c_rte, config != nullptr ? config->get_underlying_impl(): nullptr, err != nullptr ? err->get_underlying_impl() : nullptr);
}

/**
* Destroy the Rte object. The operation will release all resources used by the Rte object.
* @since v4.4.0
* @param err Possible return values for ErrorCode:
* - kRteOk: Success
* - kRteErrorInvalidOperation: The corresponding internal Rte object has been destroyed or is invalid.
* @return bool Returns the result of destroying the Rte object.
* - true: Successfully destroyed.
* - false: Failed to destroy.
*/
bool Destroy(Error *err = nullptr){
return RteDestroy(&c_rte, err != nullptr ? err->get_underlying_impl() : nullptr);
}

private:

explicit Rte(::Rte other) { c_rte = other; }
Expand Down

0 comments on commit 2d98f12

Please sign in to comment.