| Chunk |
|---|
| Conflicting content |
|---|
return offer;
}
<<<<<<< HEAD
private String createContinueSessionDescription() {
return createSdpBuilder(true, mCodec).build();
}
private String getMediaDescription(SdpSessionDescription.AudioCodec codec) {
return String.format("%d %s/%d", codec.payloadType, codec.name,
codec.sampleRate);
}
private long getSessionId() {
if (mSessionId < 0) {
mSessionId = System.currentTimeMillis();
}
return mSessionId;
}
private SdpSessionDescription.Builder createSdpBuilder(
boolean addTelephoneEvent,
SdpSessionDescription.AudioCodec... codecs) {
String localIp = getLocalIp();
SdpSessionDescription.Builder sdpBuilder;
try {
long sessionVersion = System.currentTimeMillis();
sdpBuilder = new SdpSessionDescription.Builder("SIP Call")
.setOrigin(mLocalProfile, getSessionId(), sessionVersion,
SDPKeywords.IN, SDPKeywords.IPV4, localIp)
.setConnectionInfo(SDPKeywords.IN, SDPKeywords.IPV4,
localIp);
List |
| Solution content |
|---|
return offer;
}
public synchronized void toggleMute() { |
| File |
|---|
| SipAudioCallImpl.java |
| Developer's decision |
|---|
| Manual |
| Kind of conflict |
|---|
| Method declaration |
| Method invocation |
| Method signature |
| Return statement |
| Try statement |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
stopCall(DONT_RELEASE_SOCKET);
mInCall = true;
<<<<<<< HEAD
SdpSessionDescription peerSd = mPeerSd;
String peerMediaAddress = peerSd.getPeerMediaAddress(AUDIO);
// TODO: handle multiple media fields
int peerMediaPort = peerSd.getPeerMediaPort(AUDIO);
Log.i(TAG, "start audiocall " + peerMediaAddress + ":" + peerMediaPort);
int localPort = getLocalMediaPort();
int sampleRate = 8000;
int frameSize = sampleRate / 50; // 160
// TODO: get sample rate from sdp
mCodec = getCodec(peerSd);
AudioStream audioStream = mAudioStream;
audioStream.associate(InetAddress.getByName(peerMediaAddress),
peerMediaPort);
audioStream.setCodec(convert(mCodec), mCodec.payloadType);
audioStream.setDtmfType(DTMF);
Log.d(TAG, "start media: localPort=" + localPort + ", peer="
+ peerMediaAddress + ":" + peerMediaPort);
audioStream.setMode(RtpStream.MODE_NORMAL);
if (!mHold) {
// FIXME: won't work if peer is not sending nor receiving
if (!peerSd.isSending(AUDIO)) {
Log.d(TAG, " not receiving");
audioStream.setMode(RtpStream.MODE_SEND_ONLY);
}
if (!peerSd.isReceiving(AUDIO)) {
Log.d(TAG, " not sending");
audioStream.setMode(RtpStream.MODE_RECEIVE_ONLY);
=======
// Run exact the same logic in createAnswer() to setup mAudioStream.
SimpleSessionDescription offer =
new SimpleSessionDescription(mPeerSd);
AudioStream stream = mAudioStream;
AudioCodec codec = null;
for (Media media : offer.getMedia()) {
if ((codec == null) && (media.getPort() > 0)
&& "audio".equals(media.getType())
&& "RTP/AVP".equals(media.getProtocol())) {
// Find the first audio codec we supported.
for (int type : media.getRtpPayloadTypes()) {
codec = AudioCodec.getCodec(
type, media.getRtpmap(type), media.getFmtp(type));
if (codec != null) {
break;
}
}
if (codec != null) {
// Associate with the remote host.
String address = media.getAddress();
if (address == null) {
address = offer.getAddress();
}
stream.associate(InetAddress.getByName(address),
media.getPort());
stream.setDtmfType(-1);
stream.setCodec(codec);
// Check if DTMF is supported in the same media.
for (int type : media.getRtpPayloadTypes()) {
String rtpmap = media.getRtpmap(type);
if ((type != codec.type) && (rtpmap != null)
&& rtpmap.startsWith("telephone-event")) {
stream.setDtmfType(type);
}
}
// Handle recvonly and sendonly.
if (mHold) {
stream.setMode(RtpStream.MODE_NORMAL);
} else if (media.getAttribute("recvonly") != null) {
stream.setMode(RtpStream.MODE_SEND_ONLY);
} else if(media.getAttribute("sendonly") != null) {
stream.setMode(RtpStream.MODE_RECEIVE_ONLY);
} else if(offer.getAttribute("recvonly") != null) {
stream.setMode(RtpStream.MODE_SEND_ONLY);
} else if(offer.getAttribute("sendonly") != null) {
stream.setMode(RtpStream.MODE_RECEIVE_ONLY);
} else {
stream.setMode(RtpStream.MODE_NORMAL);
}
break;
}
>>>>>>> 2b6528554e4cbcdea1c294647ec9ec9ad41438d7
}
}
if (codec == null) { |
| Solution content |
|---|
stopCall(DONT_RELEASE_SOCKET);
mInCall = true;
// Run exact the same logic in createAnswer() to setup mAudioStream.
SimpleSessionDescription offer =
new SimpleSessionDescription(mPeerSd);
AudioStream stream = mAudioStream;
AudioCodec codec = null;
for (Media media : offer.getMedia()) {
if ((codec == null) && (media.getPort() > 0)
&& "audio".equals(media.getType())
&& "RTP/AVP".equals(media.getProtocol())) {
// Find the first audio codec we supported.
for (int type : media.getRtpPayloadTypes()) {
codec = AudioCodec.getCodec(
type, media.getRtpmap(type), media.getFmtp(type));
if (codec != null) {
break;
}
}
if (codec != null) {
// Associate with the remote host.
String address = media.getAddress();
if (address == null) {
address = offer.getAddress();
}
stream.associate(InetAddress.getByName(address),
media.getPort());
stream.setDtmfType(-1);
stream.setCodec(codec);
// Check if DTMF is supported in the same media.
for (int type : media.getRtpPayloadTypes()) {
String rtpmap = media.getRtpmap(type);
if ((type != codec.type) && (rtpmap != null)
&& rtpmap.startsWith("telephone-event")) {
stream.setDtmfType(type);
}
}
// Handle recvonly and sendonly.
if (mHold) {
stream.setMode(RtpStream.MODE_NORMAL);
} else if (media.getAttribute("recvonly") != null) {
stream.setMode(RtpStream.MODE_SEND_ONLY);
} else if(media.getAttribute("sendonly") != null) {
stream.setMode(RtpStream.MODE_RECEIVE_ONLY);
} else if(offer.getAttribute("recvonly") != null) {
stream.setMode(RtpStream.MODE_SEND_ONLY);
} else if(offer.getAttribute("sendonly") != null) {
stream.setMode(RtpStream.MODE_RECEIVE_ONLY);
} else {
stream.setMode(RtpStream.MODE_NORMAL);
}
break;
}
}
}
if (codec == null) { |
| File |
|---|
| SipAudioCallImpl.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| For statement |
| If statement |
| Method invocation |
| Variable |