summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-10-24 09:28:13 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-10-24 09:28:13 +0000
commit2068f13bc42cf3a47374aa2765f82724a5782028 (patch)
tree29fbeaa152ab51e59b650c0d7cd83a38111e1ecc /pjmedia/include
parent1c72a42676e7aa0c2ae0734549050f738f3bdf02 (diff)
Re #1395: Backport of PJSIP 1.x branch into PJSIP 2.0 trunk
* Backport of r3557:r3832 TODO: ticket #1268 (Option for automatic/manual sending of RTCP SDES/BYE for the stream) for video stream. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3841 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia-audiodev/config.h15
-rw-r--r--pjmedia/include/pjmedia-codec.h1
-rw-r--r--pjmedia/include/pjmedia-codec/amr_helper.h17
-rw-r--r--pjmedia/include/pjmedia-codec/config.h33
-rw-r--r--pjmedia/include/pjmedia-codec/config_auto.h.in5
-rw-r--r--pjmedia/include/pjmedia-codec/opencore_amrnb.h89
-rw-r--r--pjmedia/include/pjmedia/config.h71
-rw-r--r--pjmedia/include/pjmedia/delaybuf.h20
-rw-r--r--pjmedia/include/pjmedia/echo.h10
-rw-r--r--pjmedia/include/pjmedia/jbuf.h52
-rw-r--r--pjmedia/include/pjmedia/session.h20
-rw-r--r--pjmedia/include/pjmedia/stream.h23
-rw-r--r--pjmedia/include/pjmedia/transport_adapter_sample.h9
13 files changed, 342 insertions, 23 deletions
diff --git a/pjmedia/include/pjmedia-audiodev/config.h b/pjmedia/include/pjmedia-audiodev/config.h
index 2ef9e9f6..d0df6756 100644
--- a/pjmedia/include/pjmedia-audiodev/config.h
+++ b/pjmedia/include/pjmedia-audiodev/config.h
@@ -145,6 +145,21 @@ PJ_BEGIN_DECL
/**
+ * This setting controls whether the Symbian audio with built-in multimedia
+ * framework backend should be started synchronously. Note that synchronous
+ * start will block the application/UI, e.g: about 40ms for each direction
+ * on N95. While asynchronous start may cause invalid value (always zero)
+ * returned in input/output volume query, if the query is performed when
+ * the internal start procedure is not completely finished.
+ *
+ * Default: 1 (yes)
+ */
+#ifndef PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START
+# define PJMEDIA_AUDIO_DEV_MDA_USE_SYNC_START 1
+#endif
+
+
+/**
* This setting controls whether the Audio Device API should support
* device implementation that is based on the old sound device API
* (sound.h).
diff --git a/pjmedia/include/pjmedia-codec.h b/pjmedia/include/pjmedia-codec.h
index 7e77b1d7..9eba4c11 100644
--- a/pjmedia/include/pjmedia-codec.h
+++ b/pjmedia/include/pjmedia-codec.h
@@ -35,6 +35,7 @@
#include <pjmedia-codec/g7221.h>
#include <pjmedia-codec/ipp_codecs.h>
#include <pjmedia-codec/passthrough.h>
+#include <pjmedia-codec/opencore_amrnb.h>
#endif /* __PJMEDIA_CODEC_PJMEDIA_CODEC_H__ */
diff --git a/pjmedia/include/pjmedia-codec/amr_helper.h b/pjmedia/include/pjmedia-codec/amr_helper.h
index 6bca5ac1..fc63eb47 100644
--- a/pjmedia/include/pjmedia-codec/amr_helper.h
+++ b/pjmedia/include/pjmedia-codec/amr_helper.h
@@ -567,7 +567,7 @@ const pj_int16_t* const pjmedia_codec_amrwb_ordermaps[9] =
* Constant of AMR-NB frame lengths in bytes.
*/
const pj_uint8_t pjmedia_codec_amrnb_framelen[16] =
- {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 5};
+ {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0};
/**
* Constant of AMR-NB frame lengths in bits.
*/
@@ -583,7 +583,7 @@ const pj_uint16_t pjmedia_codec_amrnb_bitrates[8] =
* Constant of AMR-WB frame lengths in bytes.
*/
const pj_uint8_t pjmedia_codec_amrwb_framelen[16] =
- {17, 23, 32, 37, 40, 46, 50, 58, 60, 5, 0, 0, 0, 0, 0, 5};
+ {17, 23, 32, 37, 40, 46, 50, 58, 60, 5, 0, 0, 0, 0, 0, 0};
/**
* Constant of AMR-WB frame lengths in bits.
*/
@@ -606,6 +606,7 @@ typedef struct pjmedia_codec_amr_bit_info {
pj_int8_t mode; /**< AMR mode. */
pj_uint8_t start_bit; /**< Frame start bit. */
pj_uint8_t good_quality:1; /**< Flag if frame is good/degraded. */
+ pj_uint8_t STI:1; /**< STI mode (first/update). */
} pjmedia_codec_amr_bit_info;
#pragma pack()
@@ -1020,9 +1021,7 @@ PJ_INLINE (pj_status_t) pjmedia_codec_amr_pack(
} else if (info->frame_type == SID_FT) {
/* SID */
- pj_uint8_t STI = 0;
-
- amr_bits[35] = (pj_uint8_t)(STI & 1);
+ amr_bits[35] |= info->STI;
if (setting->amr_nb) {
amr_bits[36] = (pj_uint8_t)((info->mode >> 2) & 1);
@@ -1163,6 +1162,7 @@ PJ_INLINE(pj_status_t) pjmedia_codec_amr_parse(
info->mode = (pj_int8_t)((FT < SID_FT)? FT : -1);
info->good_quality = (pj_uint8_t)(Q == 1);
info->start_bit = 0;
+ info->STI = 0;
frames[cnt].timestamp = ts_;
frames[cnt].type = PJMEDIA_FRAME_TYPE_AUDIO;
@@ -1186,6 +1186,13 @@ PJ_INLINE(pj_status_t) pjmedia_codec_amr_parse(
frames[cnt].buf = r;
info->start_bit = r_bitptr;
+ if (FT == SID_FT) {
+ unsigned sti_bitptr;
+ sti_bitptr = r_bitptr + 35;
+ info->STI = (pj_uint8_t)
+ (r[sti_bitptr >> 3] >> (7 - (sti_bitptr % 8))) & 1;
+ }
+
if (setting->octet_aligned) {
r += framelen_tbl[FT];
frames[cnt].size = framelen_tbl[FT];
diff --git a/pjmedia/include/pjmedia-codec/config.h b/pjmedia/include/pjmedia-codec/config.h
index 6b55baa2..0f94a98c 100644
--- a/pjmedia/include/pjmedia-codec/config.h
+++ b/pjmedia/include/pjmedia-codec/config.h
@@ -313,6 +313,39 @@
#endif
/**
+ * Enable OpenCORE AMR-NB codec.
+ * See https://trac.pjsip.org/repos/ticket/1388 for some info.
+ *
+ * Default: 0
+ */
+#ifndef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
+# define PJMEDIA_HAS_OPENCORE_AMRNB_CODEC 0
+#endif
+
+/**
+ * Link with libopencore-amrXX via pragma comment on Visual Studio.
+ * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
+ * is enabled.
+ *
+ * Default: 1
+ */
+#ifndef PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS
+# define PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS 1
+#endif
+
+/**
+ * Link with libopencore-amrXX.a that has been produced with gcc.
+ * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
+ * and PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS are enabled.
+ *
+ * Default: 1
+ */
+#ifndef PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC
+# define PJMEDIA_OPENCORE_AMR_BUILT_WITH_GCC 1
+#endif
+
+
+/**
* Default G.722.1 codec encoder and decoder level adjustment.
* If the value is non-zero, then PCM input samples to the encoder will
* be shifted right by this value, and similarly PCM output samples from
diff --git a/pjmedia/include/pjmedia-codec/config_auto.h.in b/pjmedia/include/pjmedia-codec/config_auto.h.in
index 9c2a9af2..c469d795 100644
--- a/pjmedia/include/pjmedia-codec/config_auto.h.in
+++ b/pjmedia/include/pjmedia-codec/config_auto.h.in
@@ -69,6 +69,11 @@
#undef PJMEDIA_HAS_G7221_CODEC
#endif
+/* OpenCORE AMR-NB codec */
+#ifndef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
+#undef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC
+#endif
+
#endif /* __PJMEDIA_CODEC_CONFIG_AUTO_H_ */
diff --git a/pjmedia/include/pjmedia-codec/opencore_amrnb.h b/pjmedia/include/pjmedia-codec/opencore_amrnb.h
new file mode 100644
index 00000000..3e618e46
--- /dev/null
+++ b/pjmedia/include/pjmedia-codec/opencore_amrnb.h
@@ -0,0 +1,89 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2011 Dan Arrhenius <dan@keystream.se>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#ifndef __PJMEDIA_CODEC_OPENCORE_AMRNB_H__
+#define __PJMEDIA_CODEC_OPENCORE_AMRNB_H__
+
+#include <pjmedia-codec/types.h>
+
+/**
+ * @defgroup PJMED_OC_AMRNB OpenCORE AMR-NB Codec
+ * @ingroup PJMEDIA_CODEC_CODECS
+ * @brief AMRCodec wrapper for OpenCORE AMR-NB codec
+ * @{
+ */
+
+PJ_BEGIN_DECL
+
+/**
+ * Settings. Use #pjmedia_codec_opencore_amrnb_set_config() to
+ * activate.
+ */
+typedef struct pjmedia_codec_amrnb_config
+{
+ /**
+ * Control whether to use octent align.
+ */
+ pj_bool_t octet_align;
+
+ /**
+ * Set the bitrate.
+ */
+ unsigned bitrate;
+
+} pjmedia_codec_amrnb_config;
+
+
+/**
+ * Initialize and register AMR-NB codec factory to pjmedia endpoint.
+ *
+ * @param endpt The pjmedia endpoint.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_init(pjmedia_endpt* endpt);
+
+/**
+ * Unregister AMR-NB codec factory from pjmedia endpoint and deinitialize
+ * the OpenCORE codec library.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_deinit(void);
+
+
+/**
+ * Set AMR-NB parameters.
+ *
+ * @param cfg The settings;
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_set_config(
+ const pjmedia_codec_amrnb_config* cfg);
+
+PJ_END_DECL
+
+
+/**
+ * @}
+ */
+
+#endif /* __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ */
+
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h
index e7d2e149..60930818 100644
--- a/pjmedia/include/pjmedia/config.h
+++ b/pjmedia/include/pjmedia/config.h
@@ -387,7 +387,7 @@
/**
- * Number of packets received from different source IP address from the
+ * Number of RTP packets received from different source IP address from the
* remote address required to make the stream switch transmission
* to the source address.
*/
@@ -397,6 +397,16 @@
/**
+ * Number of RTCP packets received from different source IP address from the
+ * remote address required to make the stream switch RTCP transmission
+ * to the source address.
+ */
+#ifndef PJMEDIA_RTCP_NAT_PROBATION_CNT
+# define PJMEDIA_RTCP_NAT_PROBATION_CNT 3
+#endif
+
+
+/**
* Specify whether RTCP should be advertised in SDP. This setting would
* affect whether RTCP candidate will be added in SDP when ICE is used.
* Application might want to disable RTCP advertisement in SDP to
@@ -916,7 +926,7 @@
* Default: 5 seconds
*/
#ifndef PJMEDIA_STREAM_KA_INTERVAL
-# define PJMEDIA_STREAM_KA_INTERVAL 5
+# define PJMEDIA_STREAM_KA_INTERVAL 5
#endif
@@ -1057,6 +1067,63 @@
/**
+ * Minimum gap between two consecutive discards in jitter buffer,
+ * in milliseconds.
+ *
+ * Default: 200 ms
+ */
+#ifndef PJMEDIA_JBUF_DISC_MIN_GAP
+# define PJMEDIA_JBUF_DISC_MIN_GAP 200
+#endif
+
+
+/**
+ * Minimum burst level reference used for calculating discard duration
+ * in jitter buffer progressive discard algorithm, in frames.
+ *
+ * Default: 1 frame
+ */
+#ifndef PJMEDIA_JBUF_PRO_DISC_MIN_BURST
+# define PJMEDIA_JBUF_PRO_DISC_MIN_BURST 1
+#endif
+
+
+/**
+ * Maximum burst level reference used for calculating discard duration
+ * in jitter buffer progressive discard algorithm, in frames.
+ *
+ * Default: 200 frames
+ */
+#ifndef PJMEDIA_JBUF_PRO_DISC_MAX_BURST
+# define PJMEDIA_JBUF_PRO_DISC_MAX_BURST 100
+#endif
+
+
+/**
+ * Duration for progressive discard algotithm in jitter buffer to discard
+ * an excessive frame when burst is equal to or lower than
+ * PJMEDIA_JBUF_PRO_DISC_MIN_BURST, in milliseconds.
+ *
+ * Default: 2000 ms
+ */
+#ifndef PJMEDIA_JBUF_PRO_DISC_T1
+# define PJMEDIA_JBUF_PRO_DISC_T1 2000
+#endif
+
+
+/**
+ * Duration for progressive discard algotithm in jitter buffer to discard
+ * an excessive frame when burst is equal to or lower than
+ * PJMEDIA_JBUF_PRO_DISC_MAX_BURST, in milliseconds.
+ *
+ * Default: 10000 ms
+ */
+#ifndef PJMEDIA_JBUF_PRO_DISC_T2
+# define PJMEDIA_JBUF_PRO_DISC_T2 10000
+#endif
+
+
+/**
* Video stream will discard old picture from the jitter buffer as soon as
* new picture is received, to reduce latency.
*
diff --git a/pjmedia/include/pjmedia/delaybuf.h b/pjmedia/include/pjmedia/delaybuf.h
index 9dcad5ee..09b01bbb 100644
--- a/pjmedia/include/pjmedia/delaybuf.h
+++ b/pjmedia/include/pjmedia/delaybuf.h
@@ -64,6 +64,19 @@ PJ_BEGIN_DECL
typedef struct pjmedia_delay_buf pjmedia_delay_buf;
/**
+ * Delay buffer options.
+ */
+typedef enum pjmedia_delay_buf_flag
+{
+ /**
+ * Use simple FIFO mechanism for the delay buffer, i.e.
+ * without WSOLA for expanding and shrinking audio samples.
+ */
+ PJMEDIA_DELAY_BUF_SIMPLE_FIFO = 1
+
+} pjmedia_delay_buf_flag;
+
+/**
* Create the delay buffer. Once the delay buffer is created, it will
* enter learning state unless the delay argument is specified, which
* in this case it will directly enter the running state.
@@ -79,7 +92,12 @@ typedef struct pjmedia_delay_buf pjmedia_delay_buf;
* in ms, if this value is negative or less than
* one frame time, default maximum delay used is
* 400 ms.
- * @param options Option flags, must be zero for now.
+ * @param options Options. If PJMEDIA_DELAY_BUF_SIMPLE_FIFO is
+ * specified, then a simple FIFO mechanism
+ * will be used instead of the adaptive
+ * implementation (which uses WSOLA to expand
+ * or shrink audio samples).
+ * See #pjmedia_delay_buf_flag for other options.
* @param p_b Pointer to receive the delay buffer instance.
*
* @return PJ_SUCCESS if the delay buffer has been
diff --git a/pjmedia/include/pjmedia/echo.h b/pjmedia/include/pjmedia/echo.h
index f2c2210c..ba7f8897 100644
--- a/pjmedia/include/pjmedia/echo.h
+++ b/pjmedia/include/pjmedia/echo.h
@@ -88,7 +88,15 @@ typedef enum pjmedia_echo_flag
* for the echo canceller, but application will guarantee that echo
* canceller will not be called by different threads at the same time.
*/
- PJMEDIA_ECHO_NO_LOCK = 16
+ PJMEDIA_ECHO_NO_LOCK = 16,
+
+ /**
+ * If PJMEDIA_ECHO_USE_SIMPLE_FIFO flag is specified, the delay buffer
+ * created for the echo canceller will use simple FIFO mechanism, i.e.
+ * without using WSOLA to expand and shrink audio samples.
+ */
+ PJMEDIA_ECHO_USE_SIMPLE_FIFO = 32
+
} pjmedia_echo_flag;
diff --git a/pjmedia/include/pjmedia/jbuf.h b/pjmedia/include/pjmedia/jbuf.h
index 2ae4ed6c..2cda3dd9 100644
--- a/pjmedia/include/pjmedia/jbuf.h
+++ b/pjmedia/include/pjmedia/jbuf.h
@@ -48,7 +48,7 @@ PJ_BEGIN_DECL
/**
* Types of frame returned by the jitter buffer.
*/
-enum pjmedia_jb_frame_type
+typedef enum pjmedia_jb_frame_type
{
PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing */
PJMEDIA_JB_NORMAL_FRAME = 1, /**< Normal frame is being returned */
@@ -56,13 +56,41 @@ enum pjmedia_jb_frame_type
because JB is bufferring. */
PJMEDIA_JB_ZERO_EMPTY_FRAME = 3 /**< Zero frame is being returned
because JB is empty. */
-};
+} pjmedia_jb_frame_type;
/**
- * @see pjmedia_jb_frame_type.
+ * Enumeration of jitter buffer discard algorithm. The jitter buffer
+ * continuously calculates the jitter level to get the optimum latency at
+ * any time and in order to adjust the latency, the jitter buffer may need
+ * to discard some frames.
*/
-typedef enum pjmedia_jb_frame_type pjmedia_jb_frame_type;
+typedef enum pjmedia_jb_discard_algo
+{
+ /**
+ * Jitter buffer should not discard any frame, except when the jitter
+ * buffer is full and a new frame arrives, one frame will be discarded
+ * to make space for the new frame.
+ */
+ PJMEDIA_JB_DISCARD_NONE = 0,
+
+ /**
+ * Only discard one frame in at least 200ms when the latency is considered
+ * much higher than it should be. When the jitter buffer is full and a new
+ * frame arrives, one frame will be discarded to make space for the new
+ * frame.
+ */
+ PJMEDIA_JB_DISCARD_STATIC,
+
+ /**
+ * The discard rate is dynamically calculated based on actual parameters
+ * such as jitter level and latency. When the jitter buffer is full and
+ * a new frame arrives, one frame will be discarded to make space for the
+ * new frame.
+ */
+ PJMEDIA_JB_DISCARD_PROGRESSIVE
+
+} pjmedia_jb_discard_algo;
/**
@@ -107,7 +135,9 @@ typedef struct pjmedia_jbuf pjmedia_jbuf;
/**
* Create an adaptive jitter buffer according to the specification. If
* application wants to have a fixed jitter buffer, it may call
- * #pjmedia_jbuf_set_fixed() after the jitter buffer is created.
+ * #pjmedia_jbuf_set_fixed() after the jitter buffer is created. Also
+ * if application wants to alter the discard algorithm, which the default
+ * PJMEDIA_JB_DISCARD_PROGRESSIVE, it may call #pjmedia_jbuf_set_discard().
*
* This function may allocate large chunk of memory to keep the frames in
* the buffer.
@@ -174,16 +204,16 @@ PJ_DECL(pj_status_t) pjmedia_jbuf_set_adaptive( pjmedia_jbuf *jb,
/**
- * Enable/disable the jitter buffer drift detection and handling mechanism.
- * The default behavior is enabled.
+ * Set the jitter buffer discard algorithm. The default discard algorithm,
+ * set in jitter buffer creation, is PJMEDIA_JB_DISCARD_PROGRESSIVE.
*
- * @param jb The jitter buffer
- * @param enable Set to PJ_TRUE to enable or PJ_FALSE to disable.
+ * @param jb The jitter buffer.
+ * @param algo The discard algorithm to be used.
*
* @return PJ_SUCCESS on success.
*/
-PJ_DECL(pj_status_t) pjmedia_jbuf_enable_discard(pjmedia_jbuf *jb,
- pj_bool_t enable);
+PJ_DECL(pj_status_t) pjmedia_jbuf_set_discard(pjmedia_jbuf *jb,
+ pjmedia_jb_discard_algo algo);
/**
diff --git a/pjmedia/include/pjmedia/session.h b/pjmedia/include/pjmedia/session.h
index efab853a..44238c56 100644
--- a/pjmedia/include/pjmedia/session.h
+++ b/pjmedia/include/pjmedia/session.h
@@ -232,6 +232,26 @@ PJ_DECL(pj_status_t) pjmedia_session_resume_stream(pjmedia_session *session,
pjmedia_dir dir);
/**
+ * Send RTCP SDES for the session.
+ *
+ * @param session The media session.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_session_send_rtcp_sdes( const pjmedia_session *session );
+
+/**
+ * Send RTCP BYE for the session.
+ *
+ * @param session The media session.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_session_send_rtcp_bye( const pjmedia_session *session );
+
+/**
* Enumerate media streams in the session.
*
* @param session The media session.
diff --git a/pjmedia/include/pjmedia/stream.h b/pjmedia/include/pjmedia/stream.h
index ea3a1b64..88e5a882 100644
--- a/pjmedia/include/pjmedia/stream.h
+++ b/pjmedia/include/pjmedia/stream.h
@@ -135,6 +135,9 @@ typedef struct pjmedia_stream_info
(see #PJMEDIA_STREAM_ENABLE_KA)
is enabled? */
#endif
+ pj_bool_t rtcp_sdes_bye_disabled;
+ /**< Disable automatic sending of RTCP
+ SDES and BYE. */
} pjmedia_stream_info;
@@ -404,6 +407,26 @@ pjmedia_stream_set_dtmf_callback(pjmedia_stream *stream,
/**
+ * Send RTCP SDES for the media stream.
+ *
+ * @param stream The media stream.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_stream_send_rtcp_sdes( pjmedia_stream *stream );
+
+/**
+ * Send RTCP BYE for the media stream.
+ *
+ * @param stream The media stream.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t)
+pjmedia_stream_send_rtcp_bye( pjmedia_stream *stream );
+
+/**
* @}
*/
diff --git a/pjmedia/include/pjmedia/transport_adapter_sample.h b/pjmedia/include/pjmedia/transport_adapter_sample.h
index 6c41a69d..62eb1c0f 100644
--- a/pjmedia/include/pjmedia/transport_adapter_sample.h
+++ b/pjmedia/include/pjmedia/transport_adapter_sample.h
@@ -49,15 +49,18 @@ PJ_BEGIN_DECL
* @param endpt The media endpoint.
* @param name Optional name to identify this media transport
* for logging purposes.
- * @param transport The underlying media transport to send and receive
- * RTP/RTCP packets.
+ * @param base_tp The base/underlying media transport to send and
+ * receive RTP/RTCP packets.
+ * @param del_base Specify whether the base transport should also be
+ * destroyed when destroy() is called upon us.
* @param p_tp Pointer to receive the media transport instance.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_tp_adapter_create( pjmedia_endpt *endpt,
const char *name,
- pjmedia_transport *transport,
+ pjmedia_transport *base_tp,
+ pj_bool_t del_base,
pjmedia_transport **p_tp);
PJ_END_DECL