Skip to content
Snippets Groups Projects
Commit f9104406 authored by Boris Grozev's avatar Boris Grozev
Browse files

Adds a MediaStream.removeReceiveStreamForSsrc() method

parent d9a5d4e2
No related branches found
No related tags found
No related merge requests found
...@@ -2888,4 +2888,37 @@ public void addDynamicRTPPayloadTypeOverride(byte originalPt, ...@@ -2888,4 +2888,37 @@ public void addDynamicRTPPayloadTypeOverride(byte originalPt,
ptTransformEngine.addPTMappingOverride(originalPt, overloadPt); ptTransformEngine.addPTMappingOverride(originalPt, overloadPt);
} }
} }
/**
* {@inheritDoc}
*/
public void removeReceiveStreamForSsrc(long ssrc)
{
Vector receiveStreamsVector = rtpManager.getReceiveStreams();
ReceiveStream toRemove = null;
for(int i=0; i<receiveStreamsVector.size(); i++)
{
ReceiveStream receiveStream
= (ReceiveStream) receiveStreamsVector.get(i);
if (receiveStream.getSSRC() == ssrc)
{
toRemove = receiveStream;
break;
}
}
if (toRemove != null)
{
synchronized (receiveStreams)
{
if (receiveStreams.contains(toRemove))
{
receiveStreams.remove(toRemove);
MediaDeviceSession deviceSession = getDeviceSession();
if (deviceSession != null)
deviceSession.removeReceiveStream(toRemove);
}
}
}
}
} }
...@@ -376,4 +376,12 @@ public void addDynamicRTPPayloadTypeOverride(byte originalPt, ...@@ -376,4 +376,12 @@ public void addDynamicRTPPayloadTypeOverride(byte originalPt,
* this MediaStream. * this MediaStream.
*/ */
public MediaStreamStats getMediaStreamStats(); public MediaStreamStats getMediaStreamStats();
/**
* Removes the <tt>ReceiveStream</tt> with SSRC <tt>ssrc</tt>, if there is
* such a <tt>ReceiveStream</tt>, from the receive streams of this
* <tt>MediaStream</tt>
* @param ssrc the SSRC for which to remove a <tt>ReceiveStream</tt>
*/
public void removeReceiveStreamForSsrc(long ssrc);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment