Search in sources :

Example 1 with VideoProfile

use of android.telecom.VideoProfile in project android_packages_apps_Dialer by LineageOS.

the class ImsVideoTech method resumeTransmission.

@Override
public void resumeTransmission() {
    LogUtil.enterBlock("ImsVideoTech.resumeTransmission");
    transmissionStopped = false;
    int unpausedVideoState = getUnpausedVideoState(call.getDetails().getVideoState());
    call.getVideoCall().sendSessionModifyRequest(new VideoProfile(unpausedVideoState | VideoProfile.STATE_TX_ENABLED));
    setSessionModificationState(SessionModificationState.WAITING_FOR_RESPONSE);
}
Also used : VideoProfile(android.telecom.VideoProfile)

Example 2 with VideoProfile

use of android.telecom.VideoProfile in project android_packages_apps_Dialer by LineageOS.

the class ImsVideoTech method acceptVideoRequest.

@Override
public void acceptVideoRequest() {
    int requestedVideoState = callback.getRequestedVideoState();
    Assert.checkArgument(requestedVideoState != VideoProfile.STATE_AUDIO_ONLY);
    LogUtil.i("ImsVideoTech.acceptUpgradeRequest", "videoState: " + requestedVideoState);
    call.getVideoCall().sendSessionModifyResponse(new VideoProfile(requestedVideoState));
    setSessionModificationState(SessionModificationState.NO_REQUEST);
    // Telecom manages audio route for us
    listener.onUpgradedToVideo(false);
    logger.logImpression(DialerImpression.Type.IMS_VIDEO_REQUEST_ACCEPTED);
}
Also used : VideoProfile(android.telecom.VideoProfile)

Example 3 with VideoProfile

use of android.telecom.VideoProfile in project android_packages_apps_Dialer by LineageOS.

the class ImsVideoTech method upgradeToVideo.

@Override
public void upgradeToVideo() {
    LogUtil.enterBlock("ImsVideoTech.upgradeToVideo");
    int unpausedVideoState = getUnpausedVideoState(call.getDetails().getVideoState());
    call.getVideoCall().sendSessionModifyRequest(new VideoProfile(unpausedVideoState | VideoProfile.STATE_BIDIRECTIONAL));
    setSessionModificationState(SessionModificationState.WAITING_FOR_UPGRADE_TO_VIDEO_RESPONSE);
    logger.logImpression(DialerImpression.Type.IMS_VIDEO_UPGRADE_REQUESTED);
}
Also used : VideoProfile(android.telecom.VideoProfile)

Example 4 with VideoProfile

use of android.telecom.VideoProfile in project android_packages_apps_Dialer by MoKee.

the class ImsVideoTech method unpause.

@Override
public void unpause() {
    if (call.getState() != Call.STATE_ACTIVE) {
        LogUtil.i("ImsVideoTech.unpause", "not unpausing because call is not active");
        return;
    }
    if (!isTransmittingOrReceiving()) {
        LogUtil.i("ImsVideoTech.unpause", "not unpausing because this is not a video call");
        return;
    }
    if (!paused) {
        LogUtil.i("ImsVideoTech.unpause", "already unpaused");
        return;
    }
    paused = false;
    if (canPause()) {
        LogUtil.i("ImsVideoTech.unpause", "sending unpause request");
        int unpausedVideoState = getUnpausedVideoState(call.getDetails().getVideoState());
        if (transmissionStopped && VideoProfile.isTransmissionEnabled(unpausedVideoState)) {
            LogUtil.i("ImsVideoTech.unpause", "overriding TX to false due to user request");
            unpausedVideoState &= ~VideoProfile.STATE_TX_ENABLED;
        }
        call.getVideoCall().sendSessionModifyRequest(new VideoProfile(unpausedVideoState));
    } else {
        // This video call does not support pause so we fall back to re-enabling the camera
        LogUtil.i("ImsVideoTech.pause", "re-enabling camera");
        setCamera(savedCameraId);
    }
}
Also used : VideoProfile(android.telecom.VideoProfile)

Example 5 with VideoProfile

use of android.telecom.VideoProfile in project android_packages_apps_Dialer by MoKee.

the class ImsVideoTech method stopTransmission.

@Override
public void stopTransmission() {
    LogUtil.enterBlock("ImsVideoTech.stopTransmission");
    transmissionStopped = true;
    int unpausedVideoState = getUnpausedVideoState(call.getDetails().getVideoState());
    call.getVideoCall().sendSessionModifyRequest(new VideoProfile(unpausedVideoState & ~VideoProfile.STATE_TX_ENABLED));
}
Also used : VideoProfile(android.telecom.VideoProfile)

Aggregations

VideoProfile (android.telecom.VideoProfile)34 SmallTest (androidx.test.filters.SmallTest)4 Test (org.junit.Test)4 VideoCall (android.telecom.InCallService.VideoCall)3 Context (android.content.Context)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 Resources (android.content.res.Resources)1 Uri (android.net.Uri)1 Bundle (android.os.Bundle)1 Connection (android.telecom.Connection)1 Surface (android.view.Surface)1 Call (com.cometchat.pro.core.Call)1 ArrayList (java.util.ArrayList)1