1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License 15 */ 16 17 package com.android.incallui.videotech; 18 19 import android.content.Context; 20 import com.android.incallui.video.protocol.VideoCallScreen; 21 import com.android.incallui.video.protocol.VideoCallScreenDelegate; 22 import com.android.incallui.videotech.utils.SessionModificationState; 23 24 /** Video calling interface. */ 25 public interface VideoTech { 26 isAvailable(Context context)27 boolean isAvailable(Context context); 28 isTransmittingOrReceiving()29 boolean isTransmittingOrReceiving(); 30 31 /** 32 * Determines if the answer video UI should open the camera directly instead of letting the video 33 * tech manage the camera. 34 */ isSelfManagedCamera()35 boolean isSelfManagedCamera(); 36 shouldUseSurfaceView()37 boolean shouldUseSurfaceView(); 38 createVideoCallScreenDelegate( Context context, VideoCallScreen videoCallScreen)39 VideoCallScreenDelegate createVideoCallScreenDelegate( 40 Context context, VideoCallScreen videoCallScreen); 41 onCallStateChanged(Context context, int newState)42 void onCallStateChanged(Context context, int newState); 43 44 @SessionModificationState getSessionModificationState()45 int getSessionModificationState(); 46 upgradeToVideo()47 void upgradeToVideo(); 48 acceptVideoRequest()49 void acceptVideoRequest(); 50 acceptVideoRequestAsAudio()51 void acceptVideoRequestAsAudio(); 52 declineVideoRequest()53 void declineVideoRequest(); 54 isTransmitting()55 boolean isTransmitting(); 56 stopTransmission()57 void stopTransmission(); 58 resumeTransmission()59 void resumeTransmission(); 60 pause()61 void pause(); 62 unpause()63 void unpause(); 64 setCamera(String cameraId)65 void setCamera(String cameraId); 66 setDeviceOrientation(int rotation)67 void setDeviceOrientation(int rotation); 68 69 /** Listener for video call events. */ 70 interface VideoTechListener { 71 onVideoTechStateChanged()72 void onVideoTechStateChanged(); 73 onSessionModificationStateChanged()74 void onSessionModificationStateChanged(); 75 onCameraDimensionsChanged(int width, int height)76 void onCameraDimensionsChanged(int width, int height); 77 onPeerDimensionsChanged(int width, int height)78 void onPeerDimensionsChanged(int width, int height); 79 onVideoUpgradeRequestReceived()80 void onVideoUpgradeRequestReceived(); 81 onUpgradedToVideo(boolean switchToSpeaker)82 void onUpgradedToVideo(boolean switchToSpeaker); 83 } 84 } 85