Skip to content

Commit 909ae49

Browse files
shengcui2017shengcui2018
authored andcommitted
iOS 更新到 7.2.8927
1 parent 52d6739 commit 909ae49

File tree

12 files changed

+120
-81
lines changed

12 files changed

+120
-81
lines changed

iOS/Demo/TXLiteAVDemo/Common/TCBeautyPanel/TCBeautyPanel/Interfaces/TCBeautyPanelActionPerformer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ NS_ASSUME_NONNULL_BEGIN
1919
*
2020
* @param level 滤镜强度, 从0到1,越大滤镜效果越明显,默认值为0.5。
2121
*/
22-
- (void)setFilterConcentration:(float)level;
22+
- (void)setFilterStrength:(float)level;
2323

2424
/** 设置绿幕文件(增值版本有效,普通版本设置此参数无效)[仅限企业版Pro]
2525
*
2626
* @param file 绿幕文件路径
2727
*/
28-
- (void)setGreenScreenFile:(nullable NSURL *)file;
28+
- (void)setGreenScreenFile:(nullable NSString *)file;
2929

3030
// 以下为 TXBeautyManager 方法
3131
/**

iOS/Demo/TXLiteAVDemo/Common/TCBeautyPanel/TCBeautyPanel/Model/TCBeautyPanelActionProxy.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,4 @@ NS_ASSUME_NONNULL_BEGIN
1616
+ (instancetype)proxyWithSDKObject:(id)object;
1717
@end
1818

19-
@interface TCBeautyPanel (SDK)
20-
+ (instancetype)beautyPanelWithFrame:(CGRect)frame SDKObject:(id)object;
21-
@end
22-
2319
NS_ASSUME_NONNULL_END

iOS/Demo/TXLiteAVDemo/Common/TCBeautyPanel/TCBeautyPanel/Model/TCBeautyPanelActionProxy.m

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,21 @@ - (void)setFilterConcentration:(float)level;
1414
- (void)setSpecialRatio:(float)level;
1515
@end
1616

17-
NS_INLINE BOOL isFilterConcentrationSetter(SEL selector) {
18-
return strcmp(sel_getName(selector), sel_getName(@selector(setFilterConcentration:))) == 0;
19-
}
20-
2117
@implementation TCBeautyPanelActionProxy
2218
{
2319
__weak id _object;
2420
__weak id _beautyManager;
25-
SEL _filterConcentrationAlternativeSetter;
2621
}
2722

2823
+ (instancetype)proxyWithSDKObject:(id)object {
29-
return [[TCBeautyPanelActionProxy alloc] initWithObject:object
30-
filterConcentrationSetter:@selector(setSpecialRatio:)];
24+
return [[TCBeautyPanelActionProxy alloc] initWithObject:object];
3125
}
3226

3327
+ (instancetype)proxyWithSDKObject:(id)object filterConcentrationSetter:(SEL)setter {
34-
return [[TCBeautyPanelActionProxy alloc] initWithObject:object
35-
filterConcentrationSetter:setter];
28+
return [[TCBeautyPanelActionProxy alloc] initWithObject:object];
3629
}
3730

38-
- (instancetype)initWithObject:(id)object filterConcentrationSetter:(SEL)setter {
39-
_filterConcentrationAlternativeSetter = setter;
31+
- (instancetype)initWithObject:(id)object {
4032
if (![object respondsToSelector:@selector(getBeautyManager)]) {
4133
NSLog(@"%s failed, %@ doesn't has getBeautyManager method", __PRETTY_FUNCTION__, object);
4234
return nil;
@@ -56,8 +48,6 @@ - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel {
5648
return [_beautyManager methodSignatureForSelector:sel];
5749
} else if ([_object respondsToSelector:sel]) {
5850
return [_object methodSignatureForSelector:sel];
59-
} else if (_filterConcentrationAlternativeSetter && isFilterConcentrationSetter(sel)) {
60-
return [_object methodSignatureForSelector:_filterConcentrationAlternativeSetter];
6151
}
6252

6353
return [super methodSignatureForSelector:sel];
@@ -69,9 +59,6 @@ - (void)forwardInvocation:(NSInvocation *)invocation {
6959
[invocation invokeWithTarget:_beautyManager];
7060
} else if ([_object respondsToSelector: selector]) {
7161
[invocation invokeWithTarget:_object];
72-
} else if (_filterConcentrationAlternativeSetter && isFilterConcentrationSetter(selector)) {
73-
invocation.selector = _filterConcentrationAlternativeSetter;
74-
[invocation invokeWithTarget:_object];
7562
}
7663
}
7764

@@ -82,17 +69,7 @@ - (BOOL)respondsToSelector:(SEL)aSelector {
8269
if ([_object respondsToSelector:aSelector]) {
8370
return YES;
8471
}
85-
if (_filterConcentrationAlternativeSetter && isFilterConcentrationSetter(aSelector)) {
86-
return [_object respondsToSelector:_filterConcentrationAlternativeSetter];
87-
}
8872
return NO;
8973
}
9074

9175
@end
92-
93-
@implementation TCBeautyPanel (SDK)
94-
+ (instancetype)beautyPanelWithFrame:(CGRect)frame SDKObject:(id)object {
95-
return [TCBeautyPanel beautyPanelWithFrame:frame
96-
actionPerformer:[TCBeautyPanelActionProxy proxyWithSDKObject:object]];
97-
}
98-
@end

iOS/Demo/TXLiteAVDemo/Common/TCBeautyPanel/TCBeautyPanel/TCBeautyPanelView.m

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#import "TCBeautyPanelTheme.h"
1515
#import "TCBeautyPanelActionPerformer.h"
1616
#import "TCFilter.h"
17+
#import "TCBeautyPanelActionProxy.h"
1718

1819
#define BeautyViewMargin 8
1920
#define BeautyViewSliderHeight 30
@@ -128,6 +129,14 @@ @interface TCBeautyPanel()
128129
@implementation TCBeautyPanel
129130

130131
#pragma mark - Public API
132+
+ (instancetype)beautyPanelWithFrame:(CGRect)frame
133+
theme:(nullable id<TCBeautyPanelThemeProtocol>)theme
134+
SDKObject:(id)SDKObject {
135+
return [[TCBeautyPanel alloc] initWithFrame:frame
136+
theme:nil
137+
actionPerformer:[TCBeautyPanelActionProxy proxyWithSDKObject:SDKObject]];
138+
}
139+
131140
+ (instancetype)beautyPanelWithFrame:(CGRect)frame
132141
actionPerformer:(id<TCBeautyPanelActionPerformer>)actionPerformer {
133142
TCBeautyPanel *panel = [[TCBeautyPanel alloc] initWithFrame:frame
@@ -259,7 +268,7 @@ - (void)resetAndApplyValues
259268
TCFilterIdentifier defaultFilterIdentifier = _filters[defaultFilterIndex].identifier;
260269
UIImage *lutImage = [self filterImageByMenuOptionIndex:defaultFilterIndex+1];
261270
[performer setFilter:lutImage];
262-
[performer setFilterConcentration:self.filterValueDic[defaultFilterIdentifier].floatValue/10.0];
271+
[performer setFilterStrength:self.filterValueDic[defaultFilterIdentifier].floatValue/10.0];
263272

264273
// 重置各高级美颜选项,瘦脸大脸等
265274
NSArray<TCBeautyPanelItem *> *beautySettingItems = _optionsContainer[PanelMenuIndexBeauty];
@@ -300,7 +309,7 @@ - (UIImage*)filterImageByMenuOptionIndex:(NSInteger)index
300309
return [UIImage imageWithContentsOfFile:filter.lookupImagePath];
301310
}
302311

303-
-(float)filterMixLevelByIndex:(NSInteger)optionIndex
312+
-(float)filterStrengthAtIndex:(NSInteger)optionIndex
304313
{
305314
optionIndex = [self _converOptionIndexToFilterArrayIndex:optionIndex];
306315

@@ -478,7 +487,7 @@ - (void)menu:(TCMenuView *)menu didChangeToIndex:(NSInteger)menuIndex option:(NS
478487
self.beautyStyle = optionIndex;
479488
}
480489

481-
TCBeautyPanelItem *item = _optionsContainer[menu.menuIndex][menu.optionIndex];
490+
TCBeautyPanelItem *item = _optionsContainer[menu.menuIndex][menu.optionIndex];
482491
if ([item isKindOfClass:[ TCBeautyPanelItem class]]) {
483492
self.slider.minimumValue = item.minValue;
484493
self.slider.maximumValue = item.maxValue;
@@ -489,6 +498,9 @@ - (void)menu:(TCMenuView *)menu didChangeToIndex:(NSInteger)menuIndex option:(NS
489498
} break;
490499
case PanelMenuIndexFilter: {
491500
_currentFilterIndex = optionIndex;
501+
self.slider.minimumValue = BeautyMinLevel;
502+
self.slider.maximumValue = BeautyMaxLevel;
503+
492504
[self onSetFilterAtMenuIndex:optionIndex];
493505
if (optionIndex > 0) {
494506
TCFilterIdentifier filterId = _filters[optionIndex - 1].identifier;
@@ -560,8 +572,8 @@ - (void)onSliderValueChanged:(UISlider *)slider
560572
if(menuIndex == PanelMenuIndexFilter) {
561573
NSString *filterID = _filters[_menu.optionIndex-1].identifier;
562574
self.filterValueDic[filterID] = @(value);
563-
if([self.actionPerformer respondsToSelector:@selector(setFilterConcentration:)]){
564-
[self.actionPerformer setFilterConcentration:value / 10.f];
575+
if([self.actionPerformer respondsToSelector:@selector(setFilterStrength:)]){
576+
[self.actionPerformer setFilterStrength:value / 10.f];
565577
}
566578
} else if(menuIndex == PanelMenuIndexBeauty) {
567579
// 美颜数值变化
@@ -594,7 +606,7 @@ - (void)onSetGreenWithIndex:(NSInteger)index
594606
[self.actionPerformer setGreenScreenFile:nil];
595607
}
596608
if (index == 1) {
597-
[self.actionPerformer setGreenScreenFile:[_theme goodLuckVideoFileURL]];
609+
[self.actionPerformer setGreenScreenFile:[_theme goodLuckVideoFilePath]];
598610
}
599611
}
600612
}

iOS/Demo/TXLiteAVDemo/Common/TCBeautyPanel/TCBeautyPanel/View/TCBeautyPanelTheme.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN
8787

8888
- (UIImage *)iconForFilter:(NSString *)filter;
8989
- (UIImage *)imageNamed:(NSString *)name;
90-
- (NSURL *)goodLuckVideoFileURL;
90+
- (NSString *)goodLuckVideoFilePath;
9191
@end
9292

9393

iOS/Demo/TXLiteAVDemo/Common/TCBeautyPanel/TCBeautyPanel/View/TCBeautyPanelTheme.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ - (instancetype)init
119119
}
120120
return self;
121121
}
122-
- (NSURL *)goodLuckVideoFileURL {
123-
return [_resourceBundle URLForResource:@"goodluck" withExtension:@"mp4"];
122+
- (NSString *)goodLuckVideoFilePath {
123+
return [_resourceBundle pathForResource:@"goodluck" ofType:@"mp4"];
124124
}
125125

126126
- (UIImage *)iconForFilter:(nonnull NSString *)filter {

iOS/Demo/TXLiteAVDemo/Common/TCBeautyPanel/TCBeautyPanel/View/TCBeautyPanelView.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ typedef NS_ENUM(NSInteger, TCBeautyStyle) {
4343
@property (nonatomic, strong) id<TCBeautyPanelActionPerformer> actionPerformer;
4444
@property (nonatomic, weak) id<BeautyLoadPituDelegate> pituDelegate;
4545

46-
/// 以默认主题实例化美颜面板
46+
/// 使用 frame 和SDK对象创建 TCBeautyPanel
47+
/// @param frame 界面位置及大小
48+
/// @param theme 主题,传空为默认主题
49+
/// @param SDKObject SDK 对象可以是 TRTCCloud, TXLivePush, TXUGCRecord 等有 getBeautyManager 方法的对象
50+
+ (instancetype)beautyPanelWithFrame:(CGRect)frame
51+
theme:(nullable id<TCBeautyPanelThemeProtocol>)theme
52+
SDKObject:(id)SDKObject;
53+
4754
+ (instancetype)beautyPanelWithFrame:(CGRect)frame
4855
actionPerformer:(id<TCBeautyPanelActionPerformer>)actionPerformer;
4956

@@ -60,7 +67,7 @@ typedef NS_ENUM(NSInteger, TCBeautyStyle) {
6067
- (void)resetAndApplyValues;
6168
+ (NSUInteger)getHeight;
6269
- (UIImage*)filterImageByMenuOptionIndex:(NSInteger)index;
63-
- (float)filterMixLevelByIndex:(NSInteger)index;
70+
- (float)filterStrengthAtIndex:(NSInteger)index;
6471
@end
6572

6673
NS_ASSUME_NONNULL_END

iOS/Demo/TXLiteAVDemo/LVB/CameraPush/CameraPushViewController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ - (void)initUI {
208208
CGRect frame = CGRectMake(0, self.view.frame.size.height - controlHeight - bottomOffset,
209209
self.view.frame.size.width, controlHeight + bottomOffset);
210210
_beautyPanel = [TCBeautyPanel beautyPanelWithFrame:frame
211-
SDKObject:_pusher];
211+
theme:nil
212+
SDKObject:_pusher];
212213
_beautyPanel.bottomOffset = bottomOffset;
213214
[ThemeConfigurator configBeautyPanelTheme:_beautyPanel];
214215
_beautyPanel.hidden = YES;

iOS/Demo/TXLiteAVDemo/LVB/LivePlayer/PlayViewController.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ - (void)viewDidLoad {
7575
// 创建播放器
7676
_player = [[TXLivePlayer alloc] init];
7777

78-
//允许接收消息
7978
TXLivePlayConfig* config = _player.config;
79+
// 开启 flvSessionKey 数据回调
80+
//config.flvSessionKey = @"X-Tlive-SpanId";
81+
// 允许接收消息
8082
config.enableMessage = YES;
8183
[_player setConfig:config];
8284

@@ -561,10 +563,14 @@ - (void)onPlayEvent:(int)EvtID withParam:(NSDictionary *)param {
561563
}
562564
}
563565
else if (EvtID == EVT_PLAY_GET_MESSAGE) {
564-
NSData* msgData = param[@"EVT_GET_MSG"];
565-
NSString* msg = [[NSString alloc] initWithData:msgData encoding:NSUTF8StringEncoding];
566+
NSData *msgData = param[@"EVT_GET_MSG"];
567+
NSString *msg = [[NSString alloc] initWithData:msgData encoding:NSUTF8StringEncoding];
566568
[self toastTip:msg];
567569
}
570+
else if (EvtID == PLAY_EVT_GET_FLVSESSIONKEY) {
571+
//NSString *Msg = (NSString*)[dict valueForKey:EVT_MSG];
572+
//[self toastTip:[NSString stringWithFormat:@"event PLAY_EVT_GET_FLVSESSIONKEY: %@", Msg]];
573+
}
568574
});
569575
}
570576

iOS/Demo/TXLiteAVDemo/LVB/LiveRoom/LiveRoom/MLVBLiveRoom.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,14 +493,14 @@
493493
*
494494
* @note 滤镜素材请使用 png 格式,不能使用 jpg 格式,友情提示,Windows 里直接改文件的后缀名不能改变图片的格式,需要用 Photoshop 进行转换。
495495
*/
496-
- (void)setFilter:(UIImage *)image;
496+
- (void)setFilter:(UIImage *)image MLVB_DEPRECAETD_BEAUTY_API;
497497

498498
/**
499499
* 设置滤镜浓度
500500
*
501501
* @param specialValue 从0到1,越大滤镜效果越明显,默认取值0.5
502502
*/
503-
- (void)setSpecialRatio:(float)specialValue;
503+
- (void)setSpecialRatio:(float)specialValue MLVB_DEPRECAETD_BEAUTY_API;
504504

505505
/**
506506
* 设置大眼级别(企业版有效,普通版本设置此参数无效)
@@ -551,7 +551,7 @@
551551
*
552552
* @param file 视频文件路径。支持 MP4;nil 表示关闭特效。
553553
*/
554-
- (void)setGreenScreenFile:(NSURL *)file;
554+
- (void)setGreenScreenFile:(NSURL *)file MLVB_DEPRECAETD_BEAUTY_API;
555555

556556
/**
557557
* 选择使用哪一款 AI 动效挂件(企业版有效,其它版本设置此参数无效)。

0 commit comments

Comments
 (0)