- 設置代理對象(set the proxy object)
```
TXVideoCustomProcessDelegate
```
```
TXLivePush *pusher = [[TXLivePush alloc] initWithConfig:config];
```
```
pusher.videoProcessDelegate = self;
```
- 在代理方法即視頻渲染方法中賦值,如下所示(Assign values in the proxy method, i.e. video rendering method, as shown below):
```
- (GLuint)onPreProcessTexture:(GLuint)texture width:(CGFloat)width height:(CGFloat)height{
int newTexture = [self.beautyManager getTexrureProcessWithTexture:texture width:width height:height];
return newTexture;
}
```
Tip:
1. 如果是開啟直播有鏡像效果的話,設置(if the live broadcast is enabled and has the image effect,set)
```
[_txLivePublisher setMirror:YES];
```
2. 如果調用騰訊的美顏,則需要實現代理方法,具體如下(If you call Tencent's beauty, you need to implement the proxy method, as follows:)
```
#pragma mark - MHMenuView Delegate
- (void)beautyEffectWithLevel:(NSInteger)beauty whitenessLevel:(NSInteger)white ruddinessLevel:(NSInteger)ruddiness {
TXBeautyManager \*manager = [_pusher getBeautyManager];
[manager setBeautyStyle:TXBeautyStyleSmooth];
[manager setBeautyLevel:beauty];
[manager setWhitenessLevel:white];
[manager setRuddyLevel:ruddiness];
}
```
1. 如果需要適配性能較低手機,需要更換成以下調用方式( If you need to adapt to a mobile phone with low performance, you need to replace it with the following calling method)
1\. ViewController add BOOL \_needScale;
2\. ViewController add checkDeivice method:
```
- (void)checkDevice{
/*獲取當前機型,判斷是否為 iPhone7 及以上*/
struct utsname systemInfo;
uname(&systemInfo);
NSString *platform = [NSString
stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
NSArray *symbols = [platform
componentsSeparatedByString:@","];
if (symbols.count > 0){
NSCharacterSet *characterSet = [[NSCharacterSet
decimalDigitCharacterSet] invertedSet];
NSInteger number = [[[symbols[0]
componentsSeparatedByCharactersInSet:characterSet]
componentsJoinedByString:@""] integerValue];
//iPhone9,1 -> iPhone 7
if (number >= 9){
_needScale = NO;
}else{
_needScale = YES;
}
}
}
```
3.在回調中判斷是否需要縮放(Determine whether scaling is required in the callback)
```
-(GLuint)onPreProcessTexture:(GLuint)texture
width:(CGFloat)width height:(CGFloat)height{
GLuint newTexture = texture;
if (_needScale){
newTexture = [_beautyManager
processWithTexture:texture width:width height:height
scale:0.75];
}else{
[self.beautyManager processWithTexture:texture
width:width height:height];
}
return newTexture ;
}
```
- 美狐SDK接入文檔
- Meihu SDK Access Document
- (Untitled)
- 一、基礎描述(Basic description)
- 1. 最新特性 (Latest features)
- 2. 支持平臺 (Support platform)
- 二、集成步驟 (Integration steps)
- 3. 配置工程(Configuration Engineering)
- 4. 使用 MHUI (Use MHUI)
- 5. 騰訊直播 SDK/短視頻SDK (Tencent live SDK / short video SDK)
- 6. 金山直播SDK (Jinshan)
- 7. 七牛直播SDK (Qiniu Live)
- 8. 七牛短視頻SDK (Qiniu ShortVideo)
- 9. Movieous短視頻 (Movieous short Video)
- 10. 即構直播SDK (Zego live)
- 11. 即構實時音視頻SDK(Zego Real time audio and video)
- 12. 新版Zego(即構)實時音視頻(New Zego Real time audio and video)
- 13. 網易直播 (NetEase live)
- 14. 騰訊互動直播 (Tencent interactive live broadcast)
- 15. 騰訊實時音視頻(Tencent real-time audio and video)
- 16. 融云實時音視頻 (SealRTC)
- 17. 聲網視頻通話 (Agora video call)
- 18. 聲網直播 (Agora Live)
- 19. 阿里直播 (Ali Live)
- 20. 阿里音視頻 SDK美顏
- 三、對接說明 (Docking instructions)
- 四、常見問題(common problem)
- 2. 美顏無效果(Beauty has no effect)
- 3. 貼紙下載失敗(Sticker download failed)
- 4. 點擊無法出現美顏菜單頁(The beauty menu page cannot appear after clicking)
- 5. 英文版顯示中文(The beauty menu page cannot appear after clicking)
- 6. 語言切換功能(Language switching function)