www.pudn.com > vls-0.5.6.rar > output.sgml
The Output Module The Output Module takes the data 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 to see the position of Output between other parts of vls. The Module itself As other modules of vls, a core file server/output.* describes the definition of the output, and its behavior against others parts of vls. The modulesNetOutput andFileOutput differs from their implementation of the virtual functionWriteToPort() .The Output is created by the Channel Module. In modules/filechannel.cpp :m_pOutput = new C_FileOutput(strFilename, bAppend); and inmodules/netchannel.cpp :m_pOutput = new C_Net4Output(m_strName); The internal Fifo Internal Fifo for Output Since the output may have to gather packets, it needs a Fifo of TsPackets. Its name is m_cBuffer() . The capacity (ie the maximum size) of m_cBuffer() is specified in the Output constructor :C_Output::C_Output(unsigned int iBuffSize) : m_cTsBuff(iBuffSize) In the case of FileOutput, the vls can write the packet when he wants, to we don't care about the number of packets written. iBuffSize can be 1, or 7 if we want to store 7 TsPackets in an RTP packet when using RTP.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. Moreover, when using RTP output, 12 extra header bytes are added. But it's still ok since : 7 * 188 + 12 = 1328 < 1472. By default, the TS_IN_ETHER value defined in server/output.h is set to 7. You may change that depending on how your network hardware can handle big UDP packets.