/** * Gets the SSRC of a <tt>ReceiveStream</tt> as a (non-negative) * <tt>long</tt>. * * FMJ stores the 32-bit SSRC values in <tt>int</tt>s, and the * <tt>ReceiveStream.getSSRC()</tt> implementation(s) don't take care of * converting the negative <tt>int</tt> values sometimes resulting from * reading of a 32-bit field into the correct unsigned <tt>long</tt> value. * So do the conversion here. * * @param receiveStream the <tt>ReceiveStream</tt> for which to get the SSRC. * @return the SSRC of <tt>receiveStream</tt> an a (non-negative) * <tt>long</tt>. */ private long getReceiveStreamSSRC(ReceiveStream receiveStream) { return 0xffffffffL & receiveStream.getSSRC(); }
/** * Adds a specific <tt>ReceiveStream</tt> to the list of * <tt>ReceiveStream</tt>s known to this instance to be contributing * audio to the mix produced by its associated <tt>AudioMixer</tt>. * * @param receiveStream the <tt>ReceiveStream</tt> to be added to the * list of <tt>ReceiveStream</tt>s known to this instance to be * contributing audio to the mix produced by its associated * <tt>AudioMixer</tt> */ @Override public void addReceiveStream(ReceiveStream receiveStream) { addSSRC(0xFFFFFFFFL & receiveStream.getSSRC()); }
/** * Gets the <tt>Player</tt> rendering the <tt>ReceiveStream</tt> with a * specific SSRC. * * @param ssrc the SSRC of the <tt>ReceiveStream</tt> to get the rendering * the <tt>Player</tt> of * @return the <tt>Player</tt> rendering the <tt>ReceiveStream</tt> with the * specified <tt>ssrc</tt> */ protected Player getPlayer(long ssrc) { Lock readLock = playbacksLock.readLock(); readLock.lock(); try { for (Playback playback : playbacks) { long playbackSSRC = 0xFFFFFFFFL & playback.receiveStream.getSSRC(); if (playbackSSRC == ssrc) return playback.player; } } finally { readLock.unlock(); } return null; }
/** * Gets a <tt>ReceiveStream</tt> which this instance plays back on its * associated <tt>MediaDevice</tt> and which has a specific synchronization * source identifier (SSRC). * * @param ssrc the synchronization source identifier of the * <tt>ReceiveStream</tt> to return * @return a <tt>ReceiveStream</tt> which this instance plays back on its * associated <tt>MediaDevice</tt> and which has the specified <tt>ssrc</tt> */ public ReceiveStream getReceiveStream(int ssrc) { for (ReceiveStream receiveStream : getReceiveStreams()) { int receiveStreamSSRC = (int) receiveStream.getSSRC(); if (receiveStreamSSRC == ssrc) return receiveStream; } return null; }
/** * Removes a specific <tt>ReceiveStream</tt> from the list of * <tt>ReceiveStream</tt>s known to this instance to be contributing * audio to the mix produced by its associated <tt>AudioMixer</tt>. * * @param receiveStream the <tt>ReceiveStream</tt> to be removed from * the list of <tt>ReceiveStream</tt>s known to this instance to be * contributing audio to the mix produced by its associated * <tt>AudioMixer</tt> */ @Override public void removeReceiveStream(ReceiveStream receiveStream) { long ssrc = 0xFFFFFFFFL & receiveStream.getSSRC(); removeSSRC(ssrc); //make sure we no longer cache levels for that stream. audioLevelCache.removeLevel(ssrc); } }
int receiveSSRC = (int) receiveStream.getSSRC();
removeSSRC(0xFFFFFFFFL & receiveStream.getSSRC()); if (playback.dataSource != null) removePlaybackDataSource(playback.dataSource);
dispatcher.setAudioLevelCache( audioLevelCache, 0xFFFFFFFFL & stream.getSSRC()); streamAudioLevelListeners.put(stream, dispatcher);
addSSRC(0xFFFFFFFFL & receiveStream.getSSRC());
int receiveSSRC = (int) receiveStream.getSSRC(); StreamRTPManagerDesc streamRTPManagerDesc = findStreamRTPManagerDescByReceiveSSRC(receiveSSRC, null);
long ssrc = receiveStream.getSSRC() & 0xffffffffL;
SSRCInfo info = cache.cache.get((int) receiveStream.getSSRC());
long receiveStreamSSRC = 0xFFFFFFFFL & receiveStream.getSSRC();
= new RTCPExtendedReport.VoIPMetricsReportBlock(); voipMetrics.setSourceSSRC((int) receiveStream.getSSRC());