说明
这个类主要是设置一些类型的参数,如MIME, RATE, FMTP等
功能
- 设置MIME
- 设置RATE
- 设置FMT
UML类图
PayloadType.java
package org.linphone.core;
public interface PayloadType {
/**
* Obtain the registered mime-type (actually submime) of the PayloadType. For example: "H264", "speex"...
* @return the (sub) mime type.
*/
String getMime();
/**
* Return the RTP clockrate. It is usually the same as the audio sampling rate, and 90000 for video payload types.
* @return
*/
int getRate();
/**
* Set format parameter string wished for incoming stream. It is advertised in SDP.
* @param fmtp the fmtp string, like "octet-align=1;mode-set=4,5,6,7"
*/
void setRecvFmtp(String fmtp);
/**
* Return the format parameters wished for incoming stream.
* @return the format parameter string.
*/
String getRecvFmtp();
/**
* Set the format parameter effective for the outgoing stream (unusual).
* @param fmtp
*/
void setSendFmtp(String fmtp);
/**
* Return the format parameter effective for the outgoing stream.
* @return
*/
String getSendFmtp();
}
PayloadTypeImpl.java
package org.linphone.core;
class PayloadTypeImpl implements PayloadType {
public final long nativePtr;
private native String toString(long ptr);
private native String getMime(long ptr);
private native int getRate(long ptr);
protected PayloadTypeImpl(long aNativePtr) {
nativePtr = aNativePtr;
}
public int getRate() {
return getRate(nativePtr);
}
public String getMime() {
return getMime(nativePtr);
}
public String toString() {
return toString(nativePtr);
}
private native void setRecvFmtp(long ptr, String fmtp);
@Override
public void setRecvFmtp(String fmtp) {
setRecvFmtp(nativePtr,fmtp);
}
private native String getRecvFmtp(long ptr);
@Override
public String getRecvFmtp() {
return getRecvFmtp(nativePtr);
}
private native void setSendFmtp(long ptr, String fmtp);
@Override
public void setSendFmtp(String fmtp) {
setSendFmtp(nativePtr,fmtp);
}
private native String getSendFmtp(long ptr);
@Override
public String getSendFmtp() {
return getSendFmtp(nativePtr);
}
}