?? mssync.sgml
字號:
<refentry id="mediastreamer-MSSync"><refmeta><refentrytitle>MSSync</refentrytitle><manvolnum>3</manvolnum><refmiscinfo>MEDIASTREAMER Library</refmiscinfo></refmeta><refnamediv><refname>MSSync</refname><refpurpose>The base object for implementing synchronization.</refpurpose></refnamediv><refsynopsisdiv><title>Synopsis</title><synopsis>#include <mssync.h> <link linkend="MSSync">MSSync</link>;<link linkend="int">int</link> <link linkend="ms-sync-attach">ms_sync_attach</link> (<link linkend="MSSync">MSSync</link> *sync, <link linkend="MSFilter">MSFilter</link> *f);<link linkend="int">int</link> <link linkend="ms-sync-detach">ms_sync_detach</link> (<link linkend="MSSync">MSSync</link> *sync, <link linkend="MSFilter">MSFilter</link> *f);</synopsis></refsynopsisdiv><refsect1><title>Description</title><para>A mediastreamer thread executes the <link linkend="synchronize"><function>synchronize()</function></link> function of the MSSync object, then all the processing functions of the chain of filters attached to the synchronisation.A synchronize function may do nothing, can wait for a timer, or can select for some file descriptors to change, etc... The developper is free toimplement derivated objects of MSSync in order to satisfy its needs.</para></refsect1><refsect1><title>Details</title><refsect2><title><anchor id="MSSync">MSSync</title><indexterm><primary>MSSync</primary></indexterm><programlisting>typedef struct { struct _MSSyncClass *klass; GMutex *lock; MSFilter **attached_filters; /* pointer to a table of pointer of filters*/ GList *execution_list; /* the list of filters to be executed. This is filled with compilation */ gint filters; /*number of filters attached to the sync */ gint run; /* flag to indicate whether the sync must be run or not */ GThread * thread; /* the thread ressource if this sync is run by a thread*/ GCond *thread_cond; GCond *stop_cond; guint32 flags; gint interval; /* in miliseconds*/#define MS_SYNC_NEED_UPDATE (0x0001) /* a modification has occured in the processing chains attached to this sync; so the execution list has to be updated */ guint samples_per_tick; /* number of bytes produced by sources of the processing chains*/ guint32 ticks; guint32 time; /* a time since the start of the sync expressed in milisec*/} MSSync;</programlisting><para>Only programmers creating new derivated objects of <link linkend="MSSync"><type>MSSync</type></link> are interested in this object.</para></refsect2><refsect2><title><anchor id="ms-sync-attach">ms_sync_attach ()</title><indexterm><primary>ms_sync_attach</primary></indexterm><programlisting><link linkend="int">int</link> ms_sync_attach (<link linkend="MSSync">MSSync</link> *sync, <link linkend="MSFilter">MSFilter</link> *f);</programlisting><para>Attach a chain of filters to a synchronisation source <parameter>sync</parameter>. Filter <parameter>f</parameter> must be the first filter of the processing chain. In order to be run, each chain of filter must be attached to a synchronisation source, that will be responsible for scheduling the processing. Multiple chains can be attached to a single synchronisation.</para><para></para><variablelist role="params"><varlistentry><term><parameter>sync</parameter> :</term><listitem><simpara> A <link linkend="MSSync"><type>MSSync</type></link> object.</simpara></listitem></varlistentry><varlistentry><term><parameter>f</parameter> :</term><listitem><simpara> A <link linkend="MSFilter"><type>MSFilter</type></link> object.</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> 0 if successfull, a negative value reprensenting the errno.h error.</simpara></listitem></varlistentry></variablelist></refsect2><refsect2><title><anchor id="ms-sync-detach">ms_sync_detach ()</title><indexterm><primary>ms_sync_detach</primary></indexterm><programlisting><link linkend="int">int</link> ms_sync_detach (<link linkend="MSSync">MSSync</link> *sync, <link linkend="MSFilter">MSFilter</link> *f);</programlisting><para>Dettach a chain of filters to a synchronisation source. Filter <parameter>f</parameter> must be the first filter of the processing chain.The processing chain will no more be executed.</para><para></para><variablelist role="params"><varlistentry><term><parameter>sync</parameter> :</term><listitem><simpara> A <link linkend="MSSync"><type>MSSync</type></link> object.</simpara></listitem></varlistentry><varlistentry><term><parameter>f</parameter> :</term><listitem><simpara> A <link linkend="MSFilter"><type>MSFilter</type></link> object.</simpara></listitem></varlistentry><varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> 0 if successfull, a negative value reprensenting the errno.h error.</simpara></listitem></varlistentry></variablelist></refsect2></refsect1></refentry>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -