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
Select Git revision

Target

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