Commit 866bc5c4 authored by Simon Morlat's avatar Simon Morlat
Browse files

add missing wrappers to the PayloadType object

parent 8b674d05
......@@ -3316,3 +3316,52 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_PresenceNoteImpl_getLang(JNIEnv
const char *clang = linphone_presence_note_get_lang(note);
return clang ? env->NewStringUTF(clang) : NULL;
}
/*
* Class: org_linphone_core_PayloadTypeImpl
* Method: setRecvFmtp
* Signature: (JLjava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_org_linphone_core_PayloadTypeImpl_setRecvFmtp(JNIEnv *env, jobject jobj, jlong ptr, jstring jfmtp){
PayloadType *pt=(PayloadType *)ptr;
const char *fmtp=jfmtp ? env->GetStringUTFChars(jfmtp,NULL) : NULL;
payload_type_set_recv_fmtp(pt,fmtp);
if (fmtp) env->ReleaseStringUTFChars(jfmtp,fmtp);
}
/*
* Class: org_linphone_core_PayloadTypeImpl
* Method: getRecvFmtp
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_linphone_core_PayloadTypeImpl_getRecvFmtp(JNIEnv *env, jobject jobj, jlong ptr){
PayloadType *pt=(PayloadType *)ptr;
const char *fmtp=pt->recv_fmtp;
return fmtp ? env->NewStringUTF(fmtp) : NULL;
}
/*
* Class: org_linphone_core_PayloadTypeImpl
* Method: setSendFmtp
* Signature: (JLjava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_org_linphone_core_PayloadTypeImpl_setSendFmtp(JNIEnv *env, jobject jobj, jlong ptr , jstring jfmtp){
PayloadType *pt=(PayloadType *)ptr;
const char *fmtp=jfmtp ? env->GetStringUTFChars(jfmtp,NULL) : NULL;
payload_type_set_send_fmtp(pt,fmtp);
if (fmtp) env->ReleaseStringUTFChars(jfmtp,fmtp);
}
/*
* Class: org_linphone_core_PayloadTypeImpl
* Method: getSendFmtp
* Signature: (J)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_linphone_core_PayloadTypeImpl_getSendFmtp(JNIEnv *env, jobject jobj, jlong ptr){
PayloadType *pt=(PayloadType *)ptr;
const char *fmtp=pt->send_fmtp;
return fmtp ? env->NewStringUTF(fmtp) : NULL;
}
......@@ -19,8 +19,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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();
}
......@@ -42,4 +42,26 @@ class PayloadTypeImpl implements PayloadType {
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);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment