Skip to content

Commit

Permalink
区分每次stop的uni,防止前一次stop影响后一次start
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleychen committed May 28, 2024
1 parent 5117af9 commit 2a077d3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ PODS:
- TIoTLinkKit_SoundTouch (1.0.0)
- TIoTLinkKit_TPNS (1.0.1)
- TIoTLinkKit_WechatOpenSDK (1.0.1)
- TIoTLinkKit_XP2P (2.4.49-beta.202405221203)
- TIoTLinkKit_XP2P (2.4.49)
- TIoTLinkVideo (1.0.0):
- CocoaAsyncSocket (= 7.6.5)
- TIoTLinkKit_FLV (= 2.2.3)
- TIoTLinkKit_GVoiceSE (>= 1.0.7)
- TIoTLinkKit_SoundTouch (= 1.0.0)
- TIoTLinkKit_XP2P (= 2.4.49-beta.202405221203)
- TIoTLinkKit_XP2P (= 2.4.49)
- TPCircularBuffer (= 1.6.1)
- TPCircularBuffer (1.6.1)
- TrueTime (5.0.3)
Expand Down Expand Up @@ -133,8 +133,8 @@ SPEC CHECKSUMS:
TIoTLinkKit_SoundTouch: cf79ae182b6c2349ff65bac7a338974bc538fa77
TIoTLinkKit_TPNS: 7cea4fc1d20ef6c4c11c4f0b66bbb10ecf4ed968
TIoTLinkKit_WechatOpenSDK: 7822d68cc5c46edf3f6020422202e7b65ea87614
TIoTLinkKit_XP2P: e32c680e361253852f0f4e00f02f871285d888ed
TIoTLinkVideo: db03c08d1a8e66498ec664db9547545a2d06c21e
TIoTLinkKit_XP2P: 0250d1a8f0561f015bb9ab09aed59c0a617e49aa
TIoTLinkVideo: 938a736bd9da2ce61edd16d8637ae929aa4b593b
TPCircularBuffer: c13243556527551c4d320709c7b14a6d20cdc30a
TrueTime: b49551ffafb28a9dee04e51b226f42a416010842
TXLiteAVSDK_TRTC: e3383a81565e8bb2aaaaab4bd099ad5239cd5b2d
Expand Down
5 changes: 5 additions & 0 deletions Source/LinkSDKDemo/Video/P2P/Controller/TIoTDemoVideoCallVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ - (void)loadStateDidChange:(NSNotification*)notification {


- (void)moviePlayBackStateDidChange:(NSNotification*)notification {
NSString *seicontent = [notification.userInfo objectForKey:@"FFP_MSG_VIDEO_SEI_CONTENT"];
if (seicontent) {
return;
}

switch (_player.playbackState)
{
case IJKMPMoviePlaybackStateStopped: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,9 @@ - (void)startPlayLocalVideoWithStartTime:(NSInteger )startTime endTime:(NSIntege
NSInteger durationValue = self.videoTimeModel.EndTime.integerValue - self.videoTimeModel.StartTime.integerValue;
NSInteger minuteValue = durationValue / 60;
NSInteger secondValue = durationValue % 60;
if (durationValue == 0) {
return;
}

self.slider.minimumValue = 0;
self.slider.maximumValue = durationValue;
Expand Down
23 changes: 14 additions & 9 deletions Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ @interface TIoTCoreXP2PBridge ()<TIoTAVCaptionFLVDelegate>
@property (nonatomic, assign) BOOL isSending;
@property (nonatomic, strong) AVCaptureSessionPreset resolution;
@property (nonatomic, strong) NSTimer *getBufTimer;
@property (nonatomic, assign) NSInteger startTime;
@property (nonatomic, assign) NSInteger startVoiceTime;
@property (nonatomic, strong) NSMutableDictionary *uniReqStartTime;
@property (nonatomic, strong) TIoTCoreLogger *logger;
- (void)cancelTimer;
- (void)doTick:(data_report_t)data_buf;
Expand Down Expand Up @@ -216,6 +215,8 @@ - (instancetype)init {
[[NSFileManager defaultManager] removeItemAtPath:logFile error:nil];
[[NSFileManager defaultManager] createFileAtPath:logFile contents:nil attributes:nil];
p2pOutLogFile = fopen(logFile.UTF8String, "wb");

_uniReqStartTime = [NSMutableDictionary dictionary];
}
return self;
}
Expand Down Expand Up @@ -622,7 +623,7 @@ - (void)doTick:(data_report_t)data_buf {
}

NSData *body = [NSData dataWithBytes:data_buf.report_buf length:data_buf.report_size];
NSURL *urlString = [NSURL URLWithString:@"http://log.qvb.qcloud.com/reporter/vlive"];
NSURL *urlString = [NSURL URLWithString:@"https://log.qvb.qcloud.com/reporter/vlive"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:urlString cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:5];
[request setValue:@"application/octet-stream" forHTTPHeaderField:@"Content-Type"];
request.HTTPMethod = @"POST";
Expand All @@ -644,14 +645,14 @@ - (void)reportUserList:(data_report_t)report {
NSString *dataaction = [NSString stringWithCString:(const char *)report.data_action encoding:NSASCIIStringEncoding];

if ([status isEqualToString:@"start"]) {
if ([dataaction isEqualToString:@"voice"]) {
self.startVoiceTime = [[TIoTCoreXP2PBridge getNowTimeTimestamp] integerValue];
}else {
self.startTime = [[TIoTCoreXP2PBridge getNowTimeTimestamp] integerValue];
}
[self.uniReqStartTime setObject:[TIoTCoreXP2PBridge getNowTimeTimestamp] forKey:reqid];
}

NSInteger startTime = [[self.uniReqStartTime objectForKey:reqid] integerValue];
if (startTime == 0) {
return;
}

NSInteger startTime = [dataaction isEqualToString:@"voice"]? self.startVoiceTime:self.startTime;
NSMutableDictionary *accessParam = [NSMutableDictionary dictionary];
[accessParam setValue:@"P2PReport" forKey:@"Action"];
[accessParam setValue:status forKey:@"Status"];
Expand Down Expand Up @@ -680,6 +681,10 @@ - (void)reportUserList:(data_report_t)report {
}
}];
[tasklog resume];

if ([status isEqualToString:@"end"]) {
[self.uniReqStartTime removeObjectForKey:reqid];
}
}

+ (NSString *)getSDKVersion {
Expand Down
2 changes: 1 addition & 1 deletion TIoTLinkVideo.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Pod::Spec.new do |s|
s.source_files = 'Source/SDK/LinkVideo/**/*.{h,m,c,mm}'
s.resource = 'Source/SDK/LinkVideo/FLV/asset/GvoiceSE_v1_239-119-oneref-e.nn'

s.dependency 'TIoTLinkKit_XP2P', '2.4.49-beta.202405221203'
s.dependency 'TIoTLinkKit_XP2P', '2.4.49'
s.dependency 'TIoTLinkKit_FLV', '2.2.3'
s.dependency 'CocoaAsyncSocket', '7.6.5'
s.dependency 'TIoTLinkKit_SoundTouch', '1.0.0'
Expand Down

0 comments on commit 2a077d3

Please sign in to comment.