libpag.framework
, Masonry.framework
, XMagic.framework
, YTCommonXMagic.framework
in the SDK directory. If the version of XMatic SDK used is 2.5.1 or later, import libpag.framework
, Masonry.framework
, XMagic.framework
, YTCommonXMagic.framework
, Audio2Exp.framework
, TEFFmpeg.framework(version3.0.0 or later, renamed as:TECodec.framework)
in the SDK directory.Type | Dependency Library |
System dependent library | Accelerate AssetsLibrary AVFoundation CoreMedia CoreFoundation CoreML Foundation JavaScriptCore libc++.tbd libz.b libresolv.tbd libsqlite3.0.tbd MetalPerformanceShaders MetalKit MobileCoreServices OpneAL OpneGLES ReplayKit SystemConfiguration UIKit |
Built-in library | YTCommon (static authentication library) XMagic (static beauty filter library) libpag (dynamic video decoding library) Masonry (control layout library) TXLiteAVSDK_Professional TXFFmpeg (renamed TECodec.framework after version 3.0.0) TXSoundTouch Audio2Exp (included in xmagic sdk version 2.5.1 and later) TEFFmpeg (included in xmagic sdk version 2.5.1 and later) |
viewDidLoad
and buildBeautySDK
methods of the ThirdBeautyViewController
class in the Demo project; The application method in the AppDelegate class contains code for authenticating Xmagic.ThirdBeautyViewController
, BeautyView
class.AppDelegate
's didFinishLaunchingWithOptions
, where LicenseURL
, LicenseKey
are the authorization information obtained from Tencent Cloud's official website, please refer to Licenses:[TXLiveBase setLicenceURL:LicenseURL key:LicenseKey];
AppDelegate
's didFinishLaunchingWithOptions
method. The LicenseURL
and LicenseKey
are the authorization information generated when binding the License in the console. For SDK versions before 2.5.1, TELicenseCheck.h
is within XMagic.framework
; For SDK versions 2.5.1 and later, TELicenseCheck.h
is withinYTCommonXMagic.framework
.[TELicenseCheck setTELicense:LicenseURL key:LicenseKey completion:^(NSInteger authresult, NSString * _Nonnull errorMsg) {if (authresult == TELicenseCheckOk) {NSLog(@"Authentication successful");} else {NSLog(@"Authentication failed");}}];
Error code | Description |
0 | Successful |
-1 | Invalid input parameters. URL, KEY, etc. is empty. |
-3 | Download failed. Please check your network settings. |
-4 | The TE authorization information read from local is empty. It may be caused by IO failure. |
-5 | Content of VCUBE TEMP License file is empty. It may be caused by IO failure. |
-6 | JSON fields in the v_cube.license file are incorrect. Please contact the Tencent Cloud team for assistance. |
-7 | Signature verification failed. Please contact the Tencent Cloud team for assistance. |
-8 | Decryption failed. Please contact the Tencent Cloud team for assistance. |
-9 | JSON fields in the TELicense field are incorrect. Please contact the Tencent Cloud team for assistance. |
-10 | The TE authorization information parsed from the network is empty. Please contact the Tencent Cloud team for assistance. |
-11 | Failed to write TE authorization information to local file. It may be caused by IO failure. |
-12 | Download failed. Local asset parsing also failed. |
-13 | Authentication failed. |
Other | Please contact the Tencent Cloud team for assistance. |
- (void)buildBeautySDK:(int)width and:(int)height texture:(unsigned)textureID {NSDictionary *assetsDict = @{@"core_name":@"LightCore.bundle",@"root_path":[[NSBundle mainBundle] bundlePath]};// Initialize SDK: 'width' and 'height' are respectively the width and height of the texture.self.xMagicKit = [[XMagic alloc] initWithRenderSize:CGSizeMake(width,height) assetsDict:assetsDict];}
// Register log[self.beautyKit registerSDKEventListener:self];[self.beautyKit registerLoggerListener:self withDefaultLevel:YT_SDK_ERROR_LEVEL];
- (int)configPropertyWithType:(NSString *_Nonnull)propertyType withName:(NSString *_Nonnull)propertyName withData:(NSString*_Nonnull)propertyValue withExtraInfo:(id _Nullable)extraInfo;
[self.xMagicKit process:inputCPU withOrigin:YtLightImageOriginTopLeft withOrientation:YtLightCameraRotation0]
[self.beautyKit onPause];[self.beautyKit onResume];
UIEdgeInsets gSafeInset;#if __IPHONE_11_0 && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0if(gSafeInset.bottom > 0){}if (@available(iOS 11.0, *)) {gSafeInset = [UIApplication sharedApplication].keyWindow.safeAreaInsets;} else#endif{gSafeInset = UIEdgeInsetsZero;}dispatch_async(dispatch_get_main_queue(), ^{// Effect option UI_vBeauty = [[BeautyView alloc] init];[self.view addSubview:_vBeauty];[_vBeauty mas_makeConstraints:^(MASConstraintMaker *make) {make.width.mas_equalTo(self.view);make.centerX.mas_equalTo(self.view);make.height.mas_equalTo(254);if(gSafeInset.bottom > 0.0){ // Adapt to full-view screenmake.bottom.mas_equalTo(self.view.mas_bottom).mas_offset(0);} else {make.bottom.mas_equalTo(self.view.mas_bottom).mas_offset(-10);}}];_vBeauty.hidden = YES;});
Was this page helpful?