Skip to content

Commit ee10867

Browse files
committed
添加回音消除接口开关
Change-Id: I82f2afffada54949581a5000a3162b5e6e6b99a9
1 parent 68640a2 commit ee10867

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

Source/LinkApp/Classes/Module/EquipmentPanel/Controller/TIoTAVP2PPlayCaptureVC.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ - (void)deviceP2PVideoReport:(NSNotification *)reportInfo {
400400
NSError *outError;
401401
AVAudioSessionSetActiveOptions options = active ? 0 : AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation;
402402

403-
[session setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker|AVAudioSessionCategoryOptionAllowBluetooth error:&outError];
403+
[session setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker|AVAudioSessionCategoryOptionAllowBluetooth|AVAudioSessionCategoryOptionMixWithOthers error:&outError];
404404
[session setMode:AVAudioSessionModeVoiceChat error:&outError];
405405
[session overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&outError];
406406
[session setActive:active withOptions:options error:nil];

Source/SDK/LinkVideo/FLV/TIoTAVCaptionFLV.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ - (void)setVideoBitRate:(int32_t)bitRate {
255255

256256
int32_t ret = bitRate;
257257
[self.h264Encoder setEncoderBitrateBps:ret];
258-
NSLog(@"-------------------------setEncoderBitrateBps---%d-----------------",ret);
258+
// NSLog(@"-------------------------setEncoderBitrateBps---%d-----------------",ret);
259259
}
260260

261261
- (int32_t)getVideoBitRate {

Source/SDK/LinkVideo/TIoTCoreXP2PBridge.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ extern NSNotificationName const TIoTCoreXP2PBridgeNotificationStreamEnd;
110110
//音视频采样
111111
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView;
112112
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView videoPosition:(AVCaptureDevicePosition)videoPosition;
113+
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView videoPosition:(AVCaptureDevicePosition)videoPosition isEchoCancel:(BOOL)isEchoCancel;
113114
//刷新本地预览视图
114115
- (void)refreshLocalView:(UIView *)localView;
115116
- (XP2PErrCode)stopVoiceToServer;

Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ - (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_numbe
319319
}
320320

321321
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView videoPosition:(AVCaptureDevicePosition)videoPosition {
322+
[self sendVoiceToServer:dev_name channel:channel_number audioConfig:audio_rate withLocalPreviewView:localView videoPosition:videoPosition isEchoCancel:NO];
323+
}
324+
325+
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView videoPosition:(AVCaptureDevicePosition)videoPosition isEchoCancel:(BOOL)isEchoCancel {
322326
NSString *audioFile = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"testVideoStreamfile.flv"];
323327
[[NSFileManager defaultManager] removeItemAtPath:audioFile error:nil];
324328
[[NSFileManager defaultManager] createFileAtPath:audioFile contents:nil attributes:nil];
@@ -334,7 +338,7 @@ - (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_numbe
334338
if (systemAvCapture == nil) {
335339
systemAvCapture = [[TIoTAVCaptionFLV alloc] initWithAudioConfig:audio_rate];
336340
systemAvCapture.videoLocalView = localView;
337-
systemAvCapture.isEchoCancel = YES;
341+
systemAvCapture.isEchoCancel = isEchoCancel;
338342
}
339343
systemAvCapture.devicePosition = videoPosition;
340344
systemAvCapture.videoLocalView = localView;
@@ -367,7 +371,7 @@ - (void)getSendBufSize {
367371
// for (int i =0; i < _p2p_wl_avg_ctx.len; i++) {
368372
// printf("\n stream_buf_con==%d \n",_p2p_wl_avg_ctx.buf[i]);
369373
// }
370-
NSLog(@"send_bufsize==%d, now_video_rate==%d, avg_index==%d",bufsize, now_video_rate, p2p_wl_avg);
374+
// NSLog(@"send_bufsize==%d, now_video_rate==%d, avg_index==%d",bufsize, now_video_rate, p2p_wl_avg);
371375

372376
// 降码率
373377
// 当发现p2p的水线超过一定值时,降低视频码率,这是一个经验值,一般来说要大于 [视频码率/2]

0 commit comments

Comments
 (0)