adjusting timestamps when hot switching the camera

When switching cameras, the encoders must be paused. Otherwise, there will be problems with the DTS on the client,  SRS  server with enabled time_jitter incorrectly corrects video DTS (with enabled ATC  there is no problem)
camera2
thegobot 4 years ago committed by GitHub
parent 7f0fe5a82d
commit 76bc16fba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -309,6 +309,11 @@ public class SrsPublisher {
}
public void switchCameraFace(int id) {
if (mEncoder != null && mEncoder.isEnabled()) {
mEncoder.pause();
}
mCameraView.stopCamera();
mCameraView.setCameraId(id);
if (id == 0) {
@ -320,6 +325,11 @@ public class SrsPublisher {
mCameraView.enableEncoding();
}
mCameraView.startCamera();
if (mEncoder != null && mEncoder.isEnabled()) {
mEncoder.resume();
}
}
public void setRtmpHandler(RtmpHandler handler) {

Loading…
Cancel
Save