Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Fix some warnings. #2054

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions jvb/src/main/java/org/jitsi/videobridge/Conference.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class Conference
/**
* A map of the endpoints in this conference, by their ssrcs.
*/
private ConcurrentHashMap<Long, AbstractEndpoint> endpointsBySsrc = new ConcurrentHashMap<>();
private final ConcurrentHashMap<Long, AbstractEndpoint> endpointsBySsrc = new ConcurrentHashMap<>();

/**
* The relays participating in this conference.
Expand Down Expand Up @@ -643,11 +643,9 @@ private void updateStatisticsOnExpire()

if (logger.isInfoEnabled())
{
StringBuilder sb = new StringBuilder("expire_conf,");
sb.append("duration=").append(durationSeconds)
.append(",has_failed=").append(hasFailed)
.append(",has_partially_failed=").append(hasPartiallyFailed);
logger.info(sb.toString());
logger.info("expire_conf,duration=" + durationSeconds +
",has_failed=" + hasFailed +
",has_partially_failed=" + hasPartiallyFailed);
}
}

Expand Down Expand Up @@ -1083,11 +1081,6 @@ public void addEndpointSsrc(@NotNull AbstractEndpoint endpoint, long ssrc)
}
}

public void removeEndpointSsrc(@NotNull AbstractEndpoint endpoint, long ssrc)
{
endpointsBySsrc.remove(ssrc, endpoint);
}

/**
* Gets the conference name.
*
Expand Down Expand Up @@ -1199,7 +1192,6 @@ public boolean hasRelays()

/**
* Handles an RTP/RTCP packet coming from a specific endpoint.
* @param packetInfo
*/
public void handleIncomingPacket(PacketInfo packetInfo)
{
Expand Down
9 changes: 4 additions & 5 deletions jvb/src/main/kotlin/org/jitsi/videobridge/Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ import java.time.Instant
import java.util.Optional
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicLong
import java.util.function.Supplier

/**
* Models a local endpoint (participant) in a [Conference]
Expand Down Expand Up @@ -220,7 +219,7 @@ class Endpoint @JvmOverloads constructor(
override fun keyframeNeeded(endpointId: String?, ssrc: Long) =
conference.requestKeyframe(endpointId, ssrc)
},
Supplier { getOrderedEndpoints() },
{ getOrderedEndpoints() },
diagnosticContext,
logger,
isUsingSourceNames,
Expand All @@ -235,7 +234,7 @@ class Endpoint @JvmOverloads constructor(
*/
override val messageTransport = EndpointMessageTransport(
this,
Supplier { conference.videobridge.statistics },
{ conference.videobridge.statistics },
conference,
logger
)
Expand Down Expand Up @@ -288,7 +287,7 @@ class Endpoint @JvmOverloads constructor(
return transceiver.sendProbing(mediaSsrcs, numBytes)
}
},
Supplier { bitrateController.getStatusSnapshot() }
{ bitrateController.getStatusSnapshot() }
).apply {
diagnosticsContext = [email protected]
enabled = true
Expand Down Expand Up @@ -559,7 +558,7 @@ class Endpoint @JvmOverloads constructor(
if (doSsrcRewriting) {
val newActiveSources =
newEffectiveConstraints.entries.filter { !it.value.isDisabled() }.map { it.key }.toList()
val newActiveSourceNames = newActiveSources.mapNotNull { it.sourceName }.toSet()
val newActiveSourceNames = newActiveSources.map { it.sourceName }.toSet()
/* safe unlocked access of activeSources. BitrateController will not overlap calls to this method. */
if (activeSources != newActiveSourceNames) {
activeSources = newActiveSourceNames
Expand Down
8 changes: 4 additions & 4 deletions jvb/src/main/kotlin/org/jitsi/videobridge/SsrcCache.kt
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ abstract class SsrcCache(val size: Int, val ep: SsrcRewriter, val parentLogger:

synchronized(sendSources) {
/* Don't activate a source on RTCP. */
var rs = receivedSsrcs.get(packet.senderSsrc) ?: return false
val rs = receivedSsrcs.get(packet.senderSsrc) ?: return false
val ss = getSendSource(rs.props.ssrc1, rs.props, allowCreate = false, remappings) ?: return false
ss.rewriteRtcp(packet)
logger.debug {
Expand Down Expand Up @@ -537,10 +537,10 @@ class AudioSsrcCache(size: Int, ep: SsrcRewriter, parentLogger: Logger) :
*/
override fun findSourceProps(ssrc: Long): SourceDesc? {
val p = ep.findAudioSourceProps(ssrc)
if (p == null || p.sourceName == null || p.owner == null) {
return null
return if (p?.sourceName == null || p.owner == null) {
null
} else {
return SourceDesc(p)
SourceDesc(p)
}
}

Expand Down
Loading