Java 类org.webrtc.PeerConnection.SignalingState 实例源码

项目:AndroidRTC    文件:PeerConnectionTest.java   
private static void shutdownPC(PeerConnection pc, ObserverExpectations expectations) {
  if (expectations.dataChannel != null) {
    expectations.dataChannel.unregisterObserver();
    expectations.dataChannel.dispose();
  }
  expectations.expectStatsCallback();
  assertTrue(pc.getStats(expectations, null));
  assertTrue(expectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_SECONDS));
  expectations.expectIceConnectionChange(IceConnectionState.CLOSED);
  expectations.expectSignalingChange(SignalingState.CLOSED);
  pc.close();
  assertTrue(expectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_SECONDS));
  expectations.expectStatsCallback();
  assertTrue(pc.getStats(expectations, null));
  assertTrue(expectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_SECONDS));

  System.out.println("FYI stats: ");
  int reportIndex = -1;
  for (StatsReport[] reports : expectations.takeStatsReports()) {
    System.out.println(" Report #" + (++reportIndex));
    for (int i = 0; i < reports.length; ++i) {
      System.out.println("  " + reports[i].toString());
    }
  }
  assertEquals(1, reportIndex);
  System.out.println("End stats.");

  pc.dispose();
}
项目:AndroidRTC    文件:PeerConnectionTest.java   
public synchronized void expectSignalingChange(SignalingState newState) {
  expectedSignalingChanges.add(newState);
}
项目:AndroidRTC    文件:PeerConnectionTest.java   
@Override
public synchronized void onSignalingChange(SignalingState newState) {
  assertEquals(expectedSignalingChanges.removeFirst(), newState);
}
项目:AndroidRTC    文件:PeerConnectionTest.java   
private static void negotiate(PeerConnection offeringPC,
    ObserverExpectations offeringExpectations, PeerConnection answeringPC,
    ObserverExpectations answeringExpectations) {
  // Create offer.
  SdpObserverLatch sdpLatch = new SdpObserverLatch();
  offeringPC.createOffer(sdpLatch, new MediaConstraints());
  assertTrue(sdpLatch.await());
  SessionDescription offerSdp = sdpLatch.getSdp();
  assertEquals(offerSdp.type, SessionDescription.Type.OFFER);
  assertFalse(offerSdp.description.isEmpty());

  // Set local description for offerer.
  sdpLatch = new SdpObserverLatch();
  offeringExpectations.expectSignalingChange(SignalingState.HAVE_LOCAL_OFFER);
  offeringPC.setLocalDescription(sdpLatch, offerSdp);
  assertTrue(sdpLatch.await());
  assertNull(sdpLatch.getSdp());

  // Set remote description for answerer.
  sdpLatch = new SdpObserverLatch();
  answeringExpectations.expectSignalingChange(SignalingState.HAVE_REMOTE_OFFER);
  answeringPC.setRemoteDescription(sdpLatch, offerSdp);
  assertTrue(sdpLatch.await());
  assertNull(sdpLatch.getSdp());

  // Create answer.
  sdpLatch = new SdpObserverLatch();
  answeringPC.createAnswer(sdpLatch, new MediaConstraints());
  assertTrue(sdpLatch.await());
  SessionDescription answerSdp = sdpLatch.getSdp();
  assertEquals(answerSdp.type, SessionDescription.Type.ANSWER);
  assertFalse(answerSdp.description.isEmpty());

  // Set local description for answerer.
  sdpLatch = new SdpObserverLatch();
  answeringExpectations.expectSignalingChange(SignalingState.STABLE);
  answeringPC.setLocalDescription(sdpLatch, answerSdp);
  assertTrue(sdpLatch.await());
  assertNull(sdpLatch.getSdp());

  // Set remote description for offerer.
  sdpLatch = new SdpObserverLatch();
  offeringExpectations.expectSignalingChange(SignalingState.STABLE);
  offeringPC.setRemoteDescription(sdpLatch, answerSdp);
  assertTrue(sdpLatch.await());
  assertNull(sdpLatch.getSdp());
}
项目:webrtc-java    文件:Observer.java   
@Override
public synchronized void onSignalingChange(SignalingState newState) {
    System.out.println("DEBUG:  SIGNAL CHANGE"); 

}
项目:licodeAndroidClient    文件:LicodeConnector.java   
@Override
public void onSignalingChange(SignalingState arg0) {
}
项目:webrtc-workshop    文件:PeerConnectionWrapper.java   
public void onSignalingChange(SignalingState signalingState) {}