Skip to main content
Version: 5.5

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 typeMinimum SDK version
1-to-1 call, group callPlanetKit 3.2
Note

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.

Note

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 the PlanetKitCallConnectedParam delivered by didConnect.
  • In group calls, you can check whether a hardware codec is enabled or disabled using isVideoHwCodecEnabled of the PlanetKitConferenceConnectedParam delivered by didConnect.

APIs related to hardware video codec support are as follows.

1-to-1 call

  • withMyVideoSendCapabilityKey() of PlanetKitMakeCallSettingBuilder iOS, macOS
  • withMyVideoReceiveCapabilityKey() of PlanetKitMakeCallSettingBuilder iOS, macOS
  • withMyVideoSendCapabilityKey() of PlanetKitVerifyCallSettingBuilder iOS, macOS
  • withMyVideoReceiveCapabilityKey() of PlanetKitVerifyCallSettingBuilder iOS, macOS

Group call

  • withMyVideoSendCapabilityKey() of PlanetKitJoinConferenceSettingBuilder iOS, macOS
  • withMyVideoRecvPreferredHwCodecKey() of PlanetKitJoinConferenceSettingBuilder iOS, macOS