Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libjitsi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ZRTP
libjitsi
Commits
91744a1f
Commit
91744a1f
authored
10 years ago
by
Lyubomir Marinov
Browse files
Options
Downloads
Patches
Plain Diff
Fixes a false reporting of SSRC audio levels when such are negotiated but not sent.
parent
09ea4c6c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/org/jitsi/impl/neomedia/RawPacket.java
+45
-18
45 additions, 18 deletions
src/org/jitsi/impl/neomedia/RawPacket.java
src/org/jitsi/impl/neomedia/transform/csrc/SsrcTransformEngine.java
+1
-1
1 addition, 1 deletion
...tsi/impl/neomedia/transform/csrc/SsrcTransformEngine.java
with
46 additions
and
19 deletions
src/org/jitsi/impl/neomedia/RawPacket.java
+
45
−
18
View file @
91744a1f
...
@@ -240,7 +240,14 @@ public long[] extractCsrcAudioLevels(byte csrcExtID)
...
@@ -240,7 +240,14 @@ public long[] extractCsrcAudioLevels(byte csrcExtID)
int
csrcLevelsIndex
=
2
*
i
;
int
csrcLevelsIndex
=
2
*
i
;
csrcLevels
[
csrcLevelsIndex
]
=
0xFFFFFFFF
L
&
readInt
(
csrcStartIndex
);
csrcLevels
[
csrcLevelsIndex
]
=
0xFFFFFFFF
L
&
readInt
(
csrcStartIndex
);
csrcLevels
[
csrcLevelsIndex
+
1
]
=
getCsrcAudioLevel
(
csrcExtID
,
i
);
/*
* The audio levels generated by Jitsi are not in accord with the
* respective specification, they are backwards with respect to the
* value domain. Which means that the audio level generated from a
* muted audio source is 0/zero.
*/
csrcLevels
[
csrcLevelsIndex
+
1
]
=
getCsrcAudioLevel
(
csrcExtID
,
i
,
(
byte
)
0
);
}
}
return
csrcLevels
;
return
csrcLevels
;
...
@@ -267,13 +274,29 @@ public long[] extractCsrcList()
...
@@ -267,13 +274,29 @@ public long[] extractCsrcList()
return
csrcList
;
return
csrcList
;
}
}
/**
* Extracts the source audio level reported by the remote party which sent
* this packet and carried in this packet.
*
* @param ssrcExtID the ID of the extension that's transporting ssrc audio
* levels in the session that this <tt>RawPacket</tt> belongs to
* @return the source audio level reported by the remote party which sent
* this packet and carried in this packet or a negative value if this packet
* contains no extension such as the specified by <tt>ssrcExtID</tt>
*/
public
byte
extractSsrcAudioLevel
(
byte
ssrcExtID
)
public
byte
extractSsrcAudioLevel
(
byte
ssrcExtID
)
{
{
/*
/*
* The method getCsrcAudioLevel(byte, int) is implemented with the
* The method getCsrcAudioLevel(byte, int) is implemented with the
* awareness that there may be a flag bit V with a value other than 0.
* awareness that there may be a flag bit V with a value other than 0.
*/
*/
return
getCsrcAudioLevel
(
ssrcExtID
,
0
);
/*
* The audio levels sent by Google Chrome are in accord with the
* specification i.e. the audio level generated from a muted audio
* source is 127 and the values are non-negative. If there is no source
* audio level in this packet, return a negative value.
*/
return
getCsrcAudioLevel
(
ssrcExtID
,
0
,
Byte
.
MIN_VALUE
);
}
}
/**
/**
...
@@ -375,26 +398,30 @@ public byte[] getBuffer()
...
@@ -375,26 +398,30 @@ public byte[] getBuffer()
* @return the CSRC audio level at the specified index of the csrc audio
* @return the CSRC audio level at the specified index of the csrc audio
* level option or <tt>0</tt> if there was no level at that index.
* level option or <tt>0</tt> if there was no level at that index.
*/
*/
private
byte
getCsrcAudioLevel
(
byte
csrcExtID
,
int
index
)
private
byte
getCsrcAudioLevel
(
byte
csrcExtID
,
int
index
,
byte
defaultValue
)
{
{
if
(
!
getExtensionBit
()
||
getExtensionLength
()
==
0
)
byte
level
=
defaultValue
;
return
0
;
int
levelsStart
=
findExtension
(
csrcExtID
);
if
(
levelsStart
==
-
1
)
if
(
getExtensionBit
()
&&
getExtensionLength
()
!=
0
)
return
0
;
int
levelsCount
=
getLengthForExtension
(
levelsStart
);
if
(
levelsCount
<
index
)
{
{
//apparently the remote side sent more CSRCs than levels.
int
levelsStart
=
findExtension
(
csrcExtID
);
// ... yeah remote sides do that now and then ...
return
0
;
}
return
(
byte
)
(
0x7F
&
buffer
[
levelsStart
+
index
]);
if
(
levelsStart
!=
-
1
)
{
int
levelsCount
=
getLengthForExtension
(
levelsStart
);
if
(
levelsCount
<
index
)
{
//apparently the remote side sent more CSRCs than levels.
// ... yeah remote sides do that now and then ...
}
else
{
level
=
(
byte
)
(
0x7F
&
buffer
[
levelsStart
+
index
]);
}
}
}
return
level
;
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/org/jitsi/impl/neomedia/transform/csrc/SsrcTransformEngine.java
+
1
−
1
View file @
91744a1f
...
@@ -239,7 +239,7 @@ public RawPacket reverseTransform(RawPacket pkt)
...
@@ -239,7 +239,7 @@ public RawPacket reverseTransform(RawPacket pkt)
* Notify the AudioMediaStream associated with this instance about
* Notify the AudioMediaStream associated with this instance about
* the received audio level.
* the received audio level.
*/
*/
if
(!
dropPkt
&&
(
csrcAudioLevelDispatcher
!=
null
))
if
(!
dropPkt
&&
(
csrcAudioLevelDispatcher
!=
null
)
&&
(
level
>=
0
)
)
{
{
long
[]
levels
=
new
long
[
2
];
long
[]
levels
=
new
long
[
2
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment