本文整理汇总了C++中PacketReader::stream方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketReader::stream方法的具体用法?C++ PacketReader::stream怎么用?C++ PacketReader::stream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketReader
的用法示例。
在下文中一共展示了PacketReader::stream方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pushDataPacket
void Listener::pushDataPacket(const string& name,PacketReader& packet) {
// TODO create _dataWriter ??
if(_unbuffered) {
UInt16 offset = name.size()+9;
if(packet.position()>=offset) {
packet.reset(packet.position()-offset);
_writer.writeUnbufferedMessage(packet.current(),packet.available());
return;
}
WARN("Written unbuffered impossible, it requires %u head bytes available on PacketReader given",offset);
}
StreamCopier::copyStream(packet.stream(),_writer.writeAMFPacket(name).writer.stream());
}
示例2: write
void write(UInt32 time,PacketReader& data,bool unbuffered) {
// if(_type==0x08)
// time=0;
/* if(_type==0x09)
TRACE("Video timestamp : %u",_time)
else
TRACE("Audio timestamp : %u",_time);*/
if(unbuffered) {
if(data.position()>=5) {
data.reset(data.position()-5);
PacketWriter writer(data.current(),5);
writer.write8(_type);
writer.write32(time);
writeUnbufferedMessage(data.current(),data.available(),data.current(),5);
return;
}
WARN("Written unbuffered impossible, it requires 5 head bytes available on PacketReader given");
}
BinaryWriter& out = writeRawMessage(true);
out.write8(_type);
out.write32(time);
StreamCopier::copyStream(data.stream(),out.stream());
}