[Asterisk-code-review] rtp_engine.h: Update examples using ast_format_set. (asterisk[master])

Friendly Automation asteriskteam at digium.com
Thu Dec 8 09:08:21 CST 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/19578 )

Change subject: rtp_engine.h: Update examples using ast_format_set.
......................................................................

rtp_engine.h: Update examples using ast_format_set.

This file includes some doxygen comments referencing
ast_format_set. This is an obsolete API that was
removed years back, but documentation was not fully
updated to reflect that. These examples are
updated to the current way of doing things
(using the format cache).

ASTERISK-30327 #close

Change-Id: I570f3b8007fa17ba470cc7117f44bfe7c555d2f7
---
M include/asterisk/rtp_engine.h
1 file changed, 24 insertions(+), 6 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit




diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index 833cd2b..50e2a7b 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -1719,7 +1719,7 @@
  * Example usage:
  *
  * \code
- * int payload = ast_rtp_codecs_payload_code(&codecs, 1, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0), 0);
+ * int payload = ast_rtp_codecs_payload_code(&codecs, 1, ast_format_ulaw, 0);
  * \endcode
  *
  * This looks for the numerical payload for ULAW in the codecs structure.
@@ -1788,7 +1788,7 @@
  * Example usage:
  *
  * \code
- * const char *subtype = ast_rtp_lookup_mime_subtype2(1, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0), 0, 0);
+ * const char *subtype = ast_rtp_lookup_mime_subtype2(1, ast_format_ulaw, 0, 0);
  * \endcode
  *
  * This looks up the mime subtype for the ULAW format.
@@ -1816,8 +1816,8 @@
  * char buf[256] = "";
  * struct ast_format tmp_fmt;
  * struct ast_format_cap *cap = ast_format_cap_alloc_nolock();
- * ast_format_cap_append(cap, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0));
- * ast_format_cap_append(cap, ast_format_set(&tmp_fmt, AST_FORMAT_GSM, 0));
+ * ast_format_cap_append(cap, ast_format_ulaw, 0);
+ * ast_format_cap_append(cap, ast_format_ulaw, 0);
  * char *mime = ast_rtp_lookup_mime_multiple2(&buf, sizeof(buf), cap, 0, 1, 0);
  * ast_format_cap_destroy(cap);
  * \endcode
@@ -2220,7 +2220,7 @@
  *
  * \code
  * struct ast_format tmp_fmt;
- * ast_rtp_instance_set_read_format(instance, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0));
+ * ast_rtp_instance_set_read_format(instance, ast_format_ulaw);
  * \endcode
  *
  * This requests that the RTP engine provide audio frames in the ULAW format.
@@ -2242,7 +2242,7 @@
  *
  * \code
  * struct ast_format tmp_fmt;
- * ast_rtp_instance_set_write_format(instance, ast_format_set(&tmp_fmt, AST_FORMAT_ULAW, 0));
+ * ast_rtp_instance_set_write_format(instance, ast_format_ulaw);
  * \endcode
  *
  * This tells the underlying RTP engine that audio frames will be provided to it in ULAW format.

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19578
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I570f3b8007fa17ba470cc7117f44bfe7c555d2f7
Gerrit-Change-Number: 19578
Gerrit-PatchSet: 2
Gerrit-Owner: N A <asterisk at phreaknet.org>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20221208/993a1d04/attachment.html>


More information about the asterisk-code-review mailing list