[*] 日常优化
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
# 计划任务
|
# 计划任务
|
||||||
|
|
||||||
如果优化代码影响已经优化过的代码需要对旧代码重新优化
|
|
||||||
|
|
||||||
## 日常任务
|
## 日常任务
|
||||||
|
|
||||||
* 过时方法
|
* 过时方法
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.webrtc.AudioSource;
|
import org.webrtc.AudioSource;
|
||||||
import org.webrtc.AudioTrack;
|
import org.webrtc.AudioTrack;
|
||||||
import org.webrtc.Camera2Enumerator;
|
import org.webrtc.Camera2Enumerator;
|
||||||
|
import org.webrtc.CameraEnumerationAndroid;
|
||||||
import org.webrtc.CameraEnumerator;
|
import org.webrtc.CameraEnumerator;
|
||||||
import org.webrtc.CameraVideoCapturer;
|
import org.webrtc.CameraVideoCapturer;
|
||||||
import org.webrtc.CapturerObserver;
|
import org.webrtc.CapturerObserver;
|
||||||
@@ -46,6 +47,7 @@ import org.webrtc.audio.JavaAudioDeviceModule;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
@@ -512,6 +514,10 @@ public final class MediaManager {
|
|||||||
final CameraEnumerator cameraEnumerator = new Camera2Enumerator(this.context);
|
final CameraEnumerator cameraEnumerator = new Camera2Enumerator(this.context);
|
||||||
final String[] names = cameraEnumerator.getDeviceNames();
|
final String[] names = cameraEnumerator.getDeviceNames();
|
||||||
for (String name : names) {
|
for (String name : names) {
|
||||||
|
final List<CameraEnumerationAndroid.CaptureFormat> list = cameraEnumerator.getSupportedFormats(name);
|
||||||
|
list.forEach(value -> {
|
||||||
|
Log.d(MediaManager.class.getSimpleName(), "支持的分辨率:" + name + " = " + value.width + "*" + value.height);
|
||||||
|
});
|
||||||
if (this.videoSourceType == VideoSourceType.BACK && cameraEnumerator.isBackFacing(name)) {
|
if (this.videoSourceType == VideoSourceType.BACK && cameraEnumerator.isBackFacing(name)) {
|
||||||
this.videoCapturer = cameraEnumerator.createCapturer(name, new MediaCameraEventsHandler());
|
this.videoCapturer = cameraEnumerator.createCapturer(name, new MediaCameraEventsHandler());
|
||||||
} else if (this.videoSourceType == VideoSourceType.FRONT && cameraEnumerator.isFrontFacing(name)) {
|
} else if (this.videoSourceType == VideoSourceType.FRONT && cameraEnumerator.isFrontFacing(name)) {
|
||||||
|
|||||||
@@ -109,9 +109,7 @@ public class Room extends OperatorAdapter {
|
|||||||
* @return 是否认证
|
* @return 是否认证
|
||||||
*/
|
*/
|
||||||
public boolean authenticate(Client client) {
|
public boolean authenticate(Client client) {
|
||||||
return
|
return this.mediaClient == client || this.clients.containsKey(client);
|
||||||
this.mediaClient == client ||
|
|
||||||
this.clients.containsKey(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user