[*] java setbitrate
This commit is contained in:
@@ -743,4 +743,13 @@ namespace acgist {
|
|||||||
env->ReleaseStringUTFChars(jConsumerId, consumerId);
|
env->ReleaseStringUTFChars(jConsumerId, consumerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" JNIEXPORT void JNICALL
|
||||||
|
Java_com_acgist_taoyao_media_client_Room_nativeSetBitrate(JNIEnv* env, jobject me, jlong nativeRoomPointer, jint minBitrate, jint maxBitrate) {
|
||||||
|
Room* room = (Room*) nativeRoomPointer;
|
||||||
|
if(room == nullptr) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
room->setBitrate(minBitrate, maxBitrate);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -382,6 +382,16 @@ public class Room extends CloseableClient implements RouterCallback {
|
|||||||
remoteClient.close();
|
remoteClient.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置码率
|
||||||
|
*
|
||||||
|
* @param minBitrate 最小码率
|
||||||
|
* @param maxBitrate 最大码率
|
||||||
|
*/
|
||||||
|
public void setBitrate(int minBitrate, int maxBitrate) {
|
||||||
|
this.nativeSetBitrate(this.nativeRoomPointer, minBitrate, maxBitrate);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
@@ -773,4 +783,13 @@ public class Room extends CloseableClient implements RouterCallback {
|
|||||||
*/
|
*/
|
||||||
private native void nativeMediaConsumerClose(long nativeRoomPointer, String consumerId);
|
private native void nativeMediaConsumerClose(long nativeRoomPointer, String consumerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mediasoup设置码率
|
||||||
|
*
|
||||||
|
* @param nativeRoomPointer 房间指针
|
||||||
|
* @param minBitrate 最小码率
|
||||||
|
* @param maxBitrate 最大码率
|
||||||
|
*/
|
||||||
|
private native void nativeSetBitrate(long nativeRoomPointer, int minBitrate, int maxBitrate);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user