Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • otmane.mabrouk.etu/red5-server
1 result
Show changes
Commits on Source (3)
......@@ -16,7 +16,7 @@ import org.red5.client.net.rtmp.ClientExceptionHandler;
import org.red5.client.net.rtmp.INetStreamEventHandler;
import org.red5.client.net.rtmp.RTMPClient;
import org.red5.io.utils.ObjectMap;
import org.red5.proxy.StreamingProxy;
import org.red5.proxy.StreamProxy;
import org.red5.server.api.event.IEvent;
import org.red5.server.api.event.IEventDispatcher;
import org.red5.server.api.service.IPendingServiceCall;
......@@ -37,7 +37,7 @@ public class StreamRelay {
private static RTMPClient client;
// our publisher
private static StreamingProxy proxy;
private static StreamProxy proxy;
// task timer
private static Timer timer;
......@@ -79,8 +79,8 @@ public class StreamRelay {
// create a timer
timer = new Timer();
// create our publisher
proxy = new StreamingProxy();
proxy.setHost(destHost);
proxy = new StreamProxy();
proxy.setAut(destHost);
proxy.setPort(destPort);
proxy.setApp(destApp);
proxy.init();
......
......@@ -44,13 +44,13 @@ import org.slf4j.LoggerFactory;
* @author Andy Shaules (bowljoman@hotmail.com)
* @author Paul Gregoire (mondain@gmail.com)
*/
public class StreamingProxy implements IPushableConsumer, IPipeConnectionListener, INetStreamEventHandler, IPendingServiceCallback {
public class StreamProxy implements IPushableConsumer, IPipeConnectionListener, INetStreamEventHandler, IPendingServiceCallback {
private static Logger log = LoggerFactory.getLogger(StreamingProxy.class);
private static Logger log = LoggerFactory.getLogger(StreamProxy.class);
private ConcurrentLinkedQueue<IMessage> frameBuffer = new ConcurrentLinkedQueue<>();
private String host;
private String aut;
private int port;
......@@ -99,15 +99,15 @@ public class StreamingProxy implements IPushableConsumer, IPipeConnectionListene
this.publishName = publishName;
this.publishMode = publishMode;
// construct the default params
Map<String, Object> defParams = rtmpClient.makeDefaultConnectionParams(host, port, app);
Map<String, Object> defParams = rtmpClient.makeDefaultConnectionParams(aut, port, app);
defParams.put("swfUrl", "app:/Red5-StreamProxy.swf");
//defParams.put("pageUrl", String.format("http://%s:%d/%s", host, port, app));
//defParams.put("pageUrl", String.format("http://%s:%d/%s", aut, port, app));
defParams.put("pageUrl", "");
rtmpClient.setSwfVerification(true);
// set this as the netstream handler
rtmpClient.setStreamEventHandler(this);
// connect the client
rtmpClient.connect(host, port, defParams, this, params);
rtmpClient.connect(aut, port, defParams, this, params);
}
public void stop() {
......@@ -153,8 +153,8 @@ public class StreamingProxy implements IPushableConsumer, IPipeConnectionListene
rtmpClient.onBWDone(null);
}
public void setHost(String host) {
this.host = host;
public void setAut(String aut) {
this.aut = aut;
}
public void setPort(int port) {
......@@ -207,7 +207,7 @@ public class StreamingProxy implements IPushableConsumer, IPipeConnectionListene
}
}
protected void setState(StreamState state) {
protected int setState(StreamState state) {
try {
lock.acquire();
this.state = state;
......@@ -216,6 +216,7 @@ public class StreamingProxy implements IPushableConsumer, IPipeConnectionListene
} finally {
lock.release();
}
return 0;
}
protected StreamState getState() {
......
......@@ -248,17 +248,15 @@ public class PersistableAttributeStore extends AttributeStore implements IPersis
/** {@inheritDoc} */
@Override
public boolean setAttributes(Map<String, Object> values) {
boolean success = super.setAttributes(values);
modified();
return success;
return super.setAttributes(values);
}
/** {@inheritDoc} */
@Override
public boolean setAttributes(IAttributeStore values) {
boolean success = super.setAttributes(values);
modified();
return success;
return super.setAttributes(values);
}
/**
......@@ -270,11 +268,10 @@ public class PersistableAttributeStore extends AttributeStore implements IPersis
*/
@Override
public boolean removeAttribute(String name) {
boolean result = super.removeAttribute(name);
if (result && name != null && !name.startsWith(IPersistable.TRANSIENT_PREFIX)) {
if ((super.removeAttribute(name)) && name != null && !name.startsWith(IPersistable.TRANSIENT_PREFIX)) {
modified();
}
return result;
return (super.removeAttribute(name));
}
/**
......