示例#1
0
void StatusWriter::removePublication(const Publication& publication) {
	if(idPublisherWithListeners==publication.publisherId())
		idPublisherWithListeners=0;
	_publications.erase(publication.publisherId());
	AMFWriter& writer = writeAMFMessage("status");
	writer.beginObject();
		writer.writeObjectProperty("type","rem");
		writer.beginSubObject("publication");
			writer.writeObjectProperty("id",publication.publisherId());
		writer.endObject();
	writer.endObject();
	flush(true);
}
示例#2
0
void StatusWriter::writePublicationContent(const Publication& publication,AMFWriter& writer) {
	writer.writeObjectProperty("id",publication.publisherId());
	writer.writeObjectProperty("name",publication.name());
	writer.writeObjectProperty("listeners",publication.listeners.count());
	writer.writeObjectProperty("vLost",publication.videoQOS().lostRate);
	writer.writeObjectProperty("aLost",publication.audioQOS().lostRate);
	writer.writeObjectProperty("vLatency",publication.videoQOS().latency);
	writer.writeObjectProperty("aLatency",publication.audioQOS().latency);
	writer.writeObjectProperty("df",publication.videoQOS().droppedFrames);
}
示例#3
0
void StatusWriter::addPublication(const Publication& publication) {
	_publications.insert(pair<UInt32,const Publication* const>(publication.publisherId(),&publication));
	AMFWriter& writer = writeAMFMessage("status");
	writer.beginObject();
		writer.writeObjectProperty("type","add");
		writer.beginSubObject("publication");
			writePublicationContent(publication,writer);
		writer.endObject();
	writer.endObject();
	flush(true);
}
示例#4
0
void StatusWriter::videoLostRate(const Publication& publication) {
	AMFWriter& writer = writeAMFMessage("status");
	writer.beginObject();
		writer.writeObjectProperty("type","vQOS");
		writer.beginSubObject("publication");
			writer.writeObjectProperty("id",publication.publisherId());
			writer.writeObjectProperty("vLost",publication.videoQOS().lostRate);
			writer.writeObjectProperty("vLatency",publication.videoQOS().latency);
		writer.endObject();
	writer.endObject();
	flush(true);
}