mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Don't start VideoCapturer until video enabled.
Should help with battery consumption on audio-only calls Fixes #6259 // FREEBIE
This commit is contained in:
parent
f4a7f354c5
commit
cb9f225f59
@ -79,7 +79,6 @@ public class PeerConnectionWrapper {
|
|||||||
|
|
||||||
if (videoCapturer != null) {
|
if (videoCapturer != null) {
|
||||||
this.videoSource = factory.createVideoSource(videoCapturer);
|
this.videoSource = factory.createVideoSource(videoCapturer);
|
||||||
this.videoCapturer.startCapture(1280, 720, 30);
|
|
||||||
this.videoTrack = factory.createVideoTrack("ARDAMSv0", videoSource);
|
this.videoTrack = factory.createVideoTrack("ARDAMSv0", videoSource);
|
||||||
|
|
||||||
this.videoTrack.addRenderer(new VideoRenderer(localRenderer));
|
this.videoTrack.addRenderer(new VideoRenderer(localRenderer));
|
||||||
@ -97,6 +96,15 @@ public class PeerConnectionWrapper {
|
|||||||
if (this.videoTrack != null) {
|
if (this.videoTrack != null) {
|
||||||
this.videoTrack.setEnabled(enabled);
|
this.videoTrack.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.videoCapturer != null) {
|
||||||
|
try {
|
||||||
|
if (enabled) this.videoCapturer.startCapture(1280, 720, 30);
|
||||||
|
else this.videoCapturer.stopCapture();
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
Log.w(TAG, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAudioEnabled(boolean enabled) {
|
public void setAudioEnabled(boolean enabled) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user