Skip to content

Commit 917967a

Browse files
committed
添加采集相机positon初始值
Change-Id: I24b5609c1e751ca8ae754cd628986a2ced7976f4
1 parent d08ded8 commit 917967a

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ target 'LinkApp' do
2929
pod 'CocoaAsyncSocket', '7.6.5'
3030
pod 'TIoTLinkKit_TPNS', '1.0.1'
3131
pod 'TIoTLinkKit_WechatOpenSDK', '1.0.1'
32-
pod 'TIoTLinkKit_IJKPlayer', '~> 1.0.7-beta.202206211138'
32+
pod 'TIoTLinkKit_IJKPlayer', '~> 1.0.7-beta.202207121233'
3333
pod 'Bugly', '2.5.91'
3434
end
3535

@@ -41,5 +41,5 @@ target 'LinkSDKDemo' do
4141
pod 'TIoTLinkKit/LinkRTC', :path => './'
4242

4343
pod 'TIoTLinkVideo', :path => './'
44-
pod 'TIoTLinkKit_IJKPlayer', '~> 1.0.7-beta.202206211138'
44+
pod 'TIoTLinkKit_IJKPlayer', '~> 1.0.7-beta.202207121233'
4545
end

Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PODS:
3030
- TXLiteAVSDK_TRTC (= 8.0.9644)
3131
- YYModel (= 1.0.4)
3232
- TIoTLinkKit_FLV (2.2.3)
33-
- TIoTLinkKit_IJKPlayer (1.0.7-beta.202206211138)
33+
- TIoTLinkKit_IJKPlayer (1.0.7-beta.202207121233)
3434
- TIoTLinkKit_TPNS (1.0.1)
3535
- TIoTLinkKit_WechatOpenSDK (1.0.1)
3636
- TIoTLinkKit_XP2P (2.4.26-beta.202205260939)
@@ -60,7 +60,7 @@ DEPENDENCIES:
6060
- Tencent-MapSDK (= 4.3.9)
6161
- TIoTLinkKit (from `./`)
6262
- TIoTLinkKit/LinkRTC (from `./`)
63-
- TIoTLinkKit_IJKPlayer (~> 1.0.7-beta.202206211138)
63+
- TIoTLinkKit_IJKPlayer (~> 1.0.7-beta.202207121233)
6464
- TIoTLinkKit_TPNS (= 1.0.1)
6565
- TIoTLinkKit_WechatOpenSDK (= 1.0.1)
6666
- TIoTLinkVideo (from `./`)
@@ -119,7 +119,7 @@ SPEC CHECKSUMS:
119119
Tencent-MapSDK: 6dfbee53b46131deb4c4bb02b3edc5ce7fb630dc
120120
TIoTLinkKit: 0386fb583c61765a02ad5cca810c7661d5a0bc53
121121
TIoTLinkKit_FLV: aec2b2ec9664990ec6c5b9f760fc1a9043d5a9a5
122-
TIoTLinkKit_IJKPlayer: 43997107b78adb9393bc35e5e55d1bf2bb1ba5ac
122+
TIoTLinkKit_IJKPlayer: 0956f2e09012c6b050ac33e3a66fbe71d5442617
123123
TIoTLinkKit_TPNS: 7cea4fc1d20ef6c4c11c4f0b66bbb10ecf4ed968
124124
TIoTLinkKit_WechatOpenSDK: 7822d68cc5c46edf3f6020422202e7b65ea87614
125125
TIoTLinkKit_XP2P: 2c0d8b66ab3e075d8cda1cf5608b425593101346
@@ -129,6 +129,6 @@ SPEC CHECKSUMS:
129129
TZImagePickerController: bf4c57b98d8707fce41ea6be872414a71c7a8c9d
130130
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
131131

132-
PODFILE CHECKSUM: 3164ad3c557c083ea71289327529c22f4aa70f9c
132+
PODFILE CHECKSUM: 6739ce81e9a22e68a26f72ece75f92211b352595
133133

