|
@@ -30,6 +30,14 @@ RTC_OBJC_EXPORT
|
|
|
//code 0 成功 1失败
|
|
|
-(void)onAuthResultFromPeerName:(NSString*)peerName code:(int)code descriptions:(NSString*)descriptions;
|
|
|
|
|
|
+-(void)onFirstFrameRendered:(NSString*)peerName;
|
|
|
+
|
|
|
+@optional
|
|
|
+- (void)connectionChange:(NSString*)peerName
|
|
|
+ didChangeLocalCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)local
|
|
|
+ remoteCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)remote
|
|
|
+ lastReceivedMs:(int)lastDataReceivedMs
|
|
|
+ changeReason:(NSString *)reason;
|
|
|
@end
|
|
|
|
|
|
RTC_OBJC_EXPORT
|
|
@@ -39,107 +47,16 @@ RTC_OBJC_EXPORT
|
|
|
|
|
|
+(void)globalDeinitialization;
|
|
|
|
|
|
--(instancetype)initWithFrame:(CGRect)frame;
|
|
|
-
|
|
|
-//NSDictionary *iceMessage=@{
|
|
|
-// @"CHINANET":@"电信",
|
|
|
-// @"CMNET":@"移动",
|
|
|
-// @"UNICOM":@"联通"
|
|
|
-//};
|
|
|
-
|
|
|
--(int)start:(NSURL *)url
|
|
|
- ice:(NSDictionary*)ice
|
|
|
- sn:(NSString*)sn
|
|
|
- direct:(NSInteger)direct
|
|
|
- fmt:(NSInteger)fmt
|
|
|
- videoWidth:(NSInteger)videoWidth
|
|
|
-videoHeight:(NSInteger)videoHeight
|
|
|
- fps:(NSInteger)fps
|
|
|
- bitrate:(NSInteger)bitrate
|
|
|
- cardWidth:(NSInteger)cardWidth
|
|
|
- cardHeight:(NSInteger)cardHeight
|
|
|
-cardDensity:(NSInteger)cardDensity
|
|
|
- token:(NSString*)token;
|
|
|
-
|
|
|
-- (int)startUploadChannel:(NSURL *)url
|
|
|
- ice:(NSDictionary*)ice
|
|
|
- sn:(NSString*)sn
|
|
|
- token:(NSString*)token;
|
|
|
-
|
|
|
-- (void)disconnect;
|
|
|
-
|
|
|
-- (BOOL)sendData:(NSString*)strData;
|
|
|
-
|
|
|
-- (BOOL)sendBinary:(NSData*)data;
|
|
|
-
|
|
|
-- (void)sendKey:(int)value;
|
|
|
-
|
|
|
-- (void)pauseStream;
|
|
|
-
|
|
|
-- (void)resumeStream;
|
|
|
-
|
|
|
-- (void)setMaxBitrate:(NSNumber*)rate;
|
|
|
-
|
|
|
-- (void)setShouldGetStats:(BOOL)shouldGetStats;
|
|
|
-
|
|
|
-- (void)setVideoContentMode:(UIViewContentMode)mode;
|
|
|
-
|
|
|
-- (void)setCardSize:(NSInteger)cardWidth
|
|
|
- cardHeight:(NSInteger)cardHeight
|
|
|
- cardDensity:(NSInteger)cardDensity;
|
|
|
-
|
|
|
-- (void)setVideoSize:(NSInteger)videoWidth
|
|
|
- videoHeight:(NSInteger)videoHeight;
|
|
|
-
|
|
|
-@property (nonatomic, weak) id <MediaStreamClientEventsDelegate> eventDelegate;
|
|
|
-@property(nonatomic,readonly) NSString *name;
|
|
|
-@property(nonatomic, assign) BOOL shouldGetStats;
|
|
|
-
|
|
|
-@end
|
|
|
-
|
|
|
-#endif /* AMediaStream_h */
|
|
|
-//
|
|
|
-// AMediaStream.h
|
|
|
-// all
|
|
|
-//
|
|
|
-// Created by admin on 2024/3/14.
|
|
|
-//
|
|
|
-
|
|
|
-#ifndef AMediaStream_h
|
|
|
-#define AMediaStream_h
|
|
|
-
|
|
|
-#import <Foundation/Foundation.h>
|
|
|
-#import <WebRTC/RTCPeerConnection.h>
|
|
|
-#import <WebRTC/RTCDataChannel.h>
|
|
|
-#import <WebRTC/RTCStatisticsReport.h>
|
|
|
-#import <WebRTC/RTCVideoRenderer.h>
|
|
|
-
|
|
|
-RTC_OBJC_EXPORT
|
|
|
-@protocol RTC_OBJC_TYPE(MediaStreamClientEventsDelegate) <NSObject>
|
|
|
-
|
|
|
-- (void)dataChannelDidChangeFromPeerName:(NSString*)peerName State:(RTCDataChannelState)state;
|
|
|
++(NSString*)getSdkVersion;
|
|
|
|
|
|
--(void)onChannelDataFromPeerName:(NSString*)peerName buffer:(RTC_OBJC_TYPE(RTCDataBuffer) *)buffer;
|
|
|
-
|
|
|
--(void)onChangeConnectionStateFromPeerName:(NSString*)peerName didChangeIceConnectionState:(RTCIceConnectionState)state;
|
|
|
-
|
|
|
--(void)onFrameResolutionChangedFromPeerName:(NSString*)peerName videoWidth:(int)videoWidth videoHeight:(int)videoHeight rotation:(int)rotation;
|
|
|
-
|
|
|
--(void)didGetStats:(NSString*)peerName stats:(RTC_OBJC_TYPE(RTCStatisticsReport) *)stats;
|
|
|
-
|
|
|
-//code 0 成功 1失败
|
|
|
--(void)onAuthResultFromPeerName:(NSString*)peerName code:(int)code descriptions:(NSString*)descriptions;
|
|
|
-
|
|
|
-@end
|
|
|
-
|
|
|
-RTC_OBJC_EXPORT
|
|
|
-@interface RTC_OBJC_TYPE(AMediaStream) : UIView
|
|
|
+-(instancetype)initWithFrame:(CGRect)frame;
|
|
|
|
|
|
-+(void)globalInitialization;
|
|
|
+//start 拉流前调用设置软硬编码,YES硬编码,NO软编码,不调用默认硬编码
|
|
|
+-(void)setVideoCodecHwAcceleration:(BOOL)videoCodecHwAcceleration;
|
|
|
|
|
|
-+(void)globalDeinitialization;
|
|
|
-
|
|
|
--(instancetype)initWithFrame:(CGRect)frame;
|
|
|
+//start 拉流前调用设置本次拉流记录推流端日志到指定文件与记录时间 秒 单位。
|
|
|
+//filePathName = /sdcard/webrtc_box.log captureTime = 30s
|
|
|
+-(void)setCardLogToFile:(NSString*)filePathName captureTime:(NSString*)captureTime;
|
|
|
|
|
|
//NSDictionary *iceMessage=@{
|
|
|
// @"CHINANET":@"电信",
|
|
@@ -172,25 +89,29 @@ cardDensity:(NSInteger)cardDensity
|
|
|
|
|
|
- (BOOL)sendBinary:(NSData*)data;
|
|
|
|
|
|
-- (void)sendKey:(int)value;
|
|
|
+- (BOOL)sendKey:(int)value;
|
|
|
+
|
|
|
+- (BOOL)pauseStream;
|
|
|
|
|
|
-- (void)pauseStream;
|
|
|
+- (BOOL)resumeStream;
|
|
|
|
|
|
-- (void)resumeStream;
|
|
|
+- (BOOL)setAudioEnable:(BOOL)enable;
|
|
|
|
|
|
-- (void)setMaxBitrate:(NSNumber*)rate;
|
|
|
+- (BOOL)setMaxBitrate:(NSNumber*)rate;
|
|
|
+
|
|
|
+- (BOOL)setAutoBitrateEnabled:(BOOL)enable bitrate:(NSNumber*)bitrate;
|
|
|
|
|
|
- (void)setShouldGetStats:(BOOL)shouldGetStats;
|
|
|
|
|
|
- (void)setVideoContentMode:(UIViewContentMode)mode;
|
|
|
|
|
|
-- (void)setCardSize:(NSInteger)cardWidth
|
|
|
+- (BOOL)setCardSize:(NSInteger)cardWidth
|
|
|
cardHeight:(NSInteger)cardHeight
|
|
|
cardDensity:(NSInteger)cardDensity;
|
|
|
|
|
|
-- (void)setVideoSize:(NSInteger)videoWidth
|
|
|
- videoHeight:(NSInteger)videoHeight;
|
|
|
-
|
|
|
+- (BOOL)setVideoSize:(NSInteger)videoWidth
|
|
|
+ videoHeight:(NSInteger)videoHeight
|
|
|
+ frameRate:(NSInteger)frameRate;
|
|
|
|
|
|
@property (nonatomic, weak) id <MediaStreamClientEventsDelegate> eventDelegate;
|
|
|
@property(nonatomic,readonly) NSString *name;
|
|
@@ -198,4 +119,4 @@ cardDensity:(NSInteger)cardDensity
|
|
|
|
|
|
@end
|
|
|
|
|
|
-#endif /* AMediaStream_h */
|
|
|
+#endif
|