类 TSRSdk
- java.lang.Object
-
- com.tencent.mps.tie.api.TSRSdk
-
public class TSRSdk extends java.lang.Object
TSRSdk is a class responsible for managing and verifying the license of the super-resolution SDK. The class provides methods for initializing the SDK with online license verification, and releasing the resources when the SDK is no longer needed. It also allows setting a custom logger for logging purposes.Usage:
- Get an instance of TSRSdk using the
getInstance()
method. - Initialize the TSRSdk object with online license verification using the
init(long, TSRSdkLicenseVerifyResultCallback, TSRLogger)
methods. - Perform super-resolution rendering using the
TSRPass
class. - Release resources when the TSRSdk object is no longer needed by calling the
release()
method.
Example for online verification:
TSRSdkLicenseVerifyResultCallback callback = new TSRSdkLicenseVerifyResultCallback() { public void onTSRSdkLicenseVerifyResult(TSRSdkLicenseStatus status) { if (status == TSRSdkLicenseStatus.AVAILABLE) { // Creating TSRPass for super-resolution rendering } else { // Do something when the verification of sdk's license failed. } } }; TSRSdk.getInstance().init(appId, callback, logger); // If you have created TSRPass, you should release it before release TSRSdk. tsrPass.release(); // Release resources when the TSRSdk object is no longer needed. TSRSdk.getInstance().release();
- Get an instance of TSRSdk using the
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static class
TSRSdk.TSRSdkLicenseStatus
Enum representing the status of an SDK license.static interface
TSRSdk.TSRSdkLicenseVerifyResultCallback
TSRSdkLicenseVerifyResultCallback is an interface for handling the result of TSRSDK license verification.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static TSRSdk
getInstance()
void
init(long appId, TSRSdk.TSRSdkLicenseVerifyResultCallback callback, TSRLogger logger)
Initializes the TSRSdk with online license verification.void
release()
Releases the resources associated with the TSRSdk instance.
-
-
-
方法详细资料
-
getInstance
public static TSRSdk getInstance()
-
init
public void init(long appId, TSRSdk.TSRSdkLicenseVerifyResultCallback callback, TSRLogger logger)
Initializes the TSRSdk with online license verification. This method only can be executed once before therelease()
is executed.- 参数:
appId
- appIdcallback
- SdkLicenseVerifyResultCallback is an interface for handling the result of SDK license verification. SeeTSRSdk.TSRSdkLicenseVerifyResultCallback
for more information.logger
- Set a logger for the TSRSdk. The Logger must not be null.
-
release
public void release()
Releases the resources associated with the TSRSdk instance.This method should be called when the TSRSdk instance is no longer needed, to free up memory and other resources. Before calling this method, make sure to release all associated TSRPass objects by calling their
TSRPass.release()
method, as they depend on the resources provided by the TSRSdk instance. Failing to release TSRPass objects before releasing the TSRSdk may lead to unexpected errors or undefined behavior.After calling this method, you must re-initialize the TSRSdk instance using the init methods
init(long, TSRSdkLicenseVerifyResultCallback, TSRLogger)
) before using it again.
-
-