From a1975d9d81a196ccdada9dbb6d807dc509da3205 Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Wed, 25 Nov 2009 14:53:11 +0000 Subject: [PATCH] Adds event dispatching for changes of the remote source id in RTP streams --- .../impl/neomedia/MediaStreamImpl.java | 32 ++++++++++++++++++- .../service/neomedia/MediaStream.java | 6 ++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java b/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java index b743f02e6..b74f84725 100644 --- a/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java +++ b/src/net/java/sip/communicator/impl/neomedia/MediaStreamImpl.java @@ -1238,7 +1238,7 @@ public void update(ReceiveStreamEvent event) logger.trace("Received new ReceiveStream with ssrc " + receiveStream.getSSRC()); - this.remoteSourceID = Long.toString( receiveStream.getSSRC() ); + setRemoteSourceID( Long.toString( receiveStream.getSSRC() )); synchronized (receiveStreams) { @@ -1300,4 +1300,34 @@ public void update(SessionEvent event) { // TODO Auto-generated method stub } + + /** + * Sets the local SSRC identifier and fires the corresponding + * PropertyChangeEvent. + * + * @param ssrc the SSRC identifier that this stream will be using in + * outgoing RTP packets from now on. + */ + private void setLocalSourceID(String ssrc) + { + String oldValue = this.localSourceID; + this.localSourceID = ssrc; + + firePropertyChange(PNAME_LOCAL_SSRC, oldValue, ssrc); + } + + /** + * Sets the remote SSRC identifier and fires the corresponding + * PropertyChangeEvent. + * + * @param ssrc the SSRC identifier that this stream will be using in + * outgoing RTP packets from now on. + */ + private void setRemoteSourceID(String ssrc) + { + String oldValue = this.remoteSourceID; + this.remoteSourceID = ssrc; + + firePropertyChange(PNAME_REMOTE_SSRC, oldValue, ssrc); + } } diff --git a/src/net/java/sip/communicator/service/neomedia/MediaStream.java b/src/net/java/sip/communicator/service/neomedia/MediaStream.java index 34b10066b..c5fa7fde2 100644 --- a/src/net/java/sip/communicator/service/neomedia/MediaStream.java +++ b/src/net/java/sip/communicator/service/neomedia/MediaStream.java @@ -29,15 +29,13 @@ public interface MediaStream * The name of the property which indicates whether the remote SSRC is * currently available. */ - public static final String PNAME_LOCAL_SSRC_AVAILABLE - = "localSSRCAvailable"; + public static final String PNAME_LOCAL_SSRC = "localSSRCAvailable"; /** * The name of the property which indicates whether the local SSRC is * currently available. */ - public static final String PNAME_REMOTE_SSRC_AVAILABLE - = "remoteSSRCAvailable"; + public static final String PNAME_REMOTE_SSRC = "remoteSSRCAvailable"; /** * Starts capturing media from this stream's MediaDevice and then