134134
COCOAPODS: 1.9.3

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ - (void)startAVCapture {
620620
if (self.callType == TIoTTRTCSessionCallType_audio) {
621621
[[TIoTCoreXP2PBridge sharedInstance] sendVoiceToServer:self.deviceName?:@"" channel:@"channel=0" audioConfig:FLVAudioType withLocalPreviewView:nil];
622622
}else {
623-
[[TIoTCoreXP2PBridge sharedInstance] sendVoiceToServer:self.deviceName?:@"" channel:@"channel=0" audioConfig:FLVAudioType withLocalPreviewView:self.previewBottomView];
623+
[[TIoTCoreXP2PBridge sharedInstance] sendVoiceToServer:self.deviceName?:@"" channel:@"channel=0" audioConfig:FLVAudioType withLocalPreviewView:self.previewBottomView videoPosition:AVCaptureDevicePositionFront];
624624
}
625625
}
626626

Source/SDK/LinkVideo/FLV/TIoTAVCaptionFLV.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ typedef NS_ENUM(NSInteger, TIoTAVCaptionFLVAudioType) {
1616
@property (nonatomic, weak) id<TIoTAVCaptionFLVDelegate> delegate;
1717
@property (nonatomic, assign)UIView *videoLocalView;
1818
@property (nonatomic, assign)BOOL isEchoCancel;
19+
@property (nonatomic, assign)AVCaptureDevicePosition devicePosition;
1920
-(instancetype) initWithAudioConfig:(TIoTAVCaptionFLVAudioType)audioSampleRate;
2021

2122
- (void)preStart;

Source/SDK/LinkVideo/FLV/TIoTAVCaptionFLV.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ -(instancetype) initWithAudioConfig:(TIoTAVCaptionFLVAudioType)audioSampleRate {
5151
tAVCaptionFLV = self;
5252
_audioRate = audioSampleRate;
5353
_isEchoCancel = NO;
54+
_devicePosition = AVCaptureDevicePositionBack;
5455
[self onInit];
5556
}
5657
return self;
@@ -284,9 +285,9 @@ - (void)setupVideoCapture {
284285

285286
NSError *error = nil;
286287
//获得一个采集设备, 例如前置/后置摄像头
287-
AVCaptureDevice *videoDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
288+
// AVCaptureDevice *videoDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
288289

289-
// videoDevice = [self cameraWithPosition:AVCaptureDevicePositionBack];
290+
AVCaptureDevice *videoDevice = [self cameraWithPosition:self.devicePosition];
290291
//用设备初始化一个采集的输入对象
291292
AVCaptureDeviceInput *videoInput = [AVCaptureDeviceInput deviceInputWithDevice:videoDevice error:&error];
292293
self.deviceInput = videoInput;

Source/SDK/LinkVideo/TIoTCoreXP2PBridge.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ extern NSNotificationName const TIoTCoreXP2PBridgeNotificationStreamEnd;
109109
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate;
110110
//音视频采样
111111
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView;
112+
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView videoPosition:(AVCaptureDevicePosition)videoPosition;
113+
112114
- (XP2PErrCode)stopVoiceToServer;
113115
- (void)changeCameraPositon;
114116

Source/SDK/LinkVideo/TIoTCoreXP2PBridge.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ - (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_numbe
315315
}
316316

317317
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView {
318+
[self sendVoiceToServer:dev_name channel:channel_number audioConfig:audio_rate withLocalPreviewView:localView videoPosition:AVCaptureDevicePositionBack];
319+
}
320+
321+
- (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_number audioConfig:(TIoTAVCaptionFLVAudioType)audio_rate withLocalPreviewView:(UIView *)localView videoPosition:(AVCaptureDevicePosition)videoPosition {
318322
NSString *audioFile = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"testVideoStreamfile.flv"];
319323
[[NSFileManager defaultManager] removeItemAtPath:audioFile error:nil];
320324
[[NSFileManager defaultManager] createFileAtPath:audioFile contents:nil attributes:nil];
@@ -332,7 +336,7 @@ - (void)sendVoiceToServer:(NSString *)dev_name channel:(NSString *)channel_numbe
332336
systemAvCapture.videoLocalView = localView;
333337
systemAvCapture.isEchoCancel = YES;
334338
}
335-
339+
systemAvCapture.devicePosition = videoPosition;
336340
systemAvCapture.videoLocalView = localView;
337341
[systemAvCapture setResolutionRatio:self.resolution];
338342
[systemAvCapture preStart];//配置声音和视频

0 commit comments

Comments
 (0)