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.
- 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.
- Prior to PlanetKit 6.0, the hardware video codec settings were configured through the call parameter when making/verifying a 1-to-1 call or joining a group call. Starting with PlanetKit 6.0, however, the hardware video codec settings are configured through
PlanetKitManager
instead of setting them for each 1-to-1 call or group call individually.
You can configure the hardware video codec settings using withSetPreferredHardwareCodecKey()
when you initialize the SDK.
class YourApplication {
func initializePlanetKit() {
let logLevel: PlanetKitLogLevel = .simple
let logSizeLimit: PlanetKitLogSizeLimit = .small
// Create preferred hardware codec settings
let preferredHardwareCodec = PlanetKitPreferredHardwareCodec(/* set params*/)
let settingBuilder = PlanetKitInitialSettingBuilder()
.withEnableKitLogKey(level: logLevel, enable: true, logSize: logSizeLimit)
.withSetKitServerKey(serverUrl: planet_base_url)
// Configure the preferred hardware codec settings
.withSetPreferredHardwareCodecKey(preferredHardwareCodec: preferredHardwareCodec)
let initialSettings = settingBuilder.build()
// Initialize PlanetKit with the preferred hardware codec settings
PlanetKitManager.shared.initialize(initialSettings: initialSettings)
...
}
}
To configure the hardware video codec settings after initialization, use update()
with the new settings.
func updatePlanetKit() {
// Create a preferred hardware codec instance with the current settings
let preferredHardwareCodec = PlanetKitPreferredHardwareCodec(/* set params*/)
// Create update settings with the new hardware codec preferences
let updateSettings = PlanetKitInitialSettingBuilder()
.withSetPreferredHardwareCodecKey(preferredHardwareCodec: preferredHardwareCodec)
.build()
// Update PlanetKit with the preferred hardware codec settings
PlanetKitManager.shared.update(initialSettings: updateSettings)
}
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
isVideoHardwareCodecEnabled
of thePlanetKitCallConnectedParam
delivered bydidConnect
. - In group calls, you can check whether a hardware codec is enabled or disabled using
isVideoHardwareCodecEnabled
of thePlanetKitConferenceConnectedParam
delivered bydidConnect
.
Related API
APIs related to hardware video codec support are as follows.