webrtc_m130/talk/app/webrtc/objc/public/RTCPeerConnection.h
deadbeef a67696b3cd Reland of Adding PeerConnectionInterface::SetConfiguration method. (patchset #1 id:1 of https://codereview.webrtc.org/1361263002/ )
Reason for revert:
Relanding with SetConfiguration not pure virtual.

Original issue's description:
> Revert of Adding PeerConnectionInterface::SetConfiguration method. (patchset #4 id:60001 of https://codereview.webrtc.org/1317353005/ )
>
> Reason for revert:
> Broke FYI bots because SetConfiguration is pure virtual and MockPeerConnectionImpl doesn't implement it. Need to reland with SetConfiguration not pure virtual.
>
> Original issue's description:
> > Adding PeerConnectionInterface::SetConfiguration method.
> >
> > Also updated the JNI and Objective-C bindings. Later, will have a CL to
> > remove UpdateIce, which this method effectively replaces.
> >
> > BUG=webrtc:4945
> >
> > Committed: https://crrev.com/70702afbcb8418fe93747e7ed63bcbf5e56b90e9
> > Cr-Commit-Position: refs/heads/master@{#10040}
>
> TBR=guoweis@webrtc.org,pthatcher@webrtc.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4945
>
> Committed: https://crrev.com/7603c76ab077b1e2033bb179595129bd96797345
> Cr-Commit-Position: refs/heads/master@{#10041}

TBR=guoweis@webrtc.org,pthatcher@webrtc.org,tkchin@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4945

Review URL: https://codereview.webrtc.org/1361273002

Cr-Commit-Position: refs/heads/master@{#10112}
2015-09-29 18:56:30 +00:00

128 lines
5.5 KiB
Objective-C

/*
* libjingle
* Copyright 2013 Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import "RTCPeerConnectionDelegate.h"
@class RTCConfiguration;
@class RTCDataChannel;
@class RTCDataChannelInit;
@class RTCICECandidate;
@class RTCICEServers;
@class RTCMediaConstraints;
@class RTCMediaStream;
@class RTCMediaStreamTrack;
@class RTCSessionDescription;
@protocol RTCSessionDescriptionDelegate;
@protocol RTCStatsDelegate;
// RTCPeerConnection is an ObjectiveC friendly wrapper around a PeerConnection
// object. See the documentation in talk/app/webrtc/peerconnectioninterface.h.
// or http://www.webrtc.org/reference/native-apis, which in turn is inspired by
// the JS APIs: http://dev.w3.org/2011/webrtc/editor/webrtc.html and
// http://www.w3.org/TR/mediacapture-streams/
@interface RTCPeerConnection : NSObject
@property(nonatomic, weak) id<RTCPeerConnectionDelegate> delegate;
// Accessor methods to active local streams.
@property(nonatomic, strong, readonly) NSArray *localStreams;
// The local description.
@property(nonatomic, assign, readonly) RTCSessionDescription *localDescription;
// The remote description.
@property(nonatomic, assign, readonly) RTCSessionDescription *remoteDescription;
// The current signaling state.
@property(nonatomic, assign, readonly) RTCSignalingState signalingState;
@property(nonatomic, assign, readonly) RTCICEConnectionState iceConnectionState;
@property(nonatomic, assign, readonly) RTCICEGatheringState iceGatheringState;
// Add a new MediaStream to be sent on this PeerConnection.
// Note that a SessionDescription negotiation is needed before the
// remote peer can receive the stream.
- (BOOL)addStream:(RTCMediaStream *)stream;
// Remove a MediaStream from this PeerConnection.
// Note that a SessionDescription negotiation is need before the
// remote peer is notified.
- (void)removeStream:(RTCMediaStream *)stream;
// Create a data channel.
- (RTCDataChannel*)createDataChannelWithLabel:(NSString*)label
config:(RTCDataChannelInit*)config;
// Create a new offer.
// Success or failure will be reported via RTCSessionDescriptionDelegate.
- (void)createOfferWithDelegate:(id<RTCSessionDescriptionDelegate>)delegate
constraints:(RTCMediaConstraints *)constraints;
// Create an answer to an offer.
// Success or failure will be reported via RTCSessionDescriptionDelegate.
- (void)createAnswerWithDelegate:(id<RTCSessionDescriptionDelegate>)delegate
constraints:(RTCMediaConstraints *)constraints;
// Sets the local session description.
// Success or failure will be reported via RTCSessionDescriptionDelegate.
- (void)
setLocalDescriptionWithDelegate:(id<RTCSessionDescriptionDelegate>)delegate
sessionDescription:(RTCSessionDescription *)sdp;
// Sets the remote session description.
// Success or failure will be reported via RTCSessionDescriptionDelegate.
- (void)
setRemoteDescriptionWithDelegate:(id<RTCSessionDescriptionDelegate>)delegate
sessionDescription:(RTCSessionDescription *)sdp;
// Sets the PeerConnection's global configuration to |configuration|.
// Any changes to STUN/TURN servers or ICE candidate policy will affect the
// next gathering phase, and cause the next call to createOffer to generate
// new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies
// cannot be changed with this method.
- (BOOL)setConfiguration:(RTCConfiguration *)configuration;
// Provides a remote candidate to the ICE Agent.
- (BOOL)addICECandidate:(RTCICECandidate *)candidate;
// Terminates all media and closes the transport.
- (void)close;
// Gets statistics for the media track. If |mediaStreamTrack| is nil statistics
// are gathered for all tracks.
// Statistics information will be reported via RTCStatsDelegate.
- (BOOL)getStatsWithDelegate:(id<RTCStatsDelegate>)delegate
mediaStreamTrack:(RTCMediaStreamTrack*)mediaStreamTrack
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel;
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Disallow init and don't add to documentation
- (id)init __attribute__(
(unavailable("init is not a supported initializer for this class.")));
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
@end