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
59f66532
Commit
59f66532
authored
12 years ago
by
Vincent Lucas
Browse files
Options
Downloads
Patches
Plain Diff
Corrects exception when rapid succession of RTP DTMFs are sent.
parent
6c8ef536
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/org/jitsi/impl/neomedia/transform/dtmf/DtmfTransformEngine.java
+10
-19
10 additions, 19 deletions
...tsi/impl/neomedia/transform/dtmf/DtmfTransformEngine.java
with
10 additions
and
19 deletions
src/org/jitsi/impl/neomedia/transform/dtmf/DtmfTransformEngine.java
+
10
−
19
View file @
59f66532
...
...
@@ -6,6 +6,7 @@
*/
package
org.jitsi.impl.neomedia.transform.dtmf
;
import
java.util.*
;
import
javax.media.*
;
import
org.jitsi.impl.neomedia.*
;
...
...
@@ -25,7 +26,6 @@ public class DtmfTransformEngine
implements
TransformEngine
,
PacketTransformer
{
/**
* The <tt>AudioMediaStreamImpl</tt> that this transform engine was created
* by and that it's going to deliver DTMF packets for.
...
...
@@ -42,13 +42,6 @@ private enum ToneTransmissionState
*/
IDLE
,
/**
* Indicates that the user has just called the {@link
* #startSending(DTMFRtpTone)} method and we haven't yet sent any of the
* packets corresponding to that particular tone.
*/
SEND_PENDING
,
/**
* Indicates that we are currently in the process of sending a DTMF
* tone, and we have already sent at least one packet.
...
...
@@ -95,7 +88,7 @@ private enum ToneTransmissionState
/**
* The tone that we are supposed to be currently transmitting.
*/
private
DTMFRtpTone
currentTone
=
n
ull
;
private
Vector
<
DTMFRtpTone
>
currentTone
=
n
ew
Vector
<
DTMFRtpTone
>(
1
,
1
)
;
/**
* The duration (in timestamp units or in other words ms*8) that we have
...
...
@@ -223,12 +216,12 @@ public RawPacket reverseTransform(RawPacket pkt)
*/
public
RawPacket
transform
(
RawPacket
pkt
)
{
if
(
this
.
toneTransmissionState
.
equals
(
ToneTransmissionState
.
IDLE
)
||
currentTone
==
null
)
if
(
currentTone
.
isEmpty
())
{
return
pkt
;
}
byte
toneCode
=
currentTone
.
firstElement
().
getCode
();
byte
currentDtmfPayload
=
mediaStream
.
getDynamicRTPPayloadType
(
Constants
.
TELEPHONE_EVENT
);
...
...
@@ -247,7 +240,7 @@ public RawPacket transform(RawPacket pkt)
boolean
pktMarker
=
false
;
int
pktDuration
=
0
;
if
(
toneTransmissionState
==
ToneTransmissionState
.
SEND_PENDING
)
if
(
toneTransmissionState
==
ToneTransmissionState
.
IDLE
)
{
currentDuration
=
0
;
currentDuration
+=
getCurrentSpacingDuration
();
...
...
@@ -296,11 +289,14 @@ else if(toneTransmissionState == ToneTransmissionState.END_SEQUENCE_INITIATED)
remainingsEndPackets
--;
if
(
remainingsEndPackets
==
0
)
{
toneTransmissionState
=
ToneTransmissionState
.
IDLE
;
currentTone
.
remove
(
0
);
}
}
dtmfPkt
.
init
(
currentTone
.
get
Code
()
,
tone
Code
,
pktEnd
,
pktMarker
,
pktDuration
,
...
...
@@ -319,12 +315,7 @@ else if(toneTransmissionState == ToneTransmissionState.END_SEQUENCE_INITIATED)
*/
public
void
startSending
(
DTMFRtpTone
tone
)
{
if
(
toneTransmissionState
!=
ToneTransmissionState
.
IDLE
)
throw
new
IllegalStateException
(
"Calling start before stopping previous transmission"
);
currentTone
=
tone
;
toneTransmissionState
=
ToneTransmissionState
.
SEND_PENDING
;
currentTone
.
add
(
tone
);
}
/**
...
...
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