From 52573da220efbde18a42dbf82085c1a3e8b70c82 Mon Sep 17 00:00:00 2001 From: maross Date: Mon, 18 Jan 2016 09:29:38 +0100 Subject: [PATCH] room & doc changes --- Classes/Room/NBMRoom.h | 2 +- Classes/Room/NBMRoomClient.h | 7 +- Classes/Room/NBMRoomClient.m | 29 +-- Classes/Room/NBMRoomClientDelegate.h | 2 +- .../KurentoToolboxTestApp/ViewController.m | 9 +- .../{NBMError.html => NBMEAGLRenderer.html} | 75 +++++--- ...or.html => NBMEAGLVideoViewContainer.html} | 50 +++-- docs/html/Classes/NBMJSONRPCClient.html | 36 +--- .../NBMJSONRPCClientConfiguration.html | 2 +- docs/html/Classes/NBMJSONRPCClientError.html | 111 ----------- docs/html/Classes/NBMJSONRPCError.html | 177 ------------------ docs/html/Classes/NBMMediaConfiguration.html | 2 +- docs/html/Classes/NBMPeer.html | 2 +- docs/html/Classes/NBMPeerConnection.html | 2 +- docs/html/Classes/NBMRequest.html | 2 +- docs/html/Classes/NBMResponse.html | 2 +- docs/html/Classes/NBMResponseError.html | 2 +- docs/html/Classes/NBMRoom.html | 4 +- docs/html/Classes/NBMRoomClient.html | 56 +++++- docs/html/Classes/NBMRoomError.html | 4 +- docs/html/Classes/NBMWebRTCPeer.html | 20 +- docs/html/Constants/NBMAudioCodec.html | 2 +- docs/html/Constants/NBMCameraPosition.html | 2 +- .../Constants/NBMJSONRPCClientErrorCode.html | 144 -------------- docs/html/Constants/NBMPixelFormat.html | 2 +- docs/html/Constants/NBMRendererType.html | 2 +- docs/html/Constants/NBMResponseErrorCode.html | 2 +- .../Constants/NBMRoomClientErrorCode.html | 8 +- docs/html/Constants/NBMRoomErrorCode.html | 42 ++--- docs/html/Constants/NBMVideoCodec.html | 2 +- .../Protocols/NBMJSONRPCClientDelegate.html | 2 +- docs/html/Protocols/NBMMessage.html | 2 +- docs/html/Protocols/NBMRenderer.html | 2 +- docs/html/Protocols/NBMRendererDelegate.html | 2 +- .../html/Protocols/NBMRoomClientDelegate.html | 2 +- .../html/Protocols/NBMWebRTCPeerDelegate.html | 2 +- docs/html/hierarchy.html | 28 +-- docs/html/index.html | 14 +- 38 files changed, 254 insertions(+), 602 deletions(-) rename docs/html/Classes/{NBMError.html => NBMEAGLRenderer.html} (53%) rename docs/html/Classes/{NBMRoomClientError.html => NBMEAGLVideoViewContainer.html} (62%) delete mode 100644 docs/html/Classes/NBMJSONRPCClientError.html delete mode 100644 docs/html/Classes/NBMJSONRPCError.html delete mode 100644 docs/html/Constants/NBMJSONRPCClientErrorCode.html diff --git a/Classes/Room/NBMRoom.h b/Classes/Room/NBMRoom.h index a795d75..066d2ac 100644 --- a/Classes/Room/NBMRoom.h +++ b/Classes/Room/NBMRoom.h @@ -54,7 +54,7 @@ typedef NS_ENUM(NSInteger, NBMRoomErrorCode) { - (instancetype)initWithUsername:(NSString *)username roomName:(NSString *)name roomURL:(NSURL *)url; @property (nonatomic, copy, readonly) NSString *name; -@property (nonatomic, strong) NSURL *url; +@property (nonatomic, strong, readonly) NSURL *url; @property (nonatomic, copy, readonly) NBMPeer *localPeer; @property (nonatomic, strong, readonly) NSSet *peers; diff --git a/Classes/Room/NBMRoomClient.h b/Classes/Room/NBMRoomClient.h index cc7affc..d15c9fe 100644 --- a/Classes/Room/NBMRoomClient.h +++ b/Classes/Room/NBMRoomClient.h @@ -35,7 +35,8 @@ typedef NS_ENUM(NSInteger, NBMRoomClientErrorCode) { @interface NBMRoomClient : NSObject @property (nonatomic, weak) id delegate; -@property (nonatomic, readonly) NSDictionary *peers; +@property (nonatomic, readonly) NSSet *peers; +@property (nonatomic, readonly) NBMRoom *room; @property (nonatomic, assign, readonly) NSTimeInterval timeout; @property (nonatomic, assign, readonly, getter = isConnected) BOOL connected; @property (nonatomic, assign, readonly, getter = isJoined) BOOL joined; @@ -65,8 +66,8 @@ typedef NS_ENUM(NSInteger, NBMRoomClientErrorCode) { - (void)unsubscribeVideoFromPeer:(NBMPeer *)peer; - (void)unsubscribeVideoFromPeer:(NBMPeer *)peer completion:(void (^)(NSString *sdpAnswer, NSError *error))block; -- (void)sendICECandidate:(RTCICECandidate *)candidate; -- (void)sendICECandidate:(RTCICECandidate *)candidate completion:(void (^)(NSError *error))block; +- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer; +- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer completion:(void (^)(NSError *error))block; - (void)sendMessage:(NSString *)message; - (void)sendMessage:(NSString *)message completion:(void (^)(NSError *error))block; diff --git a/Classes/Room/NBMRoomClient.m b/Classes/Room/NBMRoomClient.m index 7603547..924ab5a 100644 --- a/Classes/Room/NBMRoomClient.m +++ b/Classes/Room/NBMRoomClient.m @@ -140,7 +140,7 @@ @interface NBMRoomClient () @property (nonatomic, assign) BOOL closeRequested; @property (nonatomic, strong) NSError *rpcError; -@property (nonatomic, strong) NBMRoom *room; +@property (nonatomic, strong, readwrite) NBMRoom *room; @property (nonatomic, strong) NSMutableDictionary *mutableRoomPeers; @property (nonatomic, assign) BOOL joined; //@property (nonatomic, assign) BOOL joinRoomRequested; @@ -180,6 +180,12 @@ - (void)connect { } } +#pragma mark - Properties + +- (NBMRoom *)room { + return self.room; +} + #pragma mark Join room - (void)joinRoom:(JoinRoomBlock)completionBlock { @@ -268,16 +274,16 @@ - (void)unsubscribeVideoFromPeer:(NBMPeer *)peer completion:(void (^)(NSString * #pragma mark Send ICE candidate -- (void)sendICECandidate:(RTCICECandidate *)candidate { - return [self sendICECandidate:candidate completion:^(NSError *error) { - if ([self.delegate respondsToSelector:@selector(client:didSentICECandidate:)]) { - [self.delegate client:self didSentICECandidate:error]; +- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer { + return [self sendICECandidate:candidate forPeer:peer completion:^(NSError *error) { + if ([self.delegate respondsToSelector:@selector(client:didSentICECandidate:forPeer:)]) { + [self.delegate client:self didSentICECandidate:error forPeer:peer]; } }]; } -- (void)sendICECandidate:(RTCICECandidate *)candidate completion:(void (^)(NSError *))block { - [self nbm_sendICECandidate:candidate completion:block]; +- (void)sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer completion:(void (^)(NSError *))block { + [self nbm_sendICECandidate:candidate forPeer:peer completion:block]; } #pragma mark Send message @@ -499,8 +505,8 @@ - (void)nbm_unsubscribeVideoFormPeer:(NBMPeer *)peer completion:(void (^)(NSStri #pragma mark Send ICE candidate -- (void)nbm_sendICECandidate:(RTCICECandidate *)candidate completion:(void (^)(NSError *error))block { - NSDictionary *params = @{kOnIceCandidateEpnameParam: self.room.localPeer.identifier, +- (void)nbm_sendICECandidate:(RTCICECandidate *)candidate forPeer:(NBMPeer *)peer completion:(void (^)(NSError *error))block { + NSDictionary *params = @{kOnIceCandidateEpnameParam: peer.identifier, kOnIceCandidateCandidateParam: candidate.sdp ?: @"", kOnIceCandidateSdpMidParam: candidate.sdpMid ?: @"", kOnIceCandidateSdpMLineIndexParam: @(candidate.sdpMLineIndex)}; @@ -556,8 +562,9 @@ - (NBMPeer *)peerWithIdentifier:(NSString *)identifier { return peer; } -- (NSDictionary *)peers { - return [self.mutableRoomPeers copy]; +- (NSSet *)peers { + NSArray *allPeers = [self.mutableRoomPeers allValues]; + return [NSSet setWithArray:allPeers]; } #pragma mark Room events diff --git a/Classes/Room/NBMRoomClientDelegate.h b/Classes/Room/NBMRoomClientDelegate.h index cb6bcca..05ad40f 100644 --- a/Classes/Room/NBMRoomClientDelegate.h +++ b/Classes/Room/NBMRoomClientDelegate.h @@ -43,7 +43,7 @@ - (void)client:(NBMRoomClient *)client didReceiveVideoFrom:(NBMPeer *)peer sdpAnswer:(NSString *)sdpAnswer error:(NSError *)error; - (void)client:(NBMRoomClient *)client didUnsubscribeVideoFrom:(NBMPeer *)peer sdpAnswer:(NSString *)sdpAnswer error:(NSError *)error; -- (void)client:(NBMRoomClient *)client didSentICECandidate:(NSError *)error; +- (void)client:(NBMRoomClient *)client didSentICECandidate:(NSError *)error forPeer:(NBMPeer *)peer; - (void)client:(NBMRoomClient *)client didSentMessage:(NSError *)error; diff --git a/KurentoToolboxTestApp/KurentoToolboxTestApp/ViewController.m b/KurentoToolboxTestApp/KurentoToolboxTestApp/ViewController.m index c4118e2..7c0fba2 100644 --- a/KurentoToolboxTestApp/KurentoToolboxTestApp/ViewController.m +++ b/KurentoToolboxTestApp/KurentoToolboxTestApp/ViewController.m @@ -26,13 +26,18 @@ @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. - NBMRoom *roomm = [[NBMRoom alloc] initWithUsername:@"maross" roomName:@"mr5" roomURL:[NSURL URLWithString:@"http://kurento.teamlife.it:8080/room"]]; - self.roomClient = [[NBMRoomClient alloc] initWithRoom:roomm timeout:10 delegate:self]; + NBMMediaConfiguration *mediaConfig = [NBMMediaConfiguration defaultConfiguration]; + NBMWebRTCPeer *web = [[NBMWebRTCPeer alloc] initWithDelegate:self configuration:nil]; + NBMRoom *room = [[NBMRoom alloc] initWithUsername:@"maross" roomName:@"mr5" roomURL:[NSURL URLWithString:@"http://kurento.teamlife.it:8080/room"]]; + self.roomClient = [[NBMRoomClient alloc] initWithRoom:room timeout:10 delegate:self]; [self enableButtons:NO]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + [self.roomClient joinRoom:^(NSDictionary *peers, NSError *error) { + + }]; // if (self.roomClient.connected) { // for (int i = 0; i<5; i++) { // [self.roomClient joinRoom]; diff --git a/docs/html/Classes/NBMError.html b/docs/html/Classes/NBMEAGLRenderer.html similarity index 53% rename from docs/html/Classes/NBMError.html rename to docs/html/Classes/NBMEAGLRenderer.html index ca43631..7884755 100644 --- a/docs/html/Classes/NBMError.html +++ b/docs/html/Classes/NBMEAGLRenderer.html @@ -3,7 +3,7 @@ - NBMError Class Reference + NBMEAGLRenderer Class Reference @@ -52,25 +52,27 @@

- - - + + + - + - + - + - + + + - + @@ -87,16 +89,19 @@

- -

– init + +

  hasVideoData

@@ -188,7 +209,7 @@

– init<
-
- (id)init
+
@property (atomic, assign, readonly) BOOL hasVideoData
@@ -208,7 +229,7 @@

– init<