svn commit: r7038 - trunk/src/net/java/sip/communicator: impl/protocol/sip impl/protocol/sip/sdp service/neomedia service/neomedia/format

emcho at dev.java.net emcho at dev.java.net
Fri Apr 23 21:41:41 CEST 2010


Author: emcho
Date: 2010-04-23 19:41:39+0000
New Revision: 7038

Modified:
   trunk/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandler.java
   trunk/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java
   trunk/src/net/java/sip/communicator/service/neomedia/MediaStream.java
   trunk/src/net/java/sip/communicator/service/neomedia/RTPExtension.java
   trunk/src/net/java/sip/communicator/service/neomedia/format/MediaFormat.java

Log:
Adds a few more comments to media parsing

Modified: trunk/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandler.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandler.java?view=diff&rev=7038&p1=trunk/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandler.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandler.java&r1=7037&r2=7038
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandler.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandler.java	2010-04-23 19:41:39+0000
@@ -681,6 +681,7 @@
                                         getStreamConnector(mediaType),
                                         direction,
                                         dev.getSupportedExtensions());
+System.out.println("supported extensions="+ dev.getSupportedExtensions());
 
                     if(peer.getCall().isSipZrtpAttribute())
                     {
@@ -841,8 +842,6 @@
             //this is a reinit
         }
 
-        stream.setAdvancedAttributes(format.getAdvancedParameters());
-
         return  configureAndStartStream(
                         device, format, target, direction, stream);
     }
@@ -1014,6 +1013,7 @@
             RTPExtension rtpExtension = mapEntry.getKey();
 
             stream.addRTPExtension(extensionID, rtpExtension);
+System.out.println("extensionID="+ extensionID + " rtpExtension=" + rtpExtension);
         }
     }
 

Modified: trunk/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java?view=diff&rev=7038&p1=trunk/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java&p2=trunk/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java&r1=7037&r2=7038
==============================================================================
--- trunk/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java	(original)
+++ trunk/src/net/java/sip/communicator/impl/protocol/sip/sdp/SdpUtils.java	2010-04-23 19:41:39+0000
@@ -232,6 +232,9 @@
         newMediaDescriptions
             = new Vector<MediaDescription>(newMediaDescriptions);
 
+        //this loop determines which streams are discontinued in the new
+        //description so that we could explicitly disable them with the new
+        //description. this loop also guarantees we keep the order of streams
         for(MediaDescription medToUpdate : prevMedias)
         {
             MediaType type = getMediaType(medToUpdate);
@@ -239,8 +242,9 @@
 
             if (desc == null)
             {
-                //obviously we don't want a stream of that type so make sure
-                //the old one is disabled
+                //a stream that was in the old description seems to be no longer
+                //there in the new one. We need to create the SDP necessary to
+                //explicitly disable it then.
                 desc = createDisablingAnswer(medToUpdate);
             }
 
@@ -725,7 +729,6 @@
      */
     private static Map<String, String> parseAdvancedAttributes(
             List<Attribute> attrs)
-            throws SdpException
     {
         if(attrs == null)
             return null;
@@ -734,8 +737,19 @@
 
         for(Attribute attr : attrs)
         {
-            String attrName = attr.getName();
-            String attrVal = attr.getValue();
+            String attrName;
+            String attrVal;
+            try
+            {
+                attrName = attr.getName();
+                attrVal = attr.getValue();
+            }
+            catch (SdpParseException e)
+            {
+                //can't happen. jain sip doesn't do lazy parsing
+                logger.debug("The impossible has just occurred!", e);
+                return null;
+            }
             int idx = -1;
 
             /* get the part after payloadtype */
@@ -1318,7 +1332,7 @@
 
             /* add extra attributes */
             Iterator<Map.Entry<String, String>> iter = format
-                    .getAdvancedParameters().entrySet().iterator();
+                    .getAdvancedAttributes().entrySet().iterator();
 
             while (iter.hasNext())
             {

Modified: trunk/src/net/java/sip/communicator/service/neomedia/MediaStream.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/service/neomedia/MediaStream.java?view=diff&rev=7038&p1=trunk/src/net/java/sip/communicator/service/neomedia/MediaStream.java&p2=trunk/src/net/java/sip/communicator/service/neomedia/MediaStream.java&r1=7037&r2=7038
==============================================================================
--- trunk/src/net/java/sip/communicator/service/neomedia/MediaStream.java	(original)
+++ trunk/src/net/java/sip/communicator/service/neomedia/MediaStream.java	2010-04-23 19:41:39+0000
@@ -277,11 +277,4 @@
      * @return the <tt>ZrtpControl</tt> for the current stream.
      */
     public ZrtpControl getZrtpControl();
-
-    /**
-     * Set list of advanced attributes.
-     *
-     * @param attrs advanced attributes map
-     */
-    public void setAdvancedAttributes(Map<String, String> attrs);
 }

Modified: trunk/src/net/java/sip/communicator/service/neomedia/RTPExtension.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/service/neomedia/RTPExtension.java?view=diff&rev=7038&p1=trunk/src/net/java/sip/communicator/service/neomedia/RTPExtension.java&p2=trunk/src/net/java/sip/communicator/service/neomedia/RTPExtension.java&r1=7037&r2=7038
==============================================================================
--- trunk/src/net/java/sip/communicator/service/neomedia/RTPExtension.java	(original)
+++ trunk/src/net/java/sip/communicator/service/neomedia/RTPExtension.java	2010-04-23 19:41:39+0000
@@ -164,7 +164,7 @@
     @Override
     public String toString()
     {
-        return extensionURI.toString();
+        return extensionURI.toString() + ";" + getDirection();
     }
 
     /**

Modified: trunk/src/net/java/sip/communicator/service/neomedia/format/MediaFormat.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/service/neomedia/format/MediaFormat.java?view=diff&rev=7038&p1=trunk/src/net/java/sip/communicator/service/neomedia/format/MediaFormat.java&p2=trunk/src/net/java/sip/communicator/service/neomedia/format/MediaFormat.java&r1=7037&r2=7038
==============================================================================
--- trunk/src/net/java/sip/communicator/service/neomedia/format/MediaFormat.java	(original)
+++ trunk/src/net/java/sip/communicator/service/neomedia/format/MediaFormat.java	2010-04-23 19:41:39+0000
@@ -110,7 +110,7 @@
      * @return a <tt>Map</tt> containing advanced parameters specific to this
      * particular <tt>MediaFormat</tt>
      */
-    public Map<String, String> getAdvancedParameters();
+    public Map<String, String> getAdvancedAttributes();
 
     /**
      * Returns a <tt>String</tt> representation of this <tt>MediaFormat</tt>

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe at sip-communicator.dev.java.net
For additional commands, e-mail: commits-help at sip-communicator.dev.java.net





More information about the commits mailing list