Skip to content

Commit aafb347

Browse files
committed
Bumped version to 1.2.28. Added adapter method to allow scoped streams to be pulled easier
1 parent 4453c87 commit aafb347

File tree

12 files changed

+57
-12
lines changed

12 files changed

+57
-12
lines changed

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>1.2.27</version>
6+
<version>1.2.28</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-client</artifactId>

client/src/main/java/org/red5/client/Red5Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public final class Red5Client {
1818
/**
1919
* Current server version with revision
2020
*/
21-
public static final String VERSION = "Red5 Client 1.2.27";
21+
public static final String VERSION = "Red5 Client 1.2.28";
2222

2323
/**
2424
* Create a new Red5Client object using the connection local to the current thread A bit of magic that lets you access the red5 scope

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>1.2.27</version>
6+
<version>1.2.28</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-server-common</artifactId>

common/src/main/java/org/red5/server/adapter/MultiThreadedApplicationAdapter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,11 @@ public IBroadcastStream getBroadcastStream(IScope scope, String name) {
882882
return null;
883883
}
884884

885+
/** {@inheritDoc} */
886+
public Set<IBroadcastStream> getBroadcastStreams(IScope scope) {
887+
return scope.getBroadcastStreams();
888+
}
889+
885890
/**
886891
* Returns list of stream names broadcasted in scope. Broadcast stream name is somewhat different from server stream name. Server stream
887892
* 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

common/src/main/java/org/red5/server/api/Red5.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ public final class Red5 {
5555
/**
5656
* Server version with revision
5757
*/
58-
public static final String VERSION = "Red5 Server 1.2.27";
58+
public static final String VERSION = "Red5 Server 1.2.28";
5959

6060
/**
6161
* Server version for fmsVer requests
6262
*/
63-
public static final String FMS_VERSION = "RED5/1,2,27,0";
63+
public static final String FMS_VERSION = "RED5/1,2,28,0";
6464

6565
/**
6666
* Server capabilities

common/src/main/java/org/red5/server/api/scope/IScope.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.red5.server.api.IContext;
1717
import org.red5.server.api.service.IServiceHandlerProvider;
1818
import org.red5.server.api.statistics.IScopeStatistics;
19+
import org.red5.server.api.stream.IBroadcastStream;
1920
import org.springframework.core.io.support.ResourcePatternResolver;
2021

2122
/**
@@ -273,4 +274,11 @@ public interface IScope extends IBasicScope, ResourcePatternResolver, IServiceHa
273274
*/
274275
public Map<String, Object> getAttributes();
275276

277+
/**
278+
* Returns all the broadcast streams in the current scope.
279+
*
280+
* @return set of IBroadcastStream if any exist or empty if none exist
281+
*/
282+
public Set<IBroadcastStream> getBroadcastStreams();
283+
276284
}

common/src/main/java/org/red5/server/api/service/IBroadcastStreamService.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public interface IBroadcastStreamService {
2525
* name of the broadcast
2626
* @return true is a stream exists, otherwise false
2727
*/
28-
public boolean hasBroadcastStream(IScope scope, String name);
28+
boolean hasBroadcastStream(IScope scope, String name);
2929

3030
/**
3131
* Get a broadcast stream by name
@@ -36,7 +36,7 @@ public interface IBroadcastStreamService {
3636
* the name of the broadcast
3737
* @return broadcast stream object
3838
*/
39-
public IBroadcastStream getBroadcastStream(IScope scope, String name);
39+
IBroadcastStream getBroadcastStream(IScope scope, String name);
4040

4141
/**
4242
* Get a set containing the names of all the broadcasts
@@ -45,6 +45,14 @@ public interface IBroadcastStreamService {
4545
* the scope to search for streams
4646
* @return set containing all broadcast names
4747
*/
48-
public Set<String> getBroadcastStreamNames(IScope scope);
48+
Set<String> getBroadcastStreamNames(IScope scope);
49+
50+
/**
51+
* Returns broadcast streams registered on the scope.
52+
*
53+
* @param scope
54+
* @return set of broadcast streams or empty if none exist
55+
*/
56+
Set<IBroadcastStream> getBroadcastStreams(IScope scope);
4957

5058
}

common/src/main/java/org/red5/server/scope/Scope.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.red5.server.api.scope.ScopeType;
4747
import org.red5.server.api.statistics.IScopeStatistics;
4848
import org.red5.server.api.statistics.support.StatisticsCounter;
49+
import org.red5.server.api.stream.IBroadcastStream;
4950
import org.red5.server.api.stream.IClientBroadcastStream;
5051
import org.red5.server.exception.ScopeException;
5152
import org.red5.server.jmx.mxbeans.ScopeMXBean;
@@ -449,6 +450,18 @@ public IBroadcastScope getBroadcastScope(String name) {
449450
return (IBroadcastScope) children.getBasicScope(ScopeType.BROADCAST, name);
450451
}
451452

453+
/**
454+
* Return the broadcast streams for this scope.
455+
*
456+
* @return broadcast streams or empty if not found
457+
*/
458+
@Override
459+
public Set<IBroadcastStream> getBroadcastStreams() {
460+
Set<IBroadcastStream> streams = new HashSet<>();
461+
children.getBasicScopes(ScopeType.BROADCAST).stream().filter(bs -> ((IBroadcastScope) bs).getClientBroadcastStream() != null).forEach(bs -> streams.add(((IBroadcastScope) bs).getClientBroadcastStream()));
462+
return streams;
463+
}
464+
452465
/**
453466
* Return base scope with given name.
454467
*
@@ -1428,6 +1441,17 @@ public boolean hasName(String name) {
14281441
return false;
14291442
}
14301443

1444+
/**
1445+
* Returns child scopes for a given type.
1446+
*
1447+
* @param type
1448+
* Scope type
1449+
* @return set of scopes matching type
1450+
*/
1451+
public Set<IBasicScope> getBasicScopes(ScopeType type) {
1452+
return stream().filter(child -> child.getType().equals(type)).collect(Collectors.toUnmodifiableSet());
1453+
}
1454+
14311455
/**
14321456
* Returns a child scope for a given name and type.
14331457
*

io/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<parent>
44
<groupId>org.red5</groupId>
55
<artifactId>red5-parent</artifactId>
6-
<version>1.2.27</version>
6+
<version>1.2.28</version>
77
</parent>
88
<modelVersion>4.0.0</modelVersion>
99
<artifactId>red5-io</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<name>Red5</name>
2424
<description>The Red5 server</description>
2525
<groupId>org.red5</groupId>
26-
<version>1.2.27</version>
26+
<version>1.2.28</version>
2727
<url>https://github.com/Red5/red5-server</url>
2828
<inceptionYear>2005</inceptionYear>
2929
<organization>

0 commit comments

Comments
 (0)