org.red5.server.messaging.IMessageComponent Java Examples

The following examples show how to use org.red5.server.messaging.IMessageComponent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConnectionConsumer.java    From red5-server-common with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) {
    if ("ConnectionConsumer".equals(oobCtrlMsg.getTarget())) {
        String serviceName = oobCtrlMsg.getServiceName();
        log.trace("Service name: {}", serviceName);
        if ("pendingCount".equals(serviceName)) {
            oobCtrlMsg.setResult(conn.getPendingMessages());
        } else if ("pendingVideoCount".equals(serviceName)) {
            IClientStream stream = conn.getStreamByChannelId(video.getId());
            if (stream != null) {
                oobCtrlMsg.setResult(conn.getPendingVideoMessages(stream.getStreamId()));
            } else {
                oobCtrlMsg.setResult(0L);
            }
        } else if ("writeDelta".equals(serviceName)) {
            //TODO: Revisit the max stream value later
            long maxStream = 120 * 1024;
            // Return the current delta between sent bytes and bytes the client
            // reported to have received, and the interval the client should use
            // for generating BytesRead messages (half of the allowed bandwidth).
            oobCtrlMsg.setResult(new Long[] { conn.getWrittenBytes() - conn.getClientBytesRead(), maxStream / 2 });
        } else if ("chunkSize".equals(serviceName)) {
            int newSize = (Integer) oobCtrlMsg.getServiceParamMap().get("chunkSize");
            if (newSize != chunkSize) {
                chunkSize = newSize;
                chunkSizeSent.set(false);
                sendChunkSize();
            }
        }
    }
}
 
Example #2
Source File: ClientBroadcastStream.java    From red5-server-common with Apache License 2.0 5 votes vote down vote up
/**
 * Out-of-band control message handler
 *
 * @param source
 *            OOB message source
 * @param pipe
 *            Pipe that used to send OOB message
 * @param oobCtrlMsg
 *            Out-of-band control message
 */
public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) {
    String target = oobCtrlMsg.getTarget();
    if ("ClientBroadcastStream".equals(target)) {
        String serviceName = oobCtrlMsg.getServiceName();
        if ("chunkSize".equals(serviceName)) {
            chunkSize = (Integer) oobCtrlMsg.getServiceParamMap().get("chunkSize");
            notifyChunkSize();
        } else {
            log.debug("Unhandled OOB control message for service: {}", serviceName);
        }
    } else {
        log.debug("Unhandled OOB control message to target: {}", target);
    }
}
 
Example #3
Source File: PlayEngine.java    From red5-server-common with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) {
    if ("ConnectionConsumer".equals(oobCtrlMsg.getTarget())) {
        if (source instanceof IProvider) {
            IMessageOutput out = msgOutReference.get();
            if (out != null) {
                out.sendOOBControlMessage((IProvider) source, oobCtrlMsg);
            } else {
                // this may occur when a client attempts to play and then disconnects
                log.warn("Output is not available, message cannot be sent");
                close();
            }
        }
    }
}
 
Example #4
Source File: StreamingProxy.java    From red5-client with Apache License 2.0 4 votes vote down vote up
@Override
public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) {
    log.debug("onOOBControlMessage: {}", oobCtrlMsg);
}
 
Example #5
Source File: SlicedFileConsumer.java    From red5-server-common with Apache License 2.0 2 votes vote down vote up
/**
 * Out-of-band control message handler
 * 
 * @param source
 *            Source of message
 * @param pipe
 *            Pipe that is used to transmit OOB message
 * @param oobCtrlMsg
 *            OOB control message
 */
public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) {
}
 
Example #6
Source File: FileConsumer.java    From red5-server-common with Apache License 2.0 2 votes vote down vote up
/**
 * Out-of-band control message handler
 *
 * @param source
 *            Source of message
 * @param pipe
 *            Pipe that is used to transmit OOB message
 * @param oobCtrlMsg
 *            OOB control message
 */
public void onOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) {
}
 
Example #7
Source File: ICYStream.java    From red5-rtsp-restreamer with Apache License 2.0 2 votes vote down vote up
@Override
public void onOOBControlMessage(IMessageComponent arg0, IPipe arg1, OOBControlMessage arg2) {

}