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

feat(MediaSourceDesc): add source name #374

Merged
merged 1 commit into from Sep 28, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/kotlin/org/jitsi/nlj/MediaSourceDesc.kt
Expand Up @@ -49,7 +49,11 @@ class MediaSourceDesc
* A string which identifies the owner of this source (e.g. the endpoint
* which is the sender of the source).
*/
val owner: String? = null
val owner: String? = null,
/**
* A string which identifies this source.
*/
val sourceName: String? = null
) {
/**
* Current single-list view of all the encodings' layers.
Expand Down
8 changes: 5 additions & 3 deletions src/test/kotlin/org/jitsi/nlj/MediaSourceDescTest.kt
Expand Up @@ -28,11 +28,12 @@ class MediaSourceDescTest : ShouldSpec() {
val ssrcs = arrayOf(0xdeadbeefL, 0xcafebabeL, 0x01234567L)
val source = createSource(
ssrcs,
1, 3, "Fake owner"
1, 3, "Fake owner", "Fake name"
)

context("Source properties should be correct") {
source.owner shouldBe "Fake owner"
source.sourceName shouldBe "Fake name"
source.rtpEncodings.size shouldBe 3

source.rtpLayers.size shouldBe 9
Expand Down Expand Up @@ -211,7 +212,8 @@ private fun createSource(
primarySsrcs: Array<Long>,
numSpatialLayersPerStream: Int,
numTemporalLayersPerStream: Int,
owner: String
owner: String,
name: String?
): MediaSourceDesc {
var height = 720

Expand All @@ -226,7 +228,7 @@ private fun createSource(
ret
}

return MediaSourceDesc(encodings, owner)
return MediaSourceDesc(encodings, owner, name)
}

/** A fake rate statistics object, for testing */
Expand Down