/** * Creates switch executor for specified mode. * * @param mode the mode value. * @return switch executor * @throws ModeNotSupportedException */ protected Mode convert(ConnectionMode mode) throws ModeNotSupportedException { switch (mode) { case RECV_ONLY: return recvOnly; case SEND_ONLY: return sendOnly; case SEND_RECV: return send_recv; case CONFERENCE: return cnfMode; case NETWORK_LOOPBACK: return network_loop; case INACTIVE: return null; default: throw new ModeNotSupportedException(mode); } }
throw new ModeNotSupportedException(e.getMessage());
throw new ModeNotSupportedException(e.getMessage());
@Override protected void on() throws ModeNotSupportedException { //get the sink at the endpoint side MediaSink sink = endpoint.getSink(channel.getMediaType()); //check that sink is present if (sink == null) { throw new ModeNotSupportedException("RECV_ONLY"); } //join sink with channel and start transmission pipe.connect(sink); pipe.connect(channel.mixer.getOutput()); channel.mixer.start(); pipe.start(); }
@Override protected void on() throws ModeNotSupportedException { //get the endpoint source source = endpoint.getSource(channel.getMediaType()); source.setMediaTime(mediaTime); //check that endpoint has source if (source == null) { throw new ModeNotSupportedException("SEND_ONLY"); } //join source with channel pipe.connect(source); pipe.connect(channel.splitter.getInput()); pipe.start(); }
@Override protected void on() throws ModeNotSupportedException { //get the sink from endpoint MediaSink sink = endpoint.getSink(channel.getMediaType()); //get the source from endpoint MediaSource source = endpoint.getSource(channel.getMediaType()); //check that both are present if (sink == null || source == null) { throw new ModeNotSupportedException("LOOPBACK"); } //join sink and source and start transmission pipe.connect(sink); pipe.connect(source); pipe.start(); }
public void updateMode(ConnectionMode connectionMode) throws ModeNotSupportedException { if (this.otherChannel == null) { throw new ModeNotSupportedException("You should join channel first"); break; case NETWORK_LOOPBACK: throw new ModeNotSupportedException("Loopback not supported on local channel"); default: