?? ortp-rtpsession-api.html
字號:
><ANAME="AEN239"></A><H3><ANAME="RTP-SESSION-SET-LOCAL-ADDR"></A>rtp_session_set_local_addr ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">int rtp_session_set_local_addr (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, gchar *addr, gint port);</PRE></TD></TR></TABLE><P>Specify the local addr to be use to listen for rtp packets or to send rtp packet from.In case where the rtp session is send-only, then it is not required to call this function:when calling <AHREF="ortp-rtpsession-api.html#RTP-SESSION-SET-REMOTE-ADDR">rtp_session_set_remote_addr</A>(), if no local address has been set, then the default INADRR_ANY (0.0.0.0) IP address with a random port will be used. Calling rtp_sesession_set_local_addr() is mandatory when the session is send-only or duplex.</P><P></P><DIVCLASS="INFORMALTABLE"><ANAME="AEN250"><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>session</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a rtp session freshly created.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>addr</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a local IP address in the xxx.xxx.xxx.xxx form.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>port</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a local port.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">Returns</I></SPAN> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> 0 on success.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN271"></A><H3><ANAME="RTP-SESSION-SET-REMOTE-ADDR"></A>rtp_session_set_remote_addr ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">gint rtp_session_set_remote_addr (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, struct sockaddr_in *dest);</PRE></TD></TR></TABLE><P>Sets the remote address of the rtp session, ie the destination address where rtp packetare sent. If the session is recv-only or duplex, it sets also the origin of incoming RTP packets. Rtp packets that don't come from addr:port are discarded.</P><P></P><DIVCLASS="INFORMALTABLE"><ANAME="AEN280"><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>session</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a rtp session freshly created.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>dest</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> </TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">Returns</I></SPAN> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> 0 on success.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN297"></A><H3><ANAME="RTP-SESSION-SET-JITTER-COMPENSATION"></A>rtp_session_set_jitter_compensation ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void rtp_session_set_jitter_compensation (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, int milisec);</PRE></TD></TR></TABLE><P>Sets the time interval for which packet are buffered instead of being delivered to the application.</P><P></P><DIVCLASS="INFORMALTABLE"><ANAME="AEN304"><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>session</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a RtpSession</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>milisec</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> the time interval in milisec to be jitter compensed.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN317"></A><H3><ANAME="RTP-SESSION-SET-SSRC"></A>rtp_session_set_ssrc ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">void rtp_session_set_ssrc (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, guint32 ssrc);</PRE></TD></TR></TABLE><P>Sets the SSRC of the session.</P><P></P><DIVCLASS="INFORMALTABLE"><ANAME="AEN325"><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>session</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a rtp session.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>ssrc</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> an unsigned 32bit integer representing the synchronisation source identifier (SSRC).</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN338"></A><H3><ANAME="RTP-SESSION-SET-PAYLOAD-TYPE"></A>rtp_session_set_payload_type ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">int rtp_session_set_payload_type (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, int paytype);</PRE></TD></TR></TABLE><P>Sets the payload type of the rtp session. It decides of the payload types written in theof the rtp header for the outgoing stream, if the session is SENDRECV or SENDONLY.For the incoming stream, it sets the waited payload type. If that value does not matchat any time this waited value, then the application can be informed by registeringfor the "payload_type_changed" signal, so that it can make the necessary changeson the downstream decoder that deals with the payload of the packets.</P><P></P><DIVCLASS="INFORMALTABLE"><ANAME="AEN345"><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>session</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a rtp session</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>paytype</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> the payload type</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">Returns</I></SPAN> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> 0 on success, -1 if the payload is not defined.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN362"></A><H3><ANAME="RTP-SESSION-SIGNAL-CONNECT"></A>rtp_session_signal_connect ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">int rtp_session_signal_connect (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, char *signal, RtpCallback cb, gpointer user_data);</PRE></TD></TR></TABLE><P>This function provides the way for an application to be informed of various events thatmay occur during a rtp session. <TTCLASS="PARAMETER"><I>signal</I></TT> is a string identifying the event, and <TTCLASS="PARAMETER"><I>cb</I></TT> is a user supplied function in charge of processing it. The application can registerseveral callbacks for the same signal, in the limit of <AHREF="ortp-rtpsession-api.html#RTP-CALLBACK-TABLE-MAX-ENTRIES-CAPS">RTP_CALLBACK_TABLE_MAX_ENTRIES</A>.Here are name and meaning of supported signals types:</P><P>"ssrc_changed" : the SSRC of the incoming stream has changed.</P><P>"payload_type_changed" : the payload type of the incoming stream has changed.</P><P>"telephone-event_packet" : a telephone-event rtp packet (RFC1833) is received.</P><P>"telephone-event" : a telephone event has occured. This is a shortcut for "telephone-event_packet".</P><P></P><DIVCLASS="INFORMALTABLE"><ANAME="AEN378"><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>session</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a rtp session</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>signal</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> the name of a signal</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>cb</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a RtpCallback</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>user_data</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a pointer to any data to be passed when invoking the callback.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">Returns</I></SPAN> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> 0 on success, -EOPNOTSUPP if the signal does not exists, -1 if no more callbackscan be assigned to the signal type.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN404"></A><H3><ANAME="RTP-SESSION-SIGNAL-DISCONNECT-BY-CALLBACK"></A>rtp_session_signal_disconnect_by_callback ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">int rtp_session_signal_disconnect_by_callback (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, char *signal, RtpCallback cb);</PRE></TD></TR></TABLE><P>Removes callback function <TTCLASS="PARAMETER"><I>cb</I></TT> to the list of callbacks for signal <TTCLASS="PARAMETER"><I>signal</I></TT>.</P><P></P><DIVCLASS="INFORMALTABLE"><ANAME="AEN414"><P></P><TABLEBORDER="0"WIDTH="100%"BGCOLOR="#FFD0D0"CELLSPACING="0"CELLPADDING="4"CLASS="CALSTABLE"><TBODY><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>session</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a rtp session</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>signal</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a signal name</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><TTCLASS="PARAMETER"><I>cb</I></TT> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> a callback function.</TD></TR><TR><TDWIDTH="20%"ALIGN="RIGHT"VALIGN="TOP"><SPANCLASS="emphasis"><ICLASS="EMPHASIS">Returns</I></SPAN> :</TD><TDWIDTH="80%"ALIGN="LEFT"VALIGN="TOP"> 0 on success, -ENOENT if the callbacks was not found.</TD></TR></TBODY></TABLE><P></P></DIV></DIV><HR><DIVCLASS="REFSECT2"><ANAME="AEN435"></A><H3><ANAME="RTP-SESSION-SEND-WITH-TS"></A>rtp_session_send_with_ts ()</H3><TABLEBORDER="0"BGCOLOR="#D6E8FF"WIDTH="100%"CELLPADDING="6"><TR><TD><PRECLASS="PROGRAMLISTING">gint rtp_session_send_with_ts (<AHREF="ortp-rtpsession-api.html#RTPSESSION">RtpSession</A> *session, gchar *buffer, gint len, guint32 userts);</PRE></TD></TR></TABLE><P>Send a rtp datagram to the destination set by <AHREF="ortp-rtpsession-api.html#RTP-SESSION-SET-REMOTE-ADDR">rtp_session_set_remote_addr</A>() containingthe data from <TTCLASS="PARAMETER"><I>buffer</I
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -