public class VideoCallImpl extends InCallService.VideoCall
Connection.VideoProvider
, and direct callbacks from the
Connection.VideoProvider
to the appropriate VideoCall.Listener
.
InCallService.VideoCall.Callback
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
void |
registerCallback(InCallService.VideoCall.Callback callback)
Registers a callback to receive commands and state changes for video calls.
|
void |
registerCallback(InCallService.VideoCall.Callback callback,
Handler handler)
Registers a callback to receive commands and state changes for video calls.
|
void |
requestCallDataUsage()
Issues a request to the
Connection.VideoProvider to retrieve the cumulative data
usage for the video component of the current call (in bytes). |
void |
requestCameraCapabilities()
Issues a request to the
Connection.VideoProvider to retrieve the capabilities
of the current camera. |
void |
sendSessionModifyRequest(VideoProfile requestProfile)
Sends a session modification request to the video provider.
|
void |
sendSessionModifyResponse(VideoProfile responseProfile)
Provides a response to a request to change the current call video session
properties.
|
void |
setCamera(String cameraId)
Sets the camera to be used for the outgoing video.
|
void |
setDeviceOrientation(int rotation)
Sets the device orientation, in degrees.
|
void |
setDisplaySurface(Surface surface)
Sets the surface to be used for displaying the video received from the remote device.
|
void |
setPauseImage(Uri uri)
Provides the
Connection.VideoProvider with the Uri of an image to be
displayed to the peer device when the video signal is paused. |
void |
setPreviewSurface(Surface surface)
Sets the surface to be used for displaying a preview of what the user's camera is
currently capturing.
|
void |
setVideoState(int videoState)
Sets the video state for the current video call.
|
void |
setZoom(float value)
Sets camera zoom ratio.
|
void |
unregisterCallback(InCallService.VideoCall.Callback callback)
Clears the video call callback set via
InCallService.VideoCall.registerCallback(android.telecom.InCallService.VideoCall.Callback) . |
public void destroy()
destroy
in class InCallService.VideoCall
public void registerCallback(InCallService.VideoCall.Callback callback)
registerCallback
in class InCallService.VideoCall
callback
- The video call callback.public void registerCallback(InCallService.VideoCall.Callback callback, Handler handler)
registerCallback
in class InCallService.VideoCall
callback
- The video call callback.handler
- A handler which commands and status changes will be delivered to.public void unregisterCallback(InCallService.VideoCall.Callback callback)
InCallService.VideoCall.registerCallback(android.telecom.InCallService.VideoCall.Callback)
.unregisterCallback
in class InCallService.VideoCall
callback
- The video call callback to clear.public void setCamera(String cameraId)
Handled by Connection.VideoProvider.onSetCamera(String)
.
setCamera
in class InCallService.VideoCall
cameraId
- The id of the camera (use ids as reported by
CameraManager.getCameraIdList()
).public void setPreviewSurface(Surface surface)
Handled by Connection.VideoProvider.onSetPreviewSurface(Surface)
.
setPreviewSurface
in class InCallService.VideoCall
surface
- The Surface
.public void setDisplaySurface(Surface surface)
Handled by Connection.VideoProvider.onSetDisplaySurface(Surface)
.
setDisplaySurface
in class InCallService.VideoCall
surface
- The Surface
.public void setDeviceOrientation(int rotation)
Handled by Connection.VideoProvider.onSetDeviceOrientation(int)
.
setDeviceOrientation
in class InCallService.VideoCall
rotation
- The device orientation, in degrees.public void setZoom(float value)
Handled by Connection.VideoProvider.onSetZoom(float)
.
setZoom
in class InCallService.VideoCall
value
- The camera zoom ratio.public void sendSessionModifyRequest(VideoProfile requestProfile)
The InCallService
will create the requestProfile
based on the current
video state (i.e. Call.Details.getVideoState()
). It is, however, possible that the
video state maintained by the InCallService
could get out of sync with what is known
by the Connection.VideoProvider
. To remove ambiguity, the
VideoCallImpl
passes along the pre-modify video profile to the VideoProvider
to ensure it has full context of the requested change.
sendSessionModifyRequest
in class InCallService.VideoCall
requestProfile
- The requested video profile.public void sendSessionModifyResponse(VideoProfile responseProfile)
InCallService
has
received via InCallService.VideoCall.Callback.onSessionModifyRequestReceived(android.telecom.VideoProfile)
.
Handled by
Connection.VideoProvider.onSendSessionModifyResponse(VideoProfile)
.
sendSessionModifyResponse
in class InCallService.VideoCall
responseProfile
- The response call video properties.public void requestCameraCapabilities()
Connection.VideoProvider
to retrieve the capabilities
of the current camera. The current camera is selected using
InCallService.VideoCall.setCamera(String)
.
Camera capabilities are reported to the caller via
InCallService.VideoCall.Callback.onCameraCapabilitiesChanged(VideoProfile.CameraCapabilities)
.
Handled by Connection.VideoProvider.onRequestCameraCapabilities()
.
requestCameraCapabilities
in class InCallService.VideoCall
public void requestCallDataUsage()
Connection.VideoProvider
to retrieve the cumulative data
usage for the video component of the current call (in bytes). Data usage is reported
to the caller via InCallService.VideoCall.Callback.onCallDataUsageChanged(long)
.
Handled by Connection.VideoProvider.onRequestConnectionDataUsage()
.
requestCallDataUsage
in class InCallService.VideoCall
public void setPauseImage(Uri uri)
Connection.VideoProvider
with the Uri
of an image to be
displayed to the peer device when the video signal is paused.
Handled by Connection.VideoProvider.onSetPauseImage(Uri)
.
setPauseImage
in class InCallService.VideoCall
uri
- URI of image to display.public void setVideoState(int videoState)
videoState
- the new video state.