Hardware video codec support
For a 1-to-1 call or a group call (conference), LINE Planet can request activation or deactivation of a hardware video codec on the user device.
This page shows how to configure settings to enable or disable a hardware video codec and how to check the result.
Supported call type | Minimum SDK version |
---|---|
1-to-1 call, group call | PlanetKit 3.2 |
LINE Planet itself does not provide an H.264 codec in order to support hardware video codec. Instead, if an H.264 hardware codec is available on the user device, LINE Planet requests activation of the H.264 hardware codec on the user device. For more information, see LINE Planet call quality.
Configure settings to enable or disable a hardware video codec
This section describes how to configure settings to enable or disable a hardware video codec based on the call type.
The activation of hardware video codec is not always guaranteed, due to the following reasons:
- In a 1-to-1 call, a hardware video codec might not be available to the peer.
- The LINE Planet team can turn off the function due to operational issues.
1-to-1 call
For 1-to-1 calls, you can configure call parameters to enable or disable a hardware video codec.
Caller side
On the caller side, set both of encoding and decoding capabilities to enable or disable a hardware video codec when making a call, as shown in the following code:
val myVideoSendCapability: PlanetKitVideoCapability = PlanetKitVideoCapability.callSendDefault()
val myVideoReceiveCapability: PlanetKitVideoCapability = PlanetKitVideoCapability.callReceiveDefault()
// For both callSendDefault() and callReceiveDefault(), the default value of preferredHwCodec is true.
// To request deactivation of hardware video codec, set both to false as follows:
// myVideoSendCapability.preferredHwCodec = false
// myVideoReceiveCapability.preferredHwCodec = false
val param = PlanetKitMakeCallParam.Builder()
.myId(myUserId)
.myServiceId(myServiceId)
.peerId(peerUserId)
.peerServiceId(peerServiceId)
.myVideoSendCapability(myVideoSendCapability)
.myVideoReceiveCapability(myVideoReceiveCapability)
.build()
val result = PlanetKit.makeCall(param, makeCallListener)
Callee side
On the callee side, set both of encoding and decoding capabilities to enable or disable a hardware video codec when verifying a call, as shown in the following code:
val myVideoSendCapability: PlanetKitVideoCapability = PlanetKitVideoCapability.callSendDefault()
val myVideoReceiveCapability: PlanetKitVideoCapability = PlanetKitVideoCapability.callReceiveDefault()
// For both callSendDefault() and callReceiveDefault(), the default value of preferredHwCodec is true.
// To request deactivation of hardware video codec, set both to false as follows:
// myVideoSendCapability.preferredHwCodec = false
// myVideoReceiveCapability.preferredHwCodec = false
val param = PlanetKitVerifyCallParam.Builder()
.myId(myUserId)
.myServiceId(myServiceId)
.peerId(peerUserId)
.peerServiceId(peerServiceId)
.myVideoSendCapability(myVideoSendCapability)
.myVideoReceiveCapability(myVideoReceiveCapability)
.build()
val result = PlanetKit.verifyCall(param, verifyCallListener)
Group call
To configure settings to enable or disable a hardware video codec in group calls, set both of encoding and decoding capabilities to enable or disable a hardware video codec when joining a conference, as shown in the following code:
val myVideoSendCapability: PlanetKitVideoCapability = PlanetKitVideoCapability.conferenceSendDefault()
// For conferenceSendDefault(), the default value of preferredHwCodec is true.
// To request deactivation of hardware video codec for encoding, set preferredHwCodec to false as follows:
// myVideoSendCapability.preferredHwCodec = false
// To enable or disable hardware video codec for decoding, set preferredPeerVideoHwCodec of PlanetKitConferenceParam to true or false.
val param = PlanetKitConferenceParam.Builder()
.myId(myUserId)
.myServiceId(myServiceId)
.roomId(roomId)
.roomServiceId(roomServiceId)
.myVideoSendCapability(myVideoSendCapability)
.preferredPeerVideoHwCodec(true)
.build()
val result = PlanetKit.joinConference(param, conferenceListener)
Check whether a hardware video codec is enabled or disabled
The result of enabling or disabling a hardware video codec is determined during a call setup process. Therefore, you must check the result after the onConnected
event occurs.
- In 1-to-1 calls, you can check whether a hardware codec is enabled or disabled using
isVideoHwCodecEnabled
of thePlanetKitCallConnectedParam
delivered byonConnected
. - In group calls, you can check whether a hardware codec is enabled or disabled using
isVideoHwCodecEnabled
delivered byonConnected
.
Related API
APIs related to hardware video codec support are as follows.
1-to-1 call
-
myVideoSendCapability()
ofPlanetKitMakeCallParam.Builder
-
myVideoReceiveCapability()
ofPlanetKitMakeCallParam.Builder
-
myVideoSendCapability()
ofPlanetKitVerifyCallParam.Builder
-
myVideoReceiveCapability()
ofPlanetKitVerifyCallParam.Builder