~ubuntu-branches/ubuntu/quantal/linphone/quantal

« back to all changes in this revision

Viewing changes to oRTP/docs/sgml/multiplexing.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Mimram
  • Date: 2006-11-15 10:34:50 UTC
  • mfrom: (1.2.1 upstream) (2.1.8 feisty)
  • Revision ID: james.westby@ubuntu.com-20061115103450-qgafwcks2lkhctlj
* New upstream release.
* Enable video support.
* Fix mismatched #endif in mscommon.h, closes: #398307.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<refentry id="ortp-Multiplexing-sessions-(in-a-one-thread-design)">
 
1
<refentry id="ortp-Multiplexing-sessions---in-a-one-thread-design">
2
2
<refmeta>
3
 
<refentrytitle>Multiplexing sessions (in a one thread design)</refentrytitle>
 
3
<refentrytitle id="top_of_page">Multiplexing sessions (in a one thread design)</refentrytitle>
4
4
<manvolnum>3</manvolnum>
5
5
<refmiscinfo>ORTP Library</refmiscinfo>
6
6
</refmeta>
7
7
 
8
8
<refnamediv>
9
 
<refname>Multiplexing sessions (in a one thread design)</refname><refpurpose>The SessionSet API allows applications to make I/O on mutilple rtp sessions
 
9
<refname>Multiplexing sessions (in a one thread design)</refname>
 
10
<refpurpose>The SessionSet API allows applications to make I/O on mutilple rtp sessions
10
11
without making blocking I/O, but keeping the main process synchronised.</refpurpose>
 
12
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
11
13
</refnamediv>
12
14
 
13
 
<refsynopsisdiv><title>Synopsis</title>
 
15
<refsynopsisdiv id="synopsis">
 
16
<title id="synopsis.title">Synopsis</title>
14
17
 
15
18
<synopsis>
16
19
 
17
20
#include &lt;ortp.h&gt;
18
21
 
19
22
 
20
 
struct      <link linkend="SessionSet">SessionSet</link>;
 
23
            <link linkend="SessionSet">SessionSet</link>;
21
24
<link linkend="SessionSet">SessionSet</link>* <link linkend="session-set-new">session_set_new</link>                 ();
22
25
#define     <link linkend="session-set-init">session_set_init</link>                (ss)
23
26
#define     <link linkend="session-set-set">session_set_set</link>                 (ss,rtpsession)
24
27
#define     <link linkend="session-set-is-set">session_set_is_set</link>              (ss,rtpsession)
25
28
#define     <link linkend="session-set-clr">session_set_clr</link>                 (ss,rtpsession)
26
 
