diff options
Diffstat (limited to 'pjmedia/include/pjmedia/stream.h')
-rw-r--r-- | pjmedia/include/pjmedia/stream.h | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/pjmedia/include/pjmedia/stream.h b/pjmedia/include/pjmedia/stream.h index 9e1976e9..aa8fa0bd 100644 --- a/pjmedia/include/pjmedia/stream.h +++ b/pjmedia/include/pjmedia/stream.h @@ -32,6 +32,7 @@ #include <pjmedia/port.h> #include <pjmedia/rtcp.h> #include <pjmedia/transport.h> +#include <pjmedia/vid_codec.h> #include <pj/sock.h> PJ_BEGIN_DECL @@ -87,7 +88,7 @@ typedef struct pjmedia_channel pjmedia_channel; * corresponds to one "m=" line in SDP session descriptor, and it has * its own RTP/RTCP socket pair. */ -struct pjmedia_stream_info +typedef struct pjmedia_stream_info { pjmedia_type type; /**< Media type (audio, video) */ pjmedia_tp_proto proto; /**< Transport protocol (RTP/AVP, etc.) */ @@ -133,14 +134,32 @@ struct pjmedia_stream_info (see #PJMEDIA_STREAM_ENABLE_KA) is enabled? */ #endif -}; +} pjmedia_stream_info; /** - * @see pjmedia_stream_info. + * This function will initialize the stream info based on information + * in both SDP session descriptors for the specified stream index. + * The remaining information will be taken from default codec parameters. + * If socket info array is specified, the socket will be copied to the + * session info as well. + * + * @param si Stream info structure to be initialized. + * @param pool Pool to allocate memory. + * @param endpt PJMEDIA endpoint instance. + * @param local Local SDP session descriptor. + * @param remote Remote SDP session descriptor. + * @param stream_idx Media stream index in the session descriptor. + * + * @return PJ_SUCCESS if stream info is successfully initialized. */ -typedef struct pjmedia_stream_info pjmedia_stream_info; - +PJ_DECL(pj_status_t) +pjmedia_stream_info_from_sdp( pjmedia_stream_info *si, + pj_pool_t *pool, + pjmedia_endpt *endpt, + const pjmedia_sdp_session *local, + const pjmedia_sdp_session *remote, + unsigned stream_idx); /** @@ -231,6 +250,17 @@ PJ_DECL(pj_status_t) pjmedia_stream_start(pjmedia_stream *stream); /** + * Get the stream info. + * + * @param stream The media stream. + * @param info Stream info. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_stream_get_info( const pjmedia_stream *stream, + pjmedia_stream_info *info); + +/** * Get the stream statistics. See also * #pjmedia_stream_get_stat_jbuf() * @@ -371,6 +401,7 @@ pjmedia_stream_set_dtmf_callback(pjmedia_stream *stream, int digit), void *user_data); + /** * @} */ |