Java Code Examples for org.red5.server.messaging.PipeConnectionEvent#getProvider()
The following examples show how to use
org.red5.server.messaging.PipeConnectionEvent#getProvider() .
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: PlayEngine.java From red5-server-common with Apache License 2.0 | 5 votes |
/** {@inheritDoc} */ public void onPipeConnectionEvent(PipeConnectionEvent event) { switch (event.getType()) { case PROVIDER_CONNECT_PUSH: if (event.getProvider() != this) { if (waitLiveJob != null) { schedulingService.removeScheduledJob(waitLiveJob); waitLiveJob = null; } sendPublishedStatus(currentItem.get()); } break; case PROVIDER_DISCONNECT: if (pullMode) { sendStopStatus(currentItem.get()); } else { sendUnpublishedStatus(currentItem.get()); } break; case CONSUMER_CONNECT_PULL: if (event.getConsumer() == this) { pullMode = true; } break; case CONSUMER_CONNECT_PUSH: if (event.getConsumer() == this) { pullMode = false; } break; default: if (log.isDebugEnabled()) { log.debug("Unhandled pipe event: {}", event); } } }
Example 2
Source File: ICYStream.java From red5-rtsp-restreamer with Apache License 2.0 | 5 votes |
@Override public void onPipeConnectionEvent(PipeConnectionEvent event) { switch (event.getType()) { case PipeConnectionEvent.PROVIDER_CONNECT_PUSH: if ((event.getProvider() == this) && (event.getParamMap() == null)) { mLivePipe = (IPipe) event.getSource(); log.debug("mLivePipe {}", mLivePipe); for (@SuppressWarnings("unused") IConsumer consumer : mLivePipe.getConsumers()) { subscriberStats.increment(); } } break; case PipeConnectionEvent.PROVIDER_DISCONNECT: if (mLivePipe == event.getSource()) { mLivePipe = null; } break; case PipeConnectionEvent.CONSUMER_CONNECT_PUSH: if (mLivePipe != null) { List<IConsumer> consumers = mLivePipe.getConsumers(); int count = consumers.size(); if (count > 0) { newComsumers.add(consumers.get(count - 1)); } subscriberStats.increment(); } break; case PipeConnectionEvent.CONSUMER_DISCONNECT: subscriberStats.decrement(); break; default: break; } }
Example 3
Source File: ClientBroadcastStream.java From red5-server-common with Apache License 2.0 | 4 votes |
/** * Pipe connection event handler * * @param event * Pipe connection event */ @SuppressWarnings("unused") public void onPipeConnectionEvent(PipeConnectionEvent event) { switch (event.getType()) { case PROVIDER_CONNECT_PUSH: //log.debug("Provider connect"); if (event.getProvider() == this && event.getSource() != connMsgOut && (event.getParamMap() == null || !event.getParamMap().containsKey("record"))) { livePipe = (IPipe) event.getSource(); //log.debug("Provider: {}", livePipe.getClass().getName()); for (IConsumer consumer : livePipe.getConsumers()) { subscriberStats.increment(); } } break; case PROVIDER_DISCONNECT: //log.debug("Provider disconnect"); //if (log.isDebugEnabled() && livePipe != null) { //log.debug("Provider: {}", livePipe.getClass().getName()); //} if (livePipe == event.getSource()) { livePipe = null; } break; case CONSUMER_CONNECT_PUSH: //log.debug("Consumer connect"); IPipe pipe = (IPipe) event.getSource(); //if (log.isDebugEnabled() && pipe != null) { //log.debug("Consumer: {}", pipe.getClass().getName()); //} if (livePipe == pipe) { notifyChunkSize(); } subscriberStats.increment(); break; case CONSUMER_DISCONNECT: //log.debug("Consumer disconnect: {}", event.getSource().getClass().getName()); subscriberStats.decrement(); break; default: } }