开始USB摄像头的功能集成,还无法获取usb连接广播需要调试

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
(cherry picked from commit b10306fc45)
This commit is contained in:
donghongyu
2022-02-10 18:47:07 +08:00
parent 1ead45ac73
commit cdee266805
68 changed files with 10519 additions and 598 deletions

View File

@@ -0,0 +1,40 @@
package com.serenegiant.utils;
import android.annotation.SuppressLint;
import android.os.SystemClock;
public class Time {
public static boolean prohibitElapsedRealtimeNanos = true;
private static Time sTime;
static {
reset();
}
public static long nanoTime() {
return sTime.timeNs();
}
public static void reset() {
if (!prohibitElapsedRealtimeNanos && BuildCheck.isJellyBeanMr1()) {
sTime = new TimeJellyBeanMr1();
} else {
sTime = new Time();
}
}
private Time() {
}
@SuppressLint("NewApi")
private static class TimeJellyBeanMr1 extends Time {
public long timeNs() {
return SystemClock.elapsedRealtimeNanos();
}
}
protected long timeNs() {
return System.nanoTime();
}
}