use of org.red5.server.stream.message.RTMPMessage in project bigbluebutton by bigbluebutton.
the class ScreenVideoBroadcastStream method dispatchEvent.
public void dispatchEvent(IEvent event) {
try {
// System.out.println("dispatchEvent(event:screenVideo)");
if (event instanceof IRTMPEvent) {
IRTMPEvent rtmpEvent = (IRTMPEvent) event;
if (livePipe != null) {
RTMPMessage msg = RTMPMessage.build(rtmpEvent, Constants.SOURCE_TYPE_LIVE);
if (creationTime == null)
creationTime = (long) rtmpEvent.getTimestamp();
try {
IVideoStreamCodec videoStreamCodec = new ScreenVideo();
streamCodecInfo.setHasVideo(true);
streamCodecInfo.setVideoCodec(videoStreamCodec);
videoStreamCodec.reset();
videoStreamCodec.addData(((VideoData) rtmpEvent).getData());
livePipe.pushMessage(msg);
// Notify listeners about received packet
if (rtmpEvent instanceof IStreamPacket) {
for (IStreamListener listener : getStreamListeners()) {
try {
listener.packetReceived(this, (IStreamPacket) rtmpEvent);
} catch (Exception e) {
log.error("Error while notifying listener " + listener, e);
}
}
}
} catch (IOException ex) {
// ignore
log.error("Got exception: {}", ex);
}
}
}
} finally {
}
}
use of org.red5.server.stream.message.RTMPMessage in project openmeetings by apache.
the class CaptureScreen method pushVideo.
public void pushVideo(VideoData data, int ts) {
if (startPublish) {
if (Red5.getConnectionLocal() == null) {
Red5.setConnectionLocal(client.getConnection());
}
RTMPMessage rtmpMsg = RTMPMessage.build(data, ts);
client.publishStreamData(streamId, rtmpMsg);
}
}
Aggregations