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 | 3.1.13 |
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:
PlanetKit::PlanetKitCallPtr pPlanetKitCall;
PlanetKit::SVideoCapability sSendVideoCapability;
PlanetKit::SVideoCapability sRecvVideoCapability;
PlanetKitManager::GetInstance()->GetDefaultVideoCapSend(&sSendVideoCapability);
PlanetKitManager::GetInstance()->GetDefaultVideoCapReceive(&sRecvVideoCapability);
// For both GetDefaultVideoCapSend() and GetDefaultVideoCapReceive(), the default value of bPreferHWCodec is true.
// To request deactivation of hardware video codec, set both to false as follows:
// sSendVideoCapability.bPreferHWCodec = false;
// sRecvVideoCapability.bPreferHWCodec = false;
PlanetKit::MakeCallParamPtr pMakeCallParam = PlanetKit::MakeCallParam::CreateWithAccessToken(
myId, peerId, accessToken
);
pMakeCallParam->SetSendVideoCapability(sSendVideoCapability);
pMakeCallParam->SetRecvVideoCapability(sRecvVideoCapability);
PlanetKit::PlanetKitManagerPtr pPlanetKitManager = PlanetKit::PlanetKitManager::GetInstance();
PlanetKit::SStartResult sStartResult = pPlanetKitManager->MakeCall(pMakeCallParam, &pPlanetKitCall);
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:
PlanetKit::PlanetKitCallPtr pPlanetKitCall;
PlanetKit::SVideoCapability sSendVideoCapability;
PlanetKit::SVideoCapability sRecvVideoCapability;
PlanetKitManager::GetInstance()->GetDefaultVideoCapSend(&sSendVideoCapability);
PlanetKitManager::GetInstance()->GetDefaultVideoCapReceive(&sRecvVideoCapability);
// For both GetDefaultVideoCapSend() and GetDefaultVideoCapReceive(), the default value of bPreferHWCodec is true.
// To request deactivation of hardware video codec, set both to false as follows:
// sSendVideoCapability.bPreferHWCodec = false;
// sRecvVideoCapability.bPreferHWCodec = false;
PlanetKit::VerifyCallParamPtr pVerifyCallParam = PlanetKit::VerifyCallParam::Create(
myId, ccParam
);
pVerifyCallParam->SetSendVideoCapability(sSendVideoCapability);
pVerifyCallParam->SetRecvVideoCapability(sRecvVideoCapability);
PlanetKit::PlanetKitManagerPtr pPlanetKitManager = PlanetKit::PlanetKitManager::GetInstance();
PlanetKit::SStartResult sStartResult = pPlanetKitManager->VerifyCall(pVerifyCallParam, &pPlanetKitCall);
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:
PlanetKit::PlanetKitConferencePtr pPlanetKitConference;
PlanetKit::SVideoCapability sSendVideoCapability;
PlanetKitManager::GetInstance()->GetDefaultVideoCapSend(&sSendVideoCapability);
// For GetDefaultVideoCapSend(), the default value of bPreferHWCodec is true.
// To request deactivation of hardware video codec for encoding, set bPreferHWCodec to false as follows:
// sSendVideoCapability.bPreferHWCodec = false
PlanetKit::ConferenceParamPtr pConferenceParam = PlanetKit::ConferenceParam::CreateWithAccessToken(
myId, roomId, roomServiceId, accessToken
);
pConferenceParam->SetSendVideoCapability(sSendVideoCapability);
// To enable or disable hardware video codec for decoding, set SetUseRxHWVidCodec() of ConferenceParam to true or false.
pConferenceParam->SetUseRxHWVidCodec(true);
PlanetKit::PlanetKitManagerPtr pPlanetKitManager = PlanetKit::PlanetKitManager::GetInstance();
PlanetKit::SStartResult sStartResult = pPlanetKitManager->JoinConference(pConferenceParam, &pPlanetKitConference);
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
IsVideoSendHardwareCodecEnabled()
of theCallConnectedParam
delivered byOnConnected
. - In group calls, you can check whether a hardware codec is enabled or disabled using
IsVideoSendHardwareCodecEnabled()
of theConferenceConnectedParam
delivered byOnConnected
.
Related API
APIs related to hardware video codec support are as follows.
1-to-1 call
-
MakeCallParam::SetSendVideoCapability()
-
MakeCallParam::SetRecvVideoCapability()
-
VerifyCallParam::SetSendVideoCapability()
-
VerifyCallParam::SetRecvVideoCapability()