📄 output.sgml
字号:
<chapter><title>The Output Module</title><para>The Output Module takes thedata from the TsStreamer, gather the TS packets together and add RTP header when needed, and then writes the datas to a file of to the network.Refer to <xref linkend="l-arch" endterm="t-arch"> to see the position ofOutput between other parts of vls.</para><sect1><title>The Module itself</title><para>As other modules of vls, a core file<filename>server/output.*</filename> describes the definition of theoutput, and its behavior against others parts of vls. The modules<filename>NetOutput</filename> and <filename>FileOutput</filename>differs from their implementation of the virtual function<function>WriteToPort()</function>.</para><para>The Output is created by the Channel Module. In <filename>modules/filechannel.cpp</filename> :<programlisting> m_pOutput = new C_FileOutput(strFilename, bAppend);</programlisting>and in <filename>modules/netchannel.cpp</filename>:<programlisting> m_pOutput = new C_Net4Output(m_strName);</programlisting></para></sect1><sect1><title>The internal Fifo</title><para><mediaobject> <imageobject> <imagedata fileref="outputfifo.eps" format="EPS" scalefit="1" scale="30"> </imageobject> <imageobject> <imagedata fileref="outputfifo.jpg" format="JPG"> </imageobject> <textobject> <phrase>Internal Fifo for Output</phrase> </textobject></mediaobject></para><para>Since the output may have to gather packets, it needs a Fifo ofTsPackets. Its name is <function>m_cBuffer()</function>.The capacity (ie the maximum size) of m_cBuffer() is specified in the Output constructor :<programlisting>C_Output::C_Output(unsigned int iBuffSize) : m_cTsBuff(iBuffSize)</programlisting></para><para>In the case of FileOutput, the vls can write the packet when hewants, to we don't care about the number of packets written.<function>iBuffSize</function> can be 1, or 7 if we want to store 7TsPackets in an RTP packet when using RTP.</para> <para>In the case of NetOutput, this is more important since this will influence the size of each UDP packets.The maximum amount is 7. Indeed, the maximum payload size for an UDP packet is 1472 Bytes. Each TsPacket is 188 Bytes, and 1472/188 = 7.</para><para>Moreover, when using RTP output, 12 extra header bytes are added. But it's still ok since :<programlisting>7 * 188 + 12 = 1328 < 1472.</programlisting></para><para>By default, the TS_IN_ETHER value defined in<filename>server/output.h</filename> is set to 7. You may change thatdepending on how your network hardware can handle big UDP packets.</para></sect1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -