本文整理汇总了Java中org.webrtc.SessionDescription类的典型用法代码示例。如果您正苦于以下问题:Java SessionDescription类的具体用法?Java SessionDescription怎么用?Java SessionDescription使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SessionDescription类属于org.webrtc包,在下文中一共展示了SessionDescription类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRemoteDescription
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onRemoteDescription(final SessionDescription sdp) {
final long delta = System.currentTimeMillis() - callStartedTimeMs;
runOnUiThread(new Runnable() {
@Override
public void run() {
if (peerConnectionClient == null) {
Log.e(TAG, "Received remote SDP for non-initilized peer connection.");
return;
}
logAndToast("Received remote " + sdp.type + ", delay=" + delta + "ms");
peerConnectionClient.setRemoteDescription(sdp);
if (!signalingParameters.initiator) {
logAndToast("Creating ANSWER...");
// Create answer. Answer SDP will be sent to offering client in
// PeerConnectionEvents.onLocalDescription event.
peerConnectionClient.createAnswer();
}
}
});
}
示例2: onLocalDescription
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onLocalDescription(final SessionDescription sdp) {
final long delta = System.currentTimeMillis() - callStartedTimeMs;
runOnUiThread(new Runnable() {
@Override
public void run() {
if (appRtcClient != null) {
logAndToast("Sending " + sdp.type + ", delay=" + delta + "ms");
if (signalingParameters.initiator) {
appRtcClient.sendOfferSdp(sdp);
} else {
appRtcClient.sendAnswerSdp(sdp);
}
}
if (peerConnectionParameters.videoMaxBitrate > 0) {
Log.d(TAG, "Set video maximum bitrate: " + peerConnectionParameters.videoMaxBitrate);
peerConnectionClient.setVideoMaxBitrate(peerConnectionParameters.videoMaxBitrate);
}
}
});
}
示例3: onCreateSuccess
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onCreateSuccess(SessionDescription sdp) {
// TODO: modify sdp to use pcParams prefered codecs
try {
JSONObject payload = new JSONObject();
payload.put("type", sdp.type.canonicalForm());
payload.put("sdp", sdp.description);
Log.i("cek tipe", sdp.type.toString());
Log.i("create sukses", "seberkas cahaya");
pc.setLocalDescription(PnPeer.this, sdp);
pcClient.transmitMessage(id, payload);
} catch (JSONException e) {
e.printStackTrace();
}
}
示例4: setRemoteDescription
import org.webrtc.SessionDescription; //导入依赖的package包/类
public void setRemoteDescription(final SessionDescription sdp) {
executor.execute(new Runnable() {
@Override
public void run() {
if (peerConnection == null || isError) {
return;
}
String sdpDescription = sdp.description;
if (preferIsac) {
sdpDescription = preferCodec(sdpDescription, AUDIO_CODEC_ISAC, true);
}
if (videoCallEnabled) {
sdpDescription = preferCodec(sdpDescription, preferredVideoCodec, false);
}
if (peerConnectionParameters.audioStartBitrate > 0) {
sdpDescription = setStartBitrate(
AUDIO_CODEC_OPUS, false, sdpDescription, peerConnectionParameters.audioStartBitrate);
}
Log.d(TAG, "Set remote SDP.");
SessionDescription sdpRemote = new SessionDescription(sdp.type, sdpDescription);
peerConnection.setRemoteDescription(sdpObserver, sdpRemote);
}
});
}
示例5: onCreateSuccess
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onCreateSuccess(final SessionDescription origSdp) {
if (localSdp != null) {
reportError("Multiple SDP create.");
return;
}
String sdpDescription = origSdp.description;
if (preferIsac) {
sdpDescription = preferCodec(sdpDescription, AUDIO_CODEC_ISAC, true);
}
if (videoCallEnabled) {
sdpDescription = preferCodec(sdpDescription, preferredVideoCodec, false);
}
final SessionDescription sdp = new SessionDescription(origSdp.type, sdpDescription);
localSdp = sdp;
executor.execute(new Runnable() {
@Override
public void run() {
if (peerConnection != null && !isError) {
Log.d(TAG, "Set local SDP from " + sdp.type);
peerConnection.setLocalDescription(sdpObserver, sdp);
}
}
});
}
示例6: onCreateSuccess
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onCreateSuccess(final SessionDescription sessionDescription) {
mExecutorService.execute(new Runnable() {
@Override
public void run() {
curPeerConnection.setLocalDescription(mSDPObserver, sessionDescription);
Log.d(TAG, "Set local SessionDescription and send message.");
// Sending offer to monitor.
JSONObject offer = new JSONObject();
jsonPut(offer, "monitor_id", curMonitorId);
jsonPut(offer, "type", "offer");
jsonPut(offer, "sdp", sessionDescription.description.toString());
Log.d(TAG, "Sending offer SesssionDescription to monitor.");
sendMessage(offer);
}
});
}
示例7: sendOfferSdp
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void sendOfferSdp(final SessionDescription sdp) {
handler.post(new Runnable() {
@Override
public void run() {
if (roomState != ConnectionState.CONNECTED) {
reportError("Sending offer SDP in non connected state.");
return;
}
JSONObject json = new JSONObject();
jsonPut(json, "sdp", sdp.description);
jsonPut(json, "type", "offer");
sendPostMessage(MessageType.MESSAGE, messageUrl, json.toString());
if (connectionParameters.loopback) {
// In loopback mode rename this offer to answer and route it back.
SessionDescription sdpAnswer = new SessionDescription(
SessionDescription.Type.fromCanonicalForm("answer"), sdp.description);
events.onRemoteDescription(sdpAnswer);
}
}
});
}
示例8: sendAnswerSdp
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void sendAnswerSdp(final SessionDescription sdp) {
handler.post(new Runnable() {
@Override
public void run() {
if (connectionParameters.loopback) {
Log.e(TAG, "Sending answer in loopback mode.");
return;
}
JSONObject json = new JSONObject();
jsonPut(json, "sdp", sdp.description);
jsonPut(json, "type", "answer");
wsClient.send(json.toString());
}
});
}
示例9: sendOfferSdp
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void sendOfferSdp(final SessionDescription sdp) {
executor.execute(new Runnable() {
@Override
public void run() {
if (roomState != ConnectionState.CONNECTED) {
reportError("Sending offer SDP in non connected state.");
return;
}
JSONObject json = new JSONObject();
jsonPut(json, "sdp", sdp.description);
jsonPut(json, "type", "offer");
sendMessage(json.toString());
}
});
}
示例10: setRemoteDescription
import org.webrtc.SessionDescription; //导入依赖的package包/类
public void setRemoteDescription(final SessionDescription sdp) {
executor.execute(new Runnable() {
@Override
public void run() {
if (peerConnection == null || isError) {
return;
}
String sdpDescription = sdp.description;
if (preferIsac) {
sdpDescription = preferCodec(sdpDescription, AUDIO_CODEC_ISAC, true);
}
if (videoCallEnabled) {
sdpDescription = preferCodec(sdpDescription, preferredVideoCodec, false);
}
if (peerConnectionParameters.audioStartBitrate > 0) {
sdpDescription = setStartBitrate(
AUDIO_CODEC_OPUS, false, sdpDescription, peerConnectionParameters.audioStartBitrate);
}
Log.d(TAG, "Set remote SDP.");
SessionDescription sdpRemote = new SessionDescription(sdp.type, sdpDescription);
peerConnection.setRemoteDescription(sdpObserver, sdpRemote);
}
});
}
示例11: onCreateSuccess
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onCreateSuccess(final SessionDescription origSdp) {
if (localSdp != null) {
reportError("Multiple SDP create.");
return;
}
String sdpDescription = origSdp.description;
if (preferIsac) {
sdpDescription = preferCodec(sdpDescription, AUDIO_CODEC_ISAC, true);
}
if (videoCallEnabled) {
sdpDescription = preferCodec(sdpDescription, preferredVideoCodec, false);
}
final SessionDescription sdp = new SessionDescription(origSdp.type, sdpDescription);
localSdp = sdp;
executor.execute(new Runnable() {
@Override
public void run() {
if (peerConnection != null && !isError) {
Log.d(TAG, "Set local SDP from " + sdp.type);
peerConnection.setLocalDescription(sdpObserver, sdp);
}
}
});
}
示例12: onRemoteDescription
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onRemoteDescription(final SessionDescription sdp) {
final long delta = System.currentTimeMillis() - callStartedTimeMs;
runOnUiThread(new Runnable() {
@Override
public void run() {
if (peerConnectionClient == null) {
Log.e(TAG, "Received remote SDP for non-initilized peer connection.");
return;
}
logAndToast("Received remote " + sdp.type + ", delay=" + delta + "ms");
peerConnectionClient.setRemoteDescription(sdp);
if (!signalingParameters.initiator) {
logAndToast("Creating ANSWER...");
// Create answer. Answer SDP will be sent to offering client in
// PeerConnectionEvents.onLocalDescription event.
peerConnectionClient.createAnswer();
}
}
});
}
示例13: onLocalDescription
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void onLocalDescription(final SessionDescription sdp) {
final long delta = System.currentTimeMillis() - callStartedTimeMs;
runOnUiThread(new Runnable() {
@Override
public void run() {
if (appRtcClient != null) {
logAndToast("Sending " + sdp.type + ", delay=" + delta + "ms");
if (signalingParameters.initiator) {
appRtcClient.sendOfferSdp(sdp);
} else {
appRtcClient.sendAnswerSdp(sdp);
}
}
if (peerConnectionParameters.videoMaxBitrate > 0) {
Log.d(TAG, "Set video maximum bitrate: " + peerConnectionParameters.videoMaxBitrate);
peerConnectionClient.setVideoMaxBitrate(peerConnectionParameters.videoMaxBitrate);
}
}
});
}
示例14: sendOfferSdp
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void sendOfferSdp(final SessionDescription sdp) {
handler.post(new Runnable() {
@Override
public void run() {
if (roomState != ConnectionState.CONNECTED) {
reportError("Sending offer SDP in non connected state.");
return;
}
JSONObject json = new JSONObject();
jsonPut(json, "sdp", sdp.description);
jsonPut(json, "type", "offer");
sendPostMessage(MessageType.MESSAGE, messageUrl, json.toString());
if (connectionParameters.loopback) {
// In loopback mode rename this offer to answer and route it back.
SessionDescription sdpAnswer = new SessionDescription(
SessionDescription.Type.fromCanonicalForm("answer"), sdp.description);
events.onRemoteDescription(sdpAnswer);
}
}
});
}
示例15: sendAnswerSdp
import org.webrtc.SessionDescription; //导入依赖的package包/类
@Override
public void sendAnswerSdp(final SessionDescription sdp) {
handler.post(new Runnable() {
@Override
public void run() {
if (connectionParameters.loopback) {
Log.e(TAG, "Sending answer in loopback mode.");
return;
}
JSONObject json = new JSONObject();
jsonPut(json, "sdp", sdp.description);
jsonPut(json, "type", "answer");
wsClient.send(json.toString());
}
});
}