PeerConnection(java): rationalize pointer-to-jlong conversion.
In r4665 I went a bit crazy with the manual reinterpretation of a pointer to a jlong (to avoid undefined behavior) but that's what reinterpret_cast<> is for. So use it directly now. Added a do-nothing DataChannel to AppRTCDemo to regression test this, since the only repro I've found of the original bug requires ARM ABI (PeerConnectionTest on ia32 fails to repro). BUG=2302 R=henrike@webrtc.org Review URL: https://webrtc-codereview.appspot.com/5489004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5269 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -171,11 +171,26 @@ public class AppRTCDemoActivity extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Just for fun (and to regression-test bug 2302) make sure that DataChannels
|
||||
// can be created, queried, and disposed.
|
||||
private static void createDataChannelToRegressionTestBug2302(
|
||||
PeerConnection pc) {
|
||||
DataChannel dc = pc.createDataChannel("dcLabel", new DataChannel.Init());
|
||||
abortUnless("dcLabel".equals(dc.label()), "WTF?");
|
||||
dc.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIceServers(List<PeerConnection.IceServer> iceServers) {
|
||||
factory = new PeerConnectionFactory();
|
||||
pc = factory.createPeerConnection(
|
||||
iceServers, appRtcClient.pcConstraints(), pcObserver);
|
||||
|
||||
MediaConstraints pcConstraints = appRtcClient.pcConstraints();
|
||||
pcConstraints.optional.add(
|
||||
new MediaConstraints.KeyValuePair("RtpDataChannels", "true"));
|
||||
pc = factory.createPeerConnection(iceServers, pcConstraints, pcObserver);
|
||||
|
||||
createDataChannelToRegressionTestBug2302(pc); // See method comment.
|
||||
|
||||
// Uncomment to get ALL WebRTC tracing and SENSITIVE libjingle logging.
|
||||
// NOTE: this _must_ happen while |factory| is alive!
|
||||
|
Reference in New Issue
Block a user