<NME> SsrcAssociationType.kt
<BEF> ADDFILE
<MSG> add a specific ssrcassociation type

<DFF> @@ -0,0 +1,23 @@
+/*
+ * Copyright @ 2018 - present 8x8, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jitsi.nlj.rtp
+
+enum class SsrcAssociationType {
+    RTX,
+    SIM,
+    FEC
+}
\ No newline at end of file

{'commit': 'diff --git a/src/main/kotlin/org/jitsi/nlj/Event.kt b/src/main/kotlin/org/jitsi/nlj/Event.kt\nindex b2e56edf..f3f515c0 100644\n--- a/src/main/kotlin/org/jitsi/nlj/Event.kt\n+++ b/src/main/kotlin/org/jitsi/nlj/Event.kt\n@@ -15,6 +15,7 @@\n  */\n package org.jitsi.nlj\n \n+import org.jitsi.nlj.rtp.SsrcAssociationType\n import org.jitsi.service.neomedia.RTPExtension\n import org.jitsi.service.neomedia.format.MediaFormat\n import org.jitsi_modified.impl.neomedia.rtp.MediaStreamTrackDesc\n@@ -33,7 +34,7 @@ class ReceiveSsrcRemovedEvent(val ssrc: Long) : Event\n class SsrcAssociationEvent(\n     val primarySsrc: Long,\n     val secondarySsrc: Long,\n-    val type: String\n+    val type: SsrcAssociationType\n ) : Event\n \n class SetMediaStreamTracksEvent(val mediaStreamTrackDescs: Array<MediaStreamTrackDesc>) : Event\ndiff --git a/src/main/kotlin/org/jitsi/nlj/Transceiver.kt b/src/main/kotlin/org/jitsi/nlj/Transceiver.kt\nindex 2bad614c..861956b1 100644\n--- a/src/main/kotlin/org/jitsi/nlj/Transceiver.kt\n+++ b/src/main/kotlin/org/jitsi/nlj/Transceiver.kt\n@@ -18,6 +18,7 @@ package org.jitsi.nlj\n import org.bouncycastle.crypto.tls.TlsContext\n import org.jitsi.impl.neomedia.rtp.remotebitrateestimator.RemoteBitrateObserver\n import org.jitsi.nlj.rtcp.RtcpEventNotifier\n+import org.jitsi.nlj.rtp.SsrcAssociationType\n import org.jitsi.nlj.srtp.SrtpUtil\n import org.jitsi.nlj.srtp.TlsRole\n import org.jitsi.nlj.stats.EndpointConnectionStats\n@@ -261,9 +262,11 @@ class Transceiver(\n \n     // TODO(brian): we may want to handle local and remote ssrc associations differently, as different parts of the\n     // code care about one or the other, but currently there is no issue treating them the same.\n-    fun addSsrcAssociation(primarySsrc: Long, secondarySsrc: Long, type: String) {\n+    fun addSsrcAssociation(primarySsrc: Long, secondarySsrc: Long, type: SsrcAssociationType) {\n         logger.cinfo { "Transeceiver $id adding ssrc association: $primarySsrc <-> $secondarySsrc ($type)"}\n-        val ssrcAssociationEvent = SsrcAssociationEvent(primarySsrc, secondarySsrc, type)\n+        val ssrcAssociationEvent = SsrcAssociationEvent(primarySsrc, secondarySsrc, type\n+\n+        )\n         rtpReceiver.handleEvent(ssrcAssociationEvent)\n         rtpSender.handleEvent(ssrcAssociationEvent)\n     }\ndiff --git a/src/main/kotlin/org/jitsi/nlj/rtp/SsrcAssociationType.kt b/src/main/kotlin/org/jitsi/nlj/rtp/SsrcAssociationType.kt\nnew file mode 100644\nindex 00000000..a2ab9ecc\n--- /dev/null\n+++ b/src/main/kotlin/org/jitsi/nlj/rtp/SsrcAssociationType.kt\n@@ -0,0 +1,23 @@\n+/*\n+ * Copyright @ 2018 - present 8x8, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the "License");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an "AS IS" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.jitsi.nlj.rtp\n+\n+enum class SsrcAssociationType {\n+    RTX,\n+    SIM,\n+    FEC\n+}\n\\ No newline at end of file\ndiff --git a/src/main/kotlin/org/jitsi/nlj/transform/node/incoming/RtxHandler.kt b/src/main/kotlin/org/jitsi/nlj/transform/node/incoming/RtxHandler.kt\nindex a4e13fb0..9ef9d431 100644\n--- a/src/main/kotlin/org/jitsi/nlj/transform/node/incoming/RtxHandler.kt\n+++ b/src/main/kotlin/org/jitsi/nlj/transform/node/incoming/RtxHandler.kt\n@@ -21,6 +21,7 @@ import org.jitsi.nlj.RtpPayloadTypeAddedEvent\n import org.jitsi.nlj.RtpPayloadTypeClearEvent\n import org.jitsi.nlj.SsrcAssociationEvent\n import org.jitsi.nlj.forEachAs\n+import org.jitsi.nlj.rtp.SsrcAssociationType\n import org.jitsi.nlj.stats.NodeStatsBlock\n import org.jitsi.nlj.transform.node.Node\n import org.jitsi.nlj.util.cdebug\n@@ -104,7 +105,7 @@ class RtxHandler : Node("RTX handler") {\n                 associatedPayloadTypes.clear()\n             }\n             is SsrcAssociationEvent -> {\n-                if (event.type.equals(Constants.RTX)) {\n+                if (event.type == SsrcAssociationType.RTX) {\n                     logger.cinfo { "RtxHandler associating RTX ssrc ${event.secondarySsrc} with primary ${event.primarySsrc}" }\n                     associatedSsrcs[event.secondarySsrc] = event.primarySsrc\n                 }\ndiff --git a/src/main/kotlin/org/jitsi/nlj/transform/node/outgoing/RetransmissionSender.kt b/src/main/kotlin/org/jitsi/nlj/transform/node/outgoing/RetransmissionSender.kt\nindex 310a1949..334abd2f 100644\n--- a/src/main/kotlin/org/jitsi/nlj/transform/node/outgoing/RetransmissionSender.kt\n+++ b/src/main/kotlin/org/jitsi/nlj/transform/node/outgoing/RetransmissionSender.kt\n@@ -21,6 +21,7 @@ import org.jitsi.nlj.RtpPayloadTypeAddedEvent\n import org.jitsi.nlj.RtpPayloadTypeClearEvent\n import org.jitsi.nlj.SsrcAssociationEvent\n import org.jitsi.nlj.forEachAs\n+import org.jitsi.nlj.rtp.SsrcAssociationType\n import org.jitsi.nlj.stats.NodeStatsBlock\n import org.jitsi.nlj.transform.node.Node\n import org.jitsi.nlj.util.cdebug\n@@ -108,7 +109,7 @@ class RetransmissionSender : Node("Retransmission sender") {\n                 associatedPayloadTypes.clear()\n             }\n             is SsrcAssociationEvent -> {\n-                if (event.type == Constants.RTX) {\n+                if (event.type == SsrcAssociationType.RTX) {\n                     logger.cinfo { "Retransmission sender ${hashCode()} associating RTX ssrc " +\n                             "${event.secondarySsrc} with primary ${event.primarySsrc}" }\n                     associatedSsrcs[event.primarySsrc] = event.secondarySsrc\n', 'commit_subject': 'add a specific ssrcassociation type', 'repo_name': 'jitsi/jitsi-videobridge', 'committer': {'name': 'Brian Baldino', 'email': '7a33e0e6f5c320e7bb3b54511f1121f931574b04@gmail.com', 'time_sec': '1548374679', 'tz_offset': '-480', 'date': {'seconds': '1548374679'}}, 'commit_tree': '5a92d224d1732344c686eb9197c6b8be0e8dd25a', 'commit_message': 'add a specific ssrcassociation type\n', 'language_name': 'Kotlin', 'license': 'apache-2.0', 'hunks': '@@ -0,0 +1,23 @@\n+/*\n+ * Copyright @ 2018 - present 8x8, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the "License");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an "AS IS" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.jitsi.nlj.rtp\n+\n+enum class SsrcAssociationType {\n+    RTX,\n+    SIM,\n+    FEC\n+}\n\\ No newline at end of file\n', 'addition_count': 23, 'deletion_count': 0, 'src_file': '/dev/null', 'tgt_file': 'b/src/main/kotlin/org/jitsi/nlj/rtp/SsrcAssociationType.kt', 'file_extension': '.kt', 'before_file': 'ADDFILE', 'message': 'add a specific ssrcassociation type\n', 'author_name': 'Brian Baldino', 'lang': 'kt'}