int         <link linkend="session-set-select">session_set_select</link>              (<link linkend="SessionSet">SessionSet</link> *recvs,
 
29
<link linkend="int">int</link>         <link linkend="session-set-select">session_set_select</link>              (<link linkend="SessionSet">SessionSet</link> *recvs,
27
30
                                             <link linkend="SessionSet">SessionSet</link> *sends,
28
31
                                             <link linkend="SessionSet">SessionSet</link> *errors);
29
 
void        <link linkend="session-set-destroy">session_set_destroy</link>             (<link linkend="SessionSet">SessionSet</link> *set);
 
32
<link linkend="void">void</link>        <link linkend="session-set-destroy">session_set_destroy</link>             (<link linkend="SessionSet">SessionSet</link> *set);
30
33
</synopsis>
31
34
</refsynopsisdiv>
32
35
 
36
39
 
37
40
 
38
41
 
39
 
<refsect1>
40
 
<title>Description</title>
 
42
 
 
43
 
 
44
<refsect1 id="desc">
 
45
<title id="desc.title">Description</title>
41
46
<para>
42
47
The scheduled mode must be enabled for all rtp session that are managed through the 
43
 
SessionSet API. See <link linkend="rtp-session-set-scheduling-mode">rtp_session_set_scheduling_mode</link>().
 
48
SessionSet API. See <link linkend="rtp-session-set-scheduling-mode"><function>rtp_session_set_scheduling_mode()</function></link>.
44
49
</para>
45
50
</refsect1>
46
51
 
47
 
<refsect1>
48
 
<title>Details</title>
 
52
<refsect1 id="details">
 
53
<title id="details.title">Details</title>
49
54
<refsect2>
50
 
<title><anchor id="SessionSet">struct SessionSet</title>
51
 
<programlisting>struct SessionSet {
52
 
 
 
55
<title><anchor id="SessionSet" role="struct">SessionSet</title>
 
56
<indexterm><primary>SessionSet</primary></indexterm><programlisting>typedef struct {
53
57
        ortp_fd_set rtpset;
54
 
};
 
58
} SessionSet;
55
59
</programlisting>
56
60
<para>
57
61
 
58
62
</para></refsect2>
59
63
<refsect2>
60
 
<title><anchor id="session-set-new">session_set_new ()</title>
61
 
<programlisting><link linkend="SessionSet">SessionSet</link>* session_set_new                 ();</programlisting>
 
64
<title><anchor id="session-set-new" role="function">session_set_new ()</title>
 
65
<indexterm><primary>session_set_new</primary></indexterm><programlisting><link linkend="SessionSet">SessionSet</link>* session_set_new                 ();</programlisting>
62
66
<para>
63
67
Allocates and initialize a new empty session set.</para>
64
68
<para>
65
69
 
66
70
</para><variablelist role="params">
67
 
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the session set.
 
71
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the session set.
68
72
</simpara></listitem></varlistentry>
69
73
</variablelist></refsect2>
70
74
<refsect2>
71
 
<title><anchor id="session-set-init">session_set_init()</title>
72
 
<programlisting>#define session_set_init(ss)            ORTP_FD_ZERO(&amp;(ss)-&gt;rtpset)
 
75
<title><anchor id="session-set-init" role="macro">session_set_init()</title>
 
76
<indexterm><primary>session_set_init</primary></indexterm><programlisting>#define session_set_init(ss)          ORTP_FD_ZERO(&amp;(ss)-&gt;rtpset)
73
77
</programlisting>
74
78
<para>
75
79
Initializes a session set. It is unusefull to call this function on a session set object
76
 
returned by <link linkend="session-set-new">session_set_new</link>().</para>
 
80
returned by <link linkend="session-set-new"><function>session_set_new()</function></link>.</para>
77
81
<para>
78
82
 
79
83
</para><variablelist role="params">
82
86
</simpara></listitem></varlistentry>
83
87
</variablelist></refsect2>
84
88
<refsect2>
85
 
<title><anchor id="session-set-set">session_set_set()</title>
86
 
<programlisting>#define session_set_set(ss,rtpsession)          ORTP_FD_SET((rtpsession)-&gt;mask_pos,&amp;(ss)-&gt;rtpset)
 
89
<title><anchor id="session-set-set" role="macro">session_set_set()</title>
 
90
<indexterm><primary>session_set_set</primary></indexterm><programlisting>#define session_set_set(ss,rtpsession)         ORTP_FD_SET((rtpsession)-&gt;mask_pos,&amp;(ss)-&gt;rtpset)
87
91
</programlisting>
88
92
<para>
89
93
This macro adds rtp session <parameter>_session</parameter> to set <parameter>_set</parameter>.</para>
91
95
 
92
96
</para><variablelist role="params">
93
97
<varlistentry><term><parameter>ss</parameter>&nbsp;:</term>
94
 
<listitem><simpara>             a set (<link linkend="SessionSet">SessionSet</link> object)
 
98
<listitem><simpara>             a set (<link linkend="SessionSet"><type>SessionSet</type></link> object)
95
99
</simpara></listitem></varlistentry>
96
100
<varlistentry><term><parameter>rtpsession</parameter>&nbsp;:</term>
97
101
<listitem><simpara>     a rtp session
98
102
</simpara></listitem></varlistentry>
99
103
</variablelist></refsect2>
100
104
<refsect2>
101
 
<title><anchor id="session-set-is-set">session_set_is_set()</title>
102
 
<programlisting>#define session_set_is_set(ss,rtpsession)       ORTP_FD_ISSET((rtpsession)-&gt;mask_pos,&amp;(ss)-&gt;rtpset)
 
105
<title><anchor id="session-set-is-set" role="macro">session_set_is_set()</title>
 
106
<indexterm><primary>session_set_is_set</primary></indexterm><programlisting>#define session_set_is_set(ss,rtpsession)   ORTP_FD_ISSET((rtpsession)-&gt;mask_pos,&amp;(ss)-&gt;rtpset)
103
107
</programlisting>
104
108
<para>
105
109
This macro tests if <parameter>_session</parameter> is part of <parameter>_set</parameter>. 1 is returned if true, 0 else.</para>
107
111
 
108
112
</para><variablelist role="params">
109
113
<varlistentry><term><parameter>ss</parameter>&nbsp;:</term>
110
 
<listitem><simpara>             a set (<link linkend="SessionSet">SessionSet</link> object)
 
114
<listitem><simpara>             a set (<link linkend="SessionSet"><type>SessionSet</type></link> object)
111
115
</simpara></listitem></varlistentry>
112
116
<varlistentry><term><parameter>rtpsession</parameter>&nbsp;:</term>
113
117
<listitem><simpara>     a rtp session
114
118
</simpara></listitem></varlistentry>
115
119
</variablelist></refsect2>
116
120
<refsect2>
117
 
<title><anchor id="session-set-clr">session_set_clr()</title>
118
 
<programlisting>#define session_set_clr(ss,rtpsession)          ORTP_FD_CLR((rtpsession)-&gt;mask_pos,&amp;(ss)-&gt;rtpset)
 
121
<title><anchor id="session-set-clr" role="macro">session_set_clr()</title>
 
122
<indexterm><primary>session_set_clr</primary></indexterm><programlisting>#define session_set_clr(ss,rtpsession)         ORTP_FD_CLR((rtpsession)-&gt;mask_pos,&amp;(ss)-&gt;rtpset)
119
123
</programlisting>
120
124
<para>
121
125
Removes the <parameter>_session</parameter> from the _set.</para>
130
134
</simpara></listitem></varlistentry>
131
135
</variablelist></refsect2>
132
136
<refsect2>
133
 
<title><anchor id="session-set-select">session_set_select ()</title>
134
 
<programlisting>int         session_set_select              (<link linkend="SessionSet">SessionSet</link> *recvs,
 
137
<title><anchor id="session-set-select" role="function">session_set_select ()</title>
 
138
<indexterm><primary>session_set_select</primary></indexterm><programlisting><link linkend="int">int</link>         session_set_select              (<link linkend="SessionSet">SessionSet</link> *recvs,
135
139
                                             <link linkend="SessionSet">SessionSet</link> *sends,
136
140
                                             <link linkend="SessionSet">SessionSet</link> *errors);</programlisting>
137
141
<para>
138
 
This function performs similarly as libc <link linkend="select">select</link>() function, but performs on <link linkend="RtpSession">RtpSession</link> 
 
142
This function performs similarly as libc <link linkend="select"><function>select()</function></link> function, but performs on <link linkend="RtpSession"><type>RtpSession</type></link> 
139
143
instead of file descriptors.
140
 
<link linkend="session-set-select">session_set_select</link>() suspends the calling process until some events arrive on one of the
 
144
<link linkend="session-set-select"><function>session_set_select()</function></link> suspends the calling process until some events arrive on one of the
141
145
three sets passed in argument. Two of the sets can be NULL.
142
146
The first set <parameter>recvs</parameter> is interpreted as a set of RtpSession waiting for receive events:
143
147
a new buffer (perhaps empty) is availlable on one or more sessions of the set, or the last
144
 
receive operation with <link linkend="rtp-session-recv-with-ts">rtp_session_recv_with_ts</link>() would have finished if it were in 
 
148
receive operation with <link linkend="rtp-session-recv-with-ts"><function>rtp_session_recv_with_ts()</function></link> would have finished if it were in 
145
149
blocking mode.
146
150
The second set is interpreted as a set of RtpSession waiting for send events, i.e. the last
147
 
<link linkend="rtp-session-send-with-ts">rtp_session_send_with_ts</link>() call on a session would have finished if it were in blocking mode.
 
151
<link linkend="rtp-session-send-with-ts"><function>rtp_session_send_with_ts()</function></link> call on a session would have finished if it were in blocking mode.
148
152
</para>
149
153
<para>
150
154
When some events arrived on some of sets, then the function returns and sets are changed
151
155
to indicate the sessions where events happened.
152
 
Sessions can be added to sets using <link linkend="session-set-set">session_set_set</link>(), a session has to be tested to be 
153
 
part of a set using <link linkend="session-set-is-set">session_set_is_set</link>().</para>
 
156
Sessions can be added to sets using <link linkend="session-set-set"><function>session_set_set()</function></link>, a session has to be tested to be 
 
157
part of a set using <link linkend="session-set-is-set"><function>session_set_is_set()</function></link>.</para>
154
158
<para>
155
159
 
156
160
</para><variablelist role="params">
163
167
<varlistentry><term><parameter>errors</parameter>&nbsp;:</term>
164
168
<listitem><simpara>             a set of rtp sessions to be watched for errors
165
169
</simpara></listitem></varlistentry>
166
 
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the number of sessions on which the selected events happened.
 
170
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara> the number of sessions on which the selected events happened.
167
171
</simpara></listitem></varlistentry>
168
172
</variablelist></refsect2>
169
173
<refsect2>
170
 
<title><anchor id="session-set-destroy">session_set_destroy ()</title>
171
 
<programlisting>void        session_set_destroy             (<link linkend="SessionSet">SessionSet</link> *set);</programlisting>
 
174
<title><anchor id="session-set-destroy" role="function">session_set_destroy ()</title>
 
175
<indexterm><primary>session_set_destroy</primary></indexterm><programlisting><link linkend="void">void</link>        session_set_destroy             (<link linkend="SessionSet">SessionSet</link> *set);</programlisting>
172
176
<para>
173
177
</para>
174
178
<para>