Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio and video stream refactoring #4300

Merged
merged 5 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions pjmedia/include/pjmedia/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@
#endif

/**
* Perform RTP payload type checking in the audio stream. Normally the peer
* Perform RTP payload type checking in the media stream. Normally the peer
* MUST send RTP with payload type as we specified in our SDP. Certain
* agents may not be able to follow this hence the only way to have
* communication is to disable this check.
Expand Down Expand Up @@ -1706,12 +1706,18 @@
* agents may not be able to follow this hence the only way to have
* communication is to disable this check.
*
* Default: PJMEDIA_STREAM_CHECK_RTP_PT (follow audio stream's setting)
* Note: Since media streams now share some common implementation,
* the setting MUST have the same value as PJMEDIA_STREAM_CHECK_RTP_PT.
*/
#ifndef PJMEDIA_VID_STREAM_CHECK_RTP_PT
# define PJMEDIA_VID_STREAM_CHECK_RTP_PT PJMEDIA_STREAM_CHECK_RTP_PT
#if defined(PJMEDIA_VID_STREAM_CHECK_RTP_PT) && \
PJMEDIA_VID_STREAM_CHECK_RTP_PT != PJMEDIA_STREAM_CHECK_RTP_PT
# pragma message("PJMEDIA_VID_STREAM_CHECK_RTP_PT must have the same " \
"value as PJMEDIA_STREAM_CHECK_RTP_PT...")
#endif

#undef PJMEDIA_VID_STREAM_CHECK_RTP_PT
#define PJMEDIA_VID_STREAM_CHECK_RTP_PT PJMEDIA_STREAM_CHECK_RTP_PT

/**
* @}
*/
Expand Down
67 changes: 4 additions & 63 deletions pjmedia/include/pjmedia/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,79 +78,20 @@ PJ_BEGIN_DECL
*/

/**
* Opaque declaration for media channel.
* Media channel is unidirectional flow of media from sender to
* receiver.
*/
typedef struct pjmedia_channel pjmedia_channel;

/**
* This structure describes media stream information. Each media stream
* This structure describes audio stream information. Each audio stream
* corresponds to one "m=" line in SDP session descriptor, and it has
* its own RTP/RTCP socket pair.
*/
typedef struct pjmedia_stream_info
{
pjmedia_type type; /**< Media type (audio, video) */
pjmedia_tp_proto proto; /**< Transport protocol (RTP/AVP, etc.) */
pjmedia_dir dir; /**< Media direction. */
pj_sockaddr local_addr; /**< Local RTP address */
pj_sockaddr rem_addr; /**< Remote RTP address */
pj_sockaddr rem_rtcp; /**< Optional remote RTCP address. If
sin_family is zero, the RTP address
will be calculated from RTP. */
pj_bool_t rtcp_mux; /**< Use RTP and RTCP multiplexing. */
#if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0)
pj_bool_t rtcp_xr_enabled;
/**< Specify whether RTCP XR is enabled.*/
pj_uint32_t rtcp_xr_interval; /**< RTCP XR interval. */
pj_sockaddr rtcp_xr_dest;/**<Additional remote RTCP XR address.
This is useful for third-party (e.g:
network monitor) to monitor the
stream. If sin_family is zero,
this will be ignored. */
#endif
pjmedia_rtcp_fb_info loc_rtcp_fb; /**< Local RTCP-FB info. */
pjmedia_rtcp_fb_info rem_rtcp_fb; /**< Remote RTCP-FB info. */
PJ_DECL_STREAM_INFO_COMMON_MEMBER()

pjmedia_codec_info fmt; /**< Incoming codec format info. */
pjmedia_codec_param *param; /**< Optional codec param. */
unsigned tx_pt; /**< Outgoing codec paylaod type. */
unsigned rx_pt; /**< Incoming codec paylaod type. */

unsigned tx_maxptime;/**< Outgoing codec max ptime. */
int tx_event_pt;/**< Outgoing pt for telephone-events. */
int rx_event_pt;/**< Incoming pt for telephone-events. */
pj_uint32_t ssrc; /**< RTP SSRC. */
pj_str_t cname; /**< RTCP CNAME. */
pj_bool_t has_rem_ssrc;/**<Has remote RTP SSRC? */
pj_uint32_t rem_ssrc; /**< Remote RTP SSRC. */
pj_str_t rem_cname; /**< Remote RTCP CNAME. */
pj_uint32_t rtp_ts; /**< Initial RTP timestamp. */
pj_uint16_t rtp_seq; /**< Initial RTP sequence number. */
pj_uint8_t rtp_seq_ts_set;
/**< Bitmask flags if initial RTP sequence
and/or timestamp for sender are set.
bit 0/LSB : sequence flag
bit 1 : timestamp flag */
int jb_init; /**< Jitter buffer init delay in msec.
(-1 for default). */
int jb_min_pre; /**< Jitter buffer minimum prefetch
delay in msec (-1 for default). */
int jb_max_pre; /**< Jitter buffer maximum prefetch
delay in msec (-1 for default). */
int jb_max; /**< Jitter buffer max delay in msec. */
pjmedia_jb_discard_algo jb_discard_algo;
/**< Jitter buffer discard algorithm. */

#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0
pj_bool_t use_ka; /**< Stream keep-alive and NAT hole punch
(see #PJMEDIA_STREAM_ENABLE_KA)
is enabled? */
pjmedia_stream_ka_config ka_cfg;
/**< Stream send kep-alive settings. */
#endif
pj_bool_t rtcp_sdes_bye_disabled;
/**< Disable automatic sending of RTCP
SDES and BYE. */
} pjmedia_stream_info;

/**
Expand Down
Loading
Loading