示例#1
0
文件: Rtmp.py 项目: slyseal/slyseal
    def makeHeader(self, header):
        output = BytesOutput(True)

        header_size = 1
        if header[4] is not None:
            header_size = 12
        elif header[3] is not None:
            header_size = 8
        elif header[1] is not None:
            header_size = 4

        output.writeByte(header[0] | (headerSizeToByte(header_size) << 6))

        if header_size >= 4:
            output.writeUInt24(header[1])
        if header_size >= 8:
            output.writeUInt24(header[2])
            output.writeByte(header[3])
        if (header_size >= 12):
            output.setEndianess(False)
            output.writeUInt(header[4])
            output.setEndianess(True)

        return output.getBytes()
示例#2
0
文件: Rtmp.py 项目: slyseal/slyseal
	def makeHeader(self, header):
		output = BytesOutput(True)
		
		header_size = 1
		if header[4] is not None:
			header_size = 12
		elif header[3] is not None:
			header_size = 8
		elif header[1] is not None:
			header_size = 4
			
		output.writeByte(header[0] | (headerSizeToByte(header_size) << 6))
		
		if header_size >= 4:
			output.writeUInt24(header[1])
		if header_size >= 8:
			output.writeUInt24(header[2])
			output.writeByte(header[3])
		if (header_size >= 12):
			output.setEndianess(False)
			output.writeUInt(header[4])
			output.setEndianess(True)
		
		return output.getBytes()