Skip to content

Commit

Permalink
Bumped version to 1.2.28. Added adapter method to allow scoped stream…
Browse files Browse the repository at this point in the history
…s to be pulled easier
  • Loading branch information
mondain committed Aug 2, 2022
1 parent 4453c87 commit aafb347
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.red5</groupId>
<artifactId>red5-parent</artifactId>
<version>1.2.27</version>
<version>1.2.28</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>red5-client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/org/red5/client/Red5Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class Red5Client {
/**
* Current server version with revision
*/
public static final String VERSION = "Red5 Client 1.2.27";
public static final String VERSION = "Red5 Client 1.2.28";

/**
* Create a new Red5Client object using the connection local to the current thread A bit of magic that lets you access the red5 scope
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.red5</groupId>
<artifactId>red5-parent</artifactId>
<version>1.2.27</version>
<version>1.2.28</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>red5-server-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,11 @@ public IBroadcastStream getBroadcastStream(IScope scope, String name) {
return null;
}

/** {@inheritDoc} */
public Set<IBroadcastStream> getBroadcastStreams(IScope scope) {
return scope.getBroadcastStreams();
}

/**
* Returns list of stream names broadcasted in scope. Broadcast stream name is somewhat different from server stream name. Server stream
* name is just an ID assigned by Red5 to every created stream. Broadcast stream name is the name that is being used to subscribe to the
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/org/red5/server/api/Red5.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public final class Red5 {
/**
* Server version with revision
*/
public static final String VERSION = "Red5 Server 1.2.27";
public static final String VERSION = "Red5 Server 1.2.28";

/**
* Server version for fmsVer requests
*/
public static final String FMS_VERSION = "RED5/1,2,27,0";
public static final String FMS_VERSION = "RED5/1,2,28,0";

/**
* Server capabilities
Expand Down
8 changes: 8 additions & 0 deletions common/src/main/java/org/red5/server/api/scope/IScope.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.red5.server.api.IContext;
import org.red5.server.api.service.IServiceHandlerProvider;
import org.red5.server.api.statistics.IScopeStatistics;
import org.red5.server.api.stream.IBroadcastStream;
import org.springframework.core.io.support.ResourcePatternResolver;

/**
Expand Down Expand Up @@ -273,4 +274,11 @@ public interface IScope extends IBasicScope, ResourcePatternResolver, IServiceHa
*/
public Map<String, Object> getAttributes();

/**
* Returns all the broadcast streams in the current scope.
*
* @return set of IBroadcastStream if any exist or empty if none exist
*/
public Set<IBroadcastStream> getBroadcastStreams();

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface IBroadcastStreamService {
* name of the broadcast
* @return true is a stream exists, otherwise false
*/
public boolean hasBroadcastStream(IScope scope, String name);
boolean hasBroadcastStream(IScope scope, String name);

/**
* Get a broadcast stream by name
Expand All @@ -36,7 +36,7 @@ public interface IBroadcastStreamService {
* the name of the broadcast
* @return broadcast stream object
*/
public IBroadcastStream getBroadcastStream(IScope scope, String name);
IBroadcastStream getBroadcastStream(IScope scope, String name);

/**
* Get a set containing the names of all the broadcasts
Expand All @@ -45,6 +45,14 @@ public interface IBroadcastStreamService {
* the scope to search for streams
* @return set containing all broadcast names
*/
public Set<String> getBroadcastStreamNames(IScope scope);
Set<String> getBroadcastStreamNames(IScope scope);

/**
* Returns broadcast streams registered on the scope.
*
* @param scope
* @return set of broadcast streams or empty if none exist
*/
Set<IBroadcastStream> getBroadcastStreams(IScope scope);

}
24 changes: 24 additions & 0 deletions common/src/main/java/org/red5/server/scope/Scope.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.red5.server.api.scope.ScopeType;
import org.red5.server.api.statistics.IScopeStatistics;
import org.red5.server.api.statistics.support.StatisticsCounter;
import org.red5.server.api.stream.IBroadcastStream;
import org.red5.server.api.stream.IClientBroadcastStream;
import org.red5.server.exception.ScopeException;
import org.red5.server.jmx.mxbeans.ScopeMXBean;
Expand Down Expand Up @@ -449,6 +450,18 @@ public IBroadcastScope getBroadcastScope(String name) {
return (IBroadcastScope) children.getBasicScope(ScopeType.BROADCAST, name);
}

/**
* Return the broadcast streams for this scope.
*
* @return broadcast streams or empty if not found
*/
@Override
public Set<IBroadcastStream> getBroadcastStreams() {
Set<IBroadcastStream> streams = new HashSet<>();
children.getBasicScopes(ScopeType.BROADCAST).stream().filter(bs -> ((IBroadcastScope) bs).getClientBroadcastStream() != null).forEach(bs -> streams.add(((IBroadcastScope) bs).getClientBroadcastStream()));
return streams;
}

/**
* Return base scope with given name.
*
Expand Down Expand Up @@ -1428,6 +1441,17 @@ public boolean hasName(String name) {
return false;
}

/**
* Returns child scopes for a given type.
*
* @param type
* Scope type
* @return set of scopes matching type
*/
public Set<IBasicScope> getBasicScopes(ScopeType type) {
return stream().filter(child -> child.getType().equals(type)).collect(Collectors.toUnmodifiableSet());
}

/**
* Returns a child scope for a given name and type.
*
Expand Down
2 changes: 1 addition & 1 deletion io/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.red5</groupId>
<artifactId>red5-parent</artifactId>
<version>1.2.27</version>
<version>1.2.28</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>red5-io</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<name>Red5</name>
<description>The Red5 server</description>
<groupId>org.red5</groupId>
<version>1.2.27</version>
<version>1.2.28</version>
<url>https://github.com/Red5/red5-server</url>
<inceptionYear>2005</inceptionYear>
<organization>
Expand Down
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.red5</groupId>
<artifactId>red5-parent</artifactId>
<version>1.2.27</version>
<version>1.2.28</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>red5-server</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.red5</groupId>
<artifactId>red5-parent</artifactId>
<version>1.2.27</version>
<version>1.2.28</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>red5-service</artifactId>
Expand Down

0 comments on commit aafb347

Please sign in to comment.