public class ImsVideoCallProviderWrapper extends Connection.VideoProvider
Connection.VideoProvider
. This intermediates and
communicates with the actual implementation of the video call provider in the IMS service; it is
in essence, a wrapper around the IMS's video call provider implementation.
This class maintains a binder by which the ImsVideoCallProvider's implementation can communicate
its intent to invoke callbacks. In this class, the message across this binder is handled, and
the superclass's methods are used to execute the callbacks.Modifier and Type | Class and Description |
---|---|
static interface |
ImsVideoCallProviderWrapper.ImsVideoProviderWrapperCallback |
SESSION_EVENT_CAMERA_FAILURE, SESSION_EVENT_CAMERA_READY, SESSION_EVENT_RX_PAUSE, SESSION_EVENT_RX_RESUME, SESSION_EVENT_TX_START, SESSION_EVENT_TX_STOP, SESSION_MODIFY_REQUEST_FAIL, SESSION_MODIFY_REQUEST_INVALID, SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE, SESSION_MODIFY_REQUEST_SUCCESS, SESSION_MODIFY_REQUEST_TIMED_OUT
Constructor and Description |
---|
ImsVideoCallProviderWrapper(IImsVideoCallProvider VideoProvider)
Instantiates an instance of the ImsVideoCallProvider, taking in the binder for IMS's video
call provider implementation.
|
Modifier and Type | Method and Description |
---|---|
void |
addImsVideoProviderCallback(ImsVideoCallProviderWrapper.ImsVideoProviderWrapperCallback callback) |
void |
onRequestCameraCapabilities()
Issues a request to the
Connection.VideoProvider to retrieve the camera capabilities. |
void |
onRequestConnectionDataUsage()
Issues a request to the
Connection.VideoProvider to retrieve the current data usage for the
video component of the current Connection . |
void |
onSendSessionModifyRequest(VideoProfile fromProfile,
VideoProfile toProfile)
Issues a request to modify the properties of the current video session.
|
void |
onSendSessionModifyResponse(VideoProfile responseProfile)
Provides a response to a request to change the current video session properties.
|
void |
onSetCamera(String cameraId)
Sets the camera to be used for the outgoing video.
|
void |
onSetDeviceOrientation(int rotation)
Sets the device orientation, in degrees.
|
void |
onSetDisplaySurface(Surface surface)
Sets the surface to be used for displaying the video received from the remote device.
|
void |
onSetPauseImage(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 |
onSetPreviewSurface(Surface surface)
Sets the surface to be used for displaying a preview of what the user's camera is
currently capturing.
|
void |
onSetZoom(float value)
Sets camera zoom ratio.
|
void |
registerForDataUsageUpdate(Handler h,
int what,
Object obj) |
void |
removeImsVideoProviderCallback(ImsVideoCallProviderWrapper.ImsVideoProviderWrapperCallback callback) |
void |
unregisterForDataUsageUpdate(Handler h) |
changeCallDataUsage, changeCameraCapabilities, changePeerDimensions, changeVideoQuality, getInterface, handleCallSessionEvent, receiveSessionModifyRequest, receiveSessionModifyResponse, sessionEventToString, setCallDataUsage
public ImsVideoCallProviderWrapper(IImsVideoCallProvider VideoProvider) throws RemoteException
VideoProvider
- RemoteException
public void unregisterForDataUsageUpdate(Handler h)
public void addImsVideoProviderCallback(ImsVideoCallProviderWrapper.ImsVideoProviderWrapperCallback callback)
public void removeImsVideoProviderCallback(ImsVideoCallProviderWrapper.ImsVideoProviderWrapperCallback callback)
public void onSetCamera(String cameraId)
Connection.VideoProvider
The Connection.VideoProvider
should respond by communicating the capabilities of the chosen
camera via
Connection.VideoProvider.changeCameraCapabilities(VideoProfile.CameraCapabilities)
.
Sent from the InCallService
via
InCallService.VideoCall.setCamera(String)
.
onSetCamera
in class Connection.VideoProvider
cameraId
- The id of the camera (use ids as reported by
CameraManager.getCameraIdList()
).public void onSetPreviewSurface(Surface surface)
Connection.VideoProvider
Sent from the InCallService
via
InCallService.VideoCall.setPreviewSurface(Surface)
.
onSetPreviewSurface
in class Connection.VideoProvider
surface
- The Surface
.public void onSetDisplaySurface(Surface surface)
Connection.VideoProvider
Sent from the InCallService
via
InCallService.VideoCall.setDisplaySurface(Surface)
.
onSetDisplaySurface
in class Connection.VideoProvider
surface
- The Surface
.public void onSetDeviceOrientation(int rotation)
Connection.VideoProvider
Sent from the InCallService
via
InCallService.VideoCall.setDeviceOrientation(int)
.
onSetDeviceOrientation
in class Connection.VideoProvider
rotation
- The device orientation, in degrees.public void onSetZoom(float value)
Connection.VideoProvider
Sent from the InCallService
via InCallService.VideoCall.setZoom(float)
.
onSetZoom
in class Connection.VideoProvider
value
- The camera zoom ratio.public void onSendSessionModifyRequest(VideoProfile fromProfile, VideoProfile toProfile)
Connection.VideoProvider
Example scenarios include: requesting an audio-only call to be upgraded to a
bi-directional video call, turning on or off the user's camera, sending a pause signal
when the InCallService
is no longer the foreground application.
If the Connection.VideoProvider
determines a request to be invalid, it should call
Connection.VideoProvider.receiveSessionModifyResponse(int, VideoProfile, VideoProfile)
to report the
invalid request back to the InCallService
.
Where a request requires confirmation from the user of the peer device, the
Connection.VideoProvider
must communicate the request to the peer device and handle the
user's response. Connection.VideoProvider.receiveSessionModifyResponse(int, VideoProfile, VideoProfile)
is used to inform the InCallService
of the result of the request.
Sent from the InCallService
via
InCallService.VideoCall.sendSessionModifyRequest(VideoProfile)
.
onSendSessionModifyRequest
in class Connection.VideoProvider
fromProfile
- The video profile prior to the request.toProfile
- The video profile with the requested changes made.public void onSendSessionModifyResponse(VideoProfile responseProfile)
Connection.VideoProvider
For example, if the peer requests and upgrade from an audio-only call to a bi-directional
video call, could decline the request and keep the call as audio-only.
In such a scenario, the responseProfile
would have a video state of
VideoProfile.STATE_AUDIO_ONLY
. If the user had decided to accept the request,
the video state would be VideoProfile.STATE_BIDIRECTIONAL
.
Sent from the InCallService
via
InCallService.VideoCall.sendSessionModifyResponse(VideoProfile)
in response to
a InCallService.VideoCall.Callback.onSessionModifyRequestReceived(VideoProfile)
callback.
onSendSessionModifyResponse
in class Connection.VideoProvider
responseProfile
- The response video profile.public void onRequestCameraCapabilities()
Connection.VideoProvider
Connection.VideoProvider
to retrieve the camera capabilities.
The Connection.VideoProvider
should respond by communicating the capabilities of the chosen
camera via
Connection.VideoProvider.changeCameraCapabilities(VideoProfile.CameraCapabilities)
.
Sent from the InCallService
via
InCallService.VideoCall.requestCameraCapabilities()
.
onRequestCameraCapabilities
in class Connection.VideoProvider
public void onRequestConnectionDataUsage()
Connection.VideoProvider
Connection.VideoProvider
to retrieve the current data usage for the
video component of the current Connection
.
The Connection.VideoProvider
should respond by communicating current data usage, in bytes,
via Connection.VideoProvider.setCallDataUsage(long)
.
Sent from the InCallService
via
InCallService.VideoCall.requestCallDataUsage()
.
onRequestConnectionDataUsage
in class Connection.VideoProvider
public void onSetPauseImage(Uri uri)
Connection.VideoProvider
Connection.VideoProvider
with the Uri
of an image to be displayed to
the peer device when the video signal is paused.
Sent from the InCallService
via
InCallService.VideoCall.setPauseImage(Uri)
.
onSetPauseImage
in class Connection.VideoProvider
uri
- URI of image to display.