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:
let myVideoSendCapability: PlanetKitVideoCapability = PlanetKitVideoCapability.callSendDefault
let 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
let makeCallSettings = try! PlanetKitMakeCallSettingBuilder()
.withMyVideoSendCapabilityKey(capability: myVideoSendCapability)
.withMyVideoReceiveCapabilityKey(capability: myVideoReceiveCapability)
.build()
let param = PlanetKitCallParam(myUserId: myUserId, peerUserId: peerUserId, delegate: delegate, accessToken: accessToken)
let result = PlanetKitManager.shared.makeCall(param: param, settings: makeCallSettings)
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:
let myVideoSendCapability: PlanetKitVideoCapability = PlanetKitVideoCapability.callSendDefault
let 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
let verifyCallSettings = try! PlanetKitVerifyCallSettingBuilder()
.withMyVideoSendCapabilityKey(capability: myVideoSendCapability)
.withMyVideoReceiveCapabilityKey(capability: myVideoReceiveCapability)
.build()
let result = PlanetKitManager.shared.verifyCall(myUserId: myUserId, ccParam: ccParam, settings: verifyCallSettings)
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:
let 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 withMyVideoRecvPreferredHwCodecKey(enable:) of PlanetKitJoinConferenceSettingBuilder to true or false.
let joinConferenceSettings = try! PlanetKitJoinConferenceSettingBuilder()
.withMyVideoSendCapabilityKey(capability: myVideoSendCapability)
.withMyVideoRecvPreferredHwCodecKey(enable: true)
.build()
let param = PlanetKitConferenceParam(myUserId: myUserId, roomId: roomId, roomServiceId: roomServiceId, delegate: delegate, accessToken: accessToken)
let result = PlanetKitManager.shared.joinConference(param: param, settings: joinConferenceSettings)
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 didConnect
event occurs.
- In 1-to-1 calls, you can check whether a hardware codec is enabled or disabled using
isVideoHwCodecEnabled
of thePlanetKitCallConnectedParam
delivered bydidConnect
. - In group calls, you can check whether a hardware codec is enabled or disabled using
isVideoHwCodecEnabled
of thePlanetKitConferenceConnectedParam
delivered bydidConnect
.
Related API
APIs related to hardware video codec support are as follows.
1-to-1 call
-
withMyVideoSendCapabilityKey()
ofPlanetKitMakeCallSettingBuilder
iOS, macOS -
withMyVideoReceiveCapabilityKey()
ofPlanetKitMakeCallSettingBuilder
iOS, macOS -
withMyVideoSendCapabilityKey()
ofPlanetKitVerifyCallSettingBuilder
iOS, macOS -
withMyVideoReceiveCapabilityKey()
ofPlanetKitVerifyCallSettingBuilder
iOS, macOS