Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, WebRTC is moving the content of the src/webrtc directory up to the src/ directory. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true TBR=tommi@webrtc.org Bug: chromium:611808 Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38 Reviewed-on: https://webrtc-review.googlesource.com/1560 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Henrik Kjellander <kjellander@webrtc.org> Cr-Commit-Position: refs/heads/master@{#19845}
This commit is contained in:
committed by
Commit Bot
parent
6674846b4a
commit
bb547203bf
83
sdk/android/api/org/webrtc/DtmfSender.java
Normal file
83
sdk/android/api/org/webrtc/DtmfSender.java
Normal file
@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
package org.webrtc;
|
||||
|
||||
/** Java wrapper for a C++ DtmfSenderInterface. */
|
||||
public class DtmfSender {
|
||||
final long nativeDtmfSender;
|
||||
|
||||
public DtmfSender(long nativeDtmfSender) {
|
||||
this.nativeDtmfSender = nativeDtmfSender;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true if this DtmfSender is capable of sending DTMF. Otherwise false.
|
||||
*/
|
||||
public boolean canInsertDtmf() {
|
||||
return nativeCanInsertDtmf(nativeDtmfSender);
|
||||
}
|
||||
|
||||
/**
|
||||
* Queues a task that sends the provided DTMF tones.
|
||||
* <p>
|
||||
* If insertDtmf is called on the same object while an existing task for this
|
||||
* object to generate DTMF is still running, the previous task is canceled.
|
||||
*
|
||||
* @param tones This parameter is treated as a series of characters. The characters 0
|
||||
* through 9, A through D, #, and * generate the associated DTMF tones. The
|
||||
* characters a to d are equivalent to A to D. The character ',' indicates a
|
||||
* delay of 2 seconds before processing the next character in the tones
|
||||
* parameter. Unrecognized characters are ignored.
|
||||
* @param duration Indicates the duration in ms to use for each character passed in the tones
|
||||
* parameter. The duration cannot be more than 6000 or less than 70.
|
||||
* @param interToneGap Indicates the gap between tones in ms. Must be at least 50 ms but should be
|
||||
* as short as possible.
|
||||
* @return true on success and false on failure.
|
||||
*/
|
||||
public boolean insertDtmf(String tones, int duration, int interToneGap) {
|
||||
return nativeInsertDtmf(nativeDtmfSender, tones, duration, interToneGap);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The tones remaining to be played out
|
||||
*/
|
||||
public String tones() {
|
||||
return nativeTones(nativeDtmfSender);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The current tone duration value in ms. This value will be the value last set via the
|
||||
* insertDtmf() method, or the default value of 100 ms if insertDtmf() was never called.
|
||||
*/
|
||||
public int duration() {
|
||||
return nativeDuration(nativeDtmfSender);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The current value of the between-tone gap in ms. This value will be the value last set
|
||||
* via the insertDtmf() method, or the default value of 50 ms if insertDtmf() was never
|
||||
* called.
|
||||
*/
|
||||
public int interToneGap() {
|
||||
return nativeInterToneGap(nativeDtmfSender);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
JniCommon.nativeReleaseRef(nativeDtmfSender);
|
||||
}
|
||||
|
||||
private static native boolean nativeCanInsertDtmf(long nativeDtmfSender);
|
||||
private static native boolean nativeInsertDtmf(
|
||||
long nativeDtmfSender, String tones, int duration, int interToneGap);
|
||||
private static native String nativeTones(long nativeDtmfSender);
|
||||
private static native int nativeDuration(long nativeDtmfSender);
|
||||
private static native int nativeInterToneGap(long nativeDtmfSender);
|
||||
};
|
||||
Reference in New Issue
Block a user