sudo gem install cocoapods
pod init
platform :ios, '8.0'target 'App' dopod 'XMagic'end
platform :ios, '8.0'target 'App' dopod 'XMagic_Smart'end
#Please install the corresponding library with 'pod install' based on your package#For example: if your package is of type 'all', then you only need to use pod 'TencentEffect_All'.#For example: if your package is of type 'S1-04', then you only need to use pod 'TencentEffect_S1-04'.pod 'TencentEffect_All'#pod 'TencentEffect_A1-00'#pod 'TencentEffect_A1-01'#pod 'TencentEffect_A1-02'#pod 'TencentEffect_A1-03'#pod 'TencentEffect_A1-04'#pod 'TencentEffect_A1-05'#pod 'TencentEffect_A1-06'#pod 'TencentEffect_S1-00'#pod 'TencentEffect_S1-01'#pod 'TencentEffect_S1-02'#pod 'TencentEffect_S1-03'#pod 'TencentEffect_S1-04'#pod 'TencentEffect_S1-05'#pod 'TencentEffect_S1-06'#pod 'TencentEffect_S1-07'#pod 'TencentEffect_X1-01'#pod 'TencentEffect_X1-02'
pod install
-ObjC
to Other Linker Flags.frameworks
folder, and the bundle resources are in resources
.frameworks
folder to your project: Choose the target to run, select the General tab, expand Frameworks, Libraries, and Embedded Content, and click + to add the frameworks downloaded, including XMagic.framework
, YTCommonXMagic.framework
, and libpag.framework
, as well as MetalPerformanceShaders.framework
, CoreTelephony.framework
, JavaScriptCore.framework
, VideoToolbox.framework
, and libc++.tbd
. You can also add Masonry.framework
(control layout) and SSZipArchive
(file decompression) if necessary.
frameworks
folder to your project: Choose the target to run, select the General tab,XMagic.framework
,YTCommonXMagic.framework
, libpag.framework
, Audio2Exp.framework
, and TEFFmpeg.framework(Renamed to TECodec.framework after version 3.0.0.)
, as well asMetalPerformanceShaders.framework
, CoreTelephony.framework
, JavaScriptCore.framework
,VideoToolbox.framework
, and libc++.tbd
. If necessary, you can also add Masonry.framework
(control layout) andSSZipArchive
(file decompression).resources
folder to your project.-ObjC
to Other Linker Flags.MotionRes
, not available in some basic editions of the SDK) from a URL and, after download, pass the path of the resources to the SDK.Info.plist
file. If you don’t do so, the application will crash on iOS 10. Grant the application camera access in Privacy - Camera Usage Description.LicenseURL
and LicenseKEY
.v_cube.license
.didFinishLaunchingWithOptions
method of AppDelegate
(the values of LicenseURL
and LicenseKey
are generated when you bound the license in the console).TELicenseCheck.h
in XMagic.framework
; if your SDK version is 2.5.1 or later, TELicenseCheck.h
is inYTCommonXMagic.framework
.[TELicenseCheck setTELicense:LicenseURL key:LicenseKey completion:^(NSInteger authresult, NSString * _Nonnull errorMsg) {if (authresult == TELicenseCheckOk) {NSLog(@"Authentication successful");} else {NSLog(@"Authentication failed");}}];
Error Codes | Description |
0 | Successful. |
-1 | The input parameter is invalid; for example, the URL or KEY is empty. |
-3 | Download failed. Check the network settings. |
-4 | Unable to obtain any Tencent Effect authentication information from the local system, which may be caused by an I/O failure. |
-5 | The VCUBE TEMP license file is empty, which may be caused by an I/O failure. |
-6 | The JSON field in the v_cube.license file is incorrect. Please contact Tencent Cloud team for help. |
-7 | Signature verification failed. Please contact Tencent Cloud team for help. |
-8 | Decryption failed. Please contact Tencent Cloud team for help. |
-9 | The JSON field in TELicense is incorrect. Please contact Tencent Cloud team for help. |
-10 | The Tencent Effect authentication information parsed online is empty. Please contact Tencent Cloud team for help. |
-11 | Failed to write Tencent Effect SDK authentication information to the local file, which may be caused by an I/O failure. |
-12 | Download failed, and failed to parse local assets. |
-13 | Authentication failed. |
Others | Please contact Tencent Cloud team for help. |
XMagic.framework
)NSDictionary *assetsDict = @{@"core_name":@"LightCore.bundle",@"root_path":[[NSBundle mainBundle] bundlePath]};
initWithRenderSize:assetsDict: (XMagic)self.beautyKit = [[XMagic alloc] initWithRenderSize:previewSize assetsDict:assetsDict];
process: (XMagic)
// Pass in frame data via the camera callback- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection;// Get the raw data and process the rendering information for each frame- (void)mycaptureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)inputSampleBuffer fromConnection:(AVCaptureConnection *)connection originImageProcess:(BOOL)originImageProcess;// Use the CPU to process the data- (YTProcessOutput*)processDataWithCpuFuc:(CMSampleBufferRef)inputSampleBuffer;// Use the GPU to process the data- (YTProcessOutput*)processDataWithGpuFuc:(CMSampleBufferRef)inputSampleBuffer;// The data processing API of the Tencent Effect SDK/// @param input: Input the data to be processed/// @return: Output the processed data- (YTProcessOutput* _Nonnull)process:(YTProcessInput * _Nonnull)input;
deinit (XMagic)// Call this API when you need to release the resources of the SDK[self.beautyKit deinit]
dSYM
generation error occurs when I compile the iOS demo project?PhaseScriptExecution CMake\\ PostBuild\\ Rules build/XMagicDemo.build/Debug-iphoneos/XMagicDemo.build/Script-81731F743E244CF2B089C1BF.shcd /Users/zhenli/Downloads/xmagic_s106/bin/sh -c /Users/zhenli/Downloads/xmagic_s106/build/XMagicDemo.build/Debug-iphoneos/XMagicDemo.build/Script-81731F743E244CF2B089C1BF.shCommand /bin/sh failed with exit code 1
libpag.framework
and Masonary.framework
again.demo/copy_framework.sh
.cmake
. Replace $(which cmake)
with the absolute path of cmake
.which cmake
Apple Development: ......
with your own signature.
Was this page helpful?