mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-26 09:02:34 -06:00
34 lines
1.3 KiB
Java
34 lines
1.3 KiB
Java
package org.webrtc;
|
|
|
|
import org.webrtc.VideoFrame;
|
|
import org.webrtc.VideoProcessor;
|
|
|
|
/* loaded from: classes3.dex */
|
|
class NativeCapturerObserver implements CapturerObserver {
|
|
private final NativeAndroidVideoTrackSource nativeAndroidVideoTrackSource;
|
|
|
|
public NativeCapturerObserver(long j) {
|
|
this.nativeAndroidVideoTrackSource = new NativeAndroidVideoTrackSource(j);
|
|
}
|
|
|
|
@Override // org.webrtc.CapturerObserver
|
|
public void onCapturerStarted(boolean z) {
|
|
this.nativeAndroidVideoTrackSource.setState(z);
|
|
}
|
|
|
|
@Override // org.webrtc.CapturerObserver
|
|
public void onCapturerStopped() {
|
|
this.nativeAndroidVideoTrackSource.setState(false);
|
|
}
|
|
|
|
@Override // org.webrtc.CapturerObserver
|
|
public void onFrameCaptured(VideoFrame videoFrame) {
|
|
VideoProcessor.FrameAdaptationParameters adaptFrame = this.nativeAndroidVideoTrackSource.adaptFrame(videoFrame);
|
|
if (adaptFrame == null) {
|
|
return;
|
|
}
|
|
VideoFrame.Buffer cropAndScale = videoFrame.getBuffer().cropAndScale(adaptFrame.cropX, adaptFrame.cropY, adaptFrame.cropWidth, adaptFrame.cropHeight, adaptFrame.scaleWidth, adaptFrame.scaleHeight);
|
|
this.nativeAndroidVideoTrackSource.onFrameCaptured(new VideoFrame(cropAndScale, videoFrame.getRotation(), adaptFrame.timestampNs));
|
|
cropAndScale.release();
|
|
}
|
|
}
|