[*] setBitrate
This commit is contained in:
@@ -8,7 +8,11 @@
|
||||
#include "sdk/android/native_api/jni/scoped_java_ref.h"
|
||||
|
||||
#include "Log.hpp"
|
||||
#define private public
|
||||
#define protected public
|
||||
#include "RouterCallback.hpp"
|
||||
#undef private
|
||||
#undef protected
|
||||
|
||||
/**
|
||||
* 视频房间头文件
|
||||
@@ -175,6 +179,13 @@ namespace acgist {
|
||||
* @param env JNIEnv
|
||||
*/
|
||||
void closeRoom(JNIEnv* env);
|
||||
/**
|
||||
* 设置码率
|
||||
*
|
||||
* @param minBitrate 最小码率
|
||||
* @param maxBitrate 最大码率
|
||||
*/
|
||||
void setBitrate(int minBitrate, int maxBitrate);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -552,6 +552,22 @@ namespace acgist {
|
||||
this->closeRoomCallback(env);
|
||||
}
|
||||
|
||||
void Room::setBitrate(int minBitrate, int maxBitrate) {
|
||||
if(
|
||||
this->sendTransport == nullptr ||
|
||||
this->sendTransport->handler == nullptr ||
|
||||
this->sendTransport->handler->pc == nullptr ||
|
||||
this->sendTransport->handler->pc->pc == nullptr
|
||||
) {
|
||||
return;
|
||||
}
|
||||
webrtc::BitrateSettings settings;
|
||||
settings.min_bitrate_bps = minBitrate;
|
||||
settings.max_bitrate_bps = maxBitrate;
|
||||
settings.start_bitrate_bps = minBitrate;
|
||||
this->sendTransport->handler->pc->pc->SetBitrate(settings);
|
||||
}
|
||||
|
||||
extern "C" JNIEXPORT jlong JNICALL
|
||||
Java_com_acgist_taoyao_media_client_Room_nativeNewRoom(
|
||||
JNIEnv* env, jobject me,
|
||||
|
||||
@@ -207,7 +207,7 @@ public final class DateUtils {
|
||||
*
|
||||
* @return 日期字符串
|
||||
*/
|
||||
public static String format(LocalDate localDate, DateStyle format) {
|
||||
public static final String format(LocalDate localDate, DateStyle format) {
|
||||
return localDate != null && format != null ? format.getDateTimeFormatter().format(localDate) : null;
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ public final class DateUtils {
|
||||
*
|
||||
* @return 时间字符串
|
||||
*/
|
||||
public static String format(LocalTime localTime, TimeStyle format) {
|
||||
public static final String format(LocalTime localTime, TimeStyle format) {
|
||||
return localTime != null && format != null ? format.getDateTimeFormatter().format(localTime) : null;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ public final class DateUtils {
|
||||
*
|
||||
* @return 日期时间字符串
|
||||
*/
|
||||
public static String format(LocalDateTime localDateTime, DateTimeStyle format) {
|
||||
public static final String format(LocalDateTime localDateTime, DateTimeStyle format) {
|
||||
return localDateTime != null && format != null ? format.getDateTimeFormatter().format(localDateTime) : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user