JRTCSDK-iOS v2401.0
视频客服 API 文档
载入中...
搜索中...
未找到
JRTCMediaDevice.h
1//
2// JRTCMediaDevice.h
3// JRTCSDK
4//
5// Created by juphoon on 2017/8/11.
6// Copyright © 2017年 juphoon. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "JRTCClient.h"
11#import "JRTCMediaDeviceVideoCanvas.h"
12#import "JRTCMediaDeviceCallback.h"
13#import "JRTCMediaDeviceConstants.h"
14#import "JRTCMediaDeviceInitParam.h"
15#import "JRTCRecordVideoCaptureParam.h"
16
19
23@protocol AudioInputFrameCallback <NSObject>
24
33- (void)onFrame:(const char *_Nonnull)inputId sampleRateHz:(int)iSampleRateHz channels:(int)iChannels data:(NSData *_Nullable)data;
34
35@end
36
37@protocol VideoCaptureFrameCallback <NSObject>
38
48- (void)onFrame:(const char *_Nonnull)streamId angle:(int)angle width:(int)width height:(int)height data:(unsigned char *_Nonnull)data;
49
50@end
51
53@interface JRTCMediaDeviceCamera : NSObject
57@property (nonatomic, readonly, nonnull) NSString* cameraId;
61@property (nonatomic, readonly, nonnull) NSString* cameraName;
69@property (nonatomic, readonly) JRTCMediaDeviceCameraType cameraType;
70
71@end
72
74@interface JRTCMediaDeviceAudio : NSObject
75
79@property (nonatomic, readonly, nonnull) NSString* audioId;
80
84@property (nonatomic, readonly, nonnull) NSString* audioName;
85
91@property (nonatomic, readonly) bool input;
92
93@end
94
96@interface JRTCMediaDeviceWindow : NSObject
97
101@property (nonatomic, readonly, nonnull) NSString* windowId;
102
106@property (nonatomic, readonly, nonnull) NSString* windowName;
107
108@end
109
111@interface JRTCMediaDeviceAudioParam : NSObject
112
120@property (nonatomic) int audioInputSamplingRate;
121
129@property (nonatomic) int audioOutputSamplingRate;
130
136@property (nonatomic) int audioInputChannelNumber;
137
143@property (nonatomic) int audioOutputChannelNumber;
144
145@end
146
148@interface JRTCMediaDevice : NSObject
149
153@property (nonatomic, nullable) id<AudioInputFrameCallback> audioInputFrameCallback;
154
158@property (nonatomic, readonly) bool isAudioInputStart;
159
163@property (nonatomic, readonly) bool isAudioOutputStart;
164
168@property (nonatomic, readonly) bool cameraOpen;
169
173@property (nonatomic, readonly) bool videoFileOpen;
174
178@property (nonatomic, readonly, nullable) JRTCMediaDeviceCamera* currentCamera;
179
183@property (nonatomic, readonly, nonnull) NSArray<JRTCMediaDeviceCamera*> * cameras;
184
188@property (nonatomic, nullable) JRTCMediaDeviceCamera* defaultCamera;
189
195@property (nonatomic, strong, nonnull) JRTCMediaDeviceAudioParam* audioParam;
196
200@property (nonatomic, strong, readonly, nonnull) NSString* videoFileId;
201
205@property (nonatomic, readonly) bool audioInterrupt;
206
210@property (nonatomic) JRTCMediaDeviceVideoAngle videoAngle;
211
215@property (nonatomic, readonly) bool isAutoScreenOrientation;
225@property (nonatomic) bool useInternalAudioDeviceLogic;
226
227
228#if TARGET_OS_OSX
232@property (nonatomic, readonly, nonnull) NSArray<JRTCMediaDeviceAudio*>* audioInputs;
233
237@property (nonatomic, strong, nullable) JRTCMediaDeviceAudio* audioInput;
238
242@property (nonatomic, readonly, nonnull) NSArray<JRTCMediaDeviceAudio*>* audioOutputs;
243
247@property (nonatomic, strong, nullable) JRTCMediaDeviceAudio* audioOutput;
248
252@property (nonatomic, readonly, nonnull) NSArray<JRTCMediaDeviceWindow*>* desktops;
253
257@property (nonatomic, readonly, nonnull) NSArray<JRTCMediaDeviceWindow*>* windows;
258
262@property (nonatomic, strong, nullable) JRTCMediaDeviceWindow* screenshareWindow;
263#endif
264
280+ (JRTCMediaDevice* _Nullable)create:(JRTCClient* _Nonnull)client callback:(id<JRTCMediaDeviceCallback> _Nonnull)callback initParam:(JRTCMediaDeviceInitParam* _Nullable)initParam;
281
289+ (void)destroy;
290
305- (JRTCMediaDeviceVideoCanvas* __nullable)startCameraVideo:(JRTCMediaDeviceRender)renderType;
306
322- (JRTCMediaDeviceVideoCanvas* __nullable)startCameraVideo:(JRTCMediaDeviceRender)type view:(JCView* __nonnull)view;
323
338- (JRTCMediaDeviceVideoCanvas* __nullable)startVideo:(NSString* __nonnull)streamId renderType:(JRTCMediaDeviceRender)type;
339
355- (JRTCMediaDeviceVideoCanvas* __nullable)startVideo:(NSString* __nonnull)streamId renderType:(JRTCMediaDeviceRender)type view:(JCView* __nonnull)view;
356
361- (void)stopVideo:(JRTCMediaDeviceVideoCanvas* __nonnull)canvas;
362
366- (void)stopAllVideos;
367
374- (bool)startAudio;
375
382- (bool)stopAudio;
383
392- (bool)startAudioInput;
393
401- (bool)stopAudioInput;
402
409- (bool)startAudioOutput;
410
417- (bool)stopAudioOutput;
418
430- (bool)startCamera;
431
441- (bool)stopCamera;
442
456- (bool)switchCamera;
457
470- (bool)switchCamera:(JRTCMediaDeviceCamera* __nonnull)camera;
471
476- (void)specifyCamera:(JRTCMediaDeviceCamera* __nonnull)camera;
477
482- (void)specifyCameraAngle:(int)angle;
483
493- (void)setCameraProperty:(int)width height:(int)height framerate:(int)frameRate;
494
504- (void)setScreenCaptureProperty:(int)width height:(int)height framerate:(int)frameRate;
505
510- (int)getScreenFramerate;
511
516- (void)setVideoAngle:(JRTCMediaDeviceVideoAngle)angle;
517
523- (void)setAutoScreenOrientation:(bool)enable;
524
525#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
526
532@property (nonatomic) bool defaultSpeakerOn;
533
539- (bool)isSpeakerOn;
540
550- (void)enableSpeaker:(bool)enable;
551
564- (bool)enableScreenCapture:(bool)enable;
565
577- (bool)enableScreenCapture:(bool)enable appGroupId:(NSString *__nullable)appGroupId preferredExtension:(NSString *__nullable)preferredExtension;
578
583- (JRTCMediaDeviceAudioRouteType)getAudioRouteType;
584#endif
585
590- (NSString* __nullable) getScreenCaptureId;
591
602- (bool)startVideoFile;
603
612- (bool)stopVideoFile;
613
633- (bool)setVideoFileFrame:(NSData* __nonnull)srcFrame format:(JRTCMediaDeviceVideoPixelFormat)format width:(int)width height:(int)height angle:(int)angle;
634
652- (void)setVideoFileFrame:(CVPixelBufferRef __nonnull)srcFrame angle:(int)angle mirror:(int)mirror;
653
662- (bool)startVideoCaptureRecord:(NSString *_Nonnull)streamId recordParam:(JRTCRecordVideoCaptureParam *_Nonnull)recordParam;
663
676- (bool)startVideoCaptureRecord:(NSString *_Nonnull)filePath streamId:(NSString *_Nonnull)streamId audioSource:(JRTCRecordAudioSource)audioSource fileType:(JRTCVideoRecordFileType)fileType width:(int)width height:(int)height DEPRECATED_MSG_ATTRIBUTE("该方法即将废弃,请使用 startVideoCaptureRecord:recordParam: 替换");
677
685- (bool)stopVideoCaptureRecord:(NSString *_Nonnull)streamId;
686
696- (bool)startAudioRecord:(NSString *_Nullable)filePath audioSource:(JRTCRecordAudioSource)audioSource fileType:(JRTCAudioRecordFileType)fileType;
697
704- (bool)stopAudioRecord;
705
719- (bool)recoveryRecordFile:(NSString *_Nonnull)fileDir;
720
730- (bool)snapshotWithStreamId:(NSString* __nonnull)streamId path:(NSString* __nonnull)path;
731
736- (void)setAudioInputFrameCallback:(id<AudioInputFrameCallback> _Nullable)callback;
737
743- (void)setVideoCaptureFrameCallback:(id<VideoCaptureFrameCallback> _Nullable)callback;
744
750- (void)setScreenCaptureData:(UIImage * __nonnull)image;
751
756- (void)resetScreenCaptureData;
757
766- (bool)startAudioTest:(JRTCMediaDeviceTestType)type fileName:(NSString *__nullable)fileName;
767
776- (bool)stopAudioTest:(JRTCMediaDeviceTestType)type;
777
784- (int)getMicLevel;
785
792- (int)getSpkLevel;
793
804- (int)getAnrNoiseLevel;
805
815- (int)getAnrNoiseRatio;
816
827- (bool)startRing:(NSString * _Nonnull)filePath isLoop:(bool)isLoop;
828
837- (bool)stopRing;
838
850- (bool)enableAudioInputFromFile:(bool)enable filePath:(NSString* __nullable)filePath loop:(bool)loop;
851
860- (bool)suspendAudioInputFromFile:(bool)suspend;
861
868- (void)setAec:(bool)aecOn;
869
876- (void)setAgc:(bool)agcOn;
877
878@end
879
JRTCMediaDeviceRender
Definition: JRTCMediaDeviceConstants.h:31
JRTCMediaDeviceVideoAngle
Definition: JRTCMediaDeviceConstants.h:57
JRTCVideoRecordFileType
Definition: JRTCMediaDeviceConstants.h:135
JRTCRecordAudioSource
Definition: JRTCMediaDeviceConstants.h:161
JRTCMediaDeviceAudioRouteType
Definition: JRTCMediaDeviceConstants.h:184
JRTCAudioRecordFileType
Definition: JRTCMediaDeviceConstants.h:109
JRTCMediaDeviceTestType
Definition: JRTCMediaDeviceConstants.h:210
JRTCMediaDeviceCameraType
Definition: JRTCMediaDeviceConstants.h:43
JRTCMediaDeviceVideoPixelFormat
Definition: JRTCMediaDeviceConstants.h:73
登录登出管理
Definition: JRTCClient.h:24
音频设备,mac 使用
Definition: JRTCMediaDevice.h:75
音频参数
Definition: JRTCMediaDevice.h:112
摄像头
Definition: JRTCMediaDevice.h:54
NSString * cameraName
Definition: JRTCMediaDevice.h:61
JRTCMediaDeviceCameraType cameraType
Definition: JRTCMediaDevice.h:69
NSString * cameraId
Definition: JRTCMediaDevice.h:57
音视频设备管理
Definition: JRTCMediaDevice.h:149
Definition: JRTCMediaDeviceVideoCanvas.h:42
窗口实体类,mac 使用
Definition: JRTCMediaDevice.h:97
Definition: JRTCRecordVideoCaptureParam.h:18