Examples of IceMediaStream


Examples of org.ice4j.ice.IceMediaStream

    String ts = type.toString();
    return org.ice4j.ice.CandidateType.parse(ts);
  }

  public void createStream( String name ) throws BindException, IllegalArgumentException, IOException {
    IceMediaStream stream = agent.createMediaStream(name);
    int rtpPort = getStreamPort();
    agent.createComponent(stream, Transport.UDP, rtpPort, rtpPort, rtpPort+100);
    agent.createComponent(stream, Transport.UDP, rtpPort+1, rtpPort+1, rtpPort+101);
  }
View Full Code Here

Examples of org.ice4j.ice.IceMediaStream

      // media has not been negotiated. This seems to happen with jitsi.
      // we will assume our requested formats are acceptable.
      parseIncomingAndBuildMedia( createContentList( senders ), senders );
    }
   
        IceMediaStream stream = iceAgent.getAgent().getStream(name);
        MediaFormat format = streamNameToMediaFormats.get(name);
        Byte payloadTypeId = streamNameToPayloadTypeId.get(name);
        if( stream == null || format == null || payloadTypeId == null )
          throw new IOException("Stream \"" + name + "\" not found.");
        Component rtpComponent = stream.getComponent(org.ice4j.ice.Component.RTP);
        Component rtcpComponent = stream.getComponent(org.ice4j.ice.Component.RTCP);
       
        if( rtpComponent == null )
          throw new IOException("RTP component not found.");
        if( rtcpComponent == null )
          throw new IOException("RTCP Component not found.");
View Full Code Here

Examples of org.ice4j.ice.IceMediaStream

  /** takes the remote candidates passed by the JingleIQ and incorporates that information into this ice agent. */
  public void addRemoteCandidates(JingleIQ jiq) {
    try {
      for (ContentPacketExtension contentpe : jiq.getContentList()) {
        String name = contentpe.getName();
        IceMediaStream ims = agent.getStream(name);
        if (ims != null) {
          for (IceUdpTransportPacketExtension tpe : contentpe.getChildExtensionsOfType(IceUdpTransportPacketExtension.class)) {
            System.out.println( "\t" + tpe );
            if (tpe.getPassword() != null)
              ims.setRemotePassword(tpe.getPassword());
            if (tpe.getUfrag() != null)
              ims.setRemoteUfrag(tpe.getUfrag());

            List<CandidatePacketExtension> candidates = tpe.getChildExtensionsOfType(CandidatePacketExtension.class);
            if (candidates == null || candidates.size() == 0)
              continue;
            // Sorts the remote candidates (host < reflexive <
            // relayed) in
            // order to create first host, then reflexive, the
            // relayed
            // candidates, to be able to set the relative-candidate
            // matching the rel-addr/rel-port attribute.
            Collections.sort(candidates);

            for (CandidatePacketExtension cpe : candidates) {
              if (cpe.getGeneration() != agent.getGeneration())
                continue;
              InetAddress ia;
              try {
                ia = InetAddress.getByName(cpe.getIP());
              } catch (UnknownHostException uhe) {
                continue;
              }

              TransportAddress relatedAddr = null;
              if (cpe.getRelAddr() != null && cpe.getRelPort() != -1) {
                relatedAddr = new TransportAddress(cpe.getRelAddr(), cpe.getRelPort(), Transport.parse(cpe.getProtocol().toLowerCase()));
              }

              Component component = ims.getComponent(cpe.getComponent());
              if (component != null) {
                // we should always be able to find this if there is one b/c of the sorting we did.
                RemoteCandidate relatedCandidate = relatedAddr != null ? component.findRemoteCandidate(relatedAddr) : null;
                TransportAddress ta = new TransportAddress(ia, cpe.getPort(), Transport.parse(cpe.getProtocol().toLowerCase()));
                RemoteCandidate rc = new RemoteCandidate( ta,
View Full Code Here

Examples of org.ice4j.ice.IceMediaStream

    IceUdpTransportPacketExtension transport = new IceUdpTransportPacketExtension();
    transport.setPassword( agent.getLocalPassword() );
    transport.setUfrag( agent.getLocalUfrag() );

    try {
      IceMediaStream ims = agent.getStream(streamName);
      if( ims == null )
        return null;
     
      for( Component c : ims.getComponents() ) {
        for( Candidate<?> can : c.getLocalCandidates() ) {
          CandidatePacketExtension candidate = new CandidatePacketExtension();
          candidate.setComponent(c.getComponentID());
          candidate.setFoundation(Integer.parseInt(can.getFoundation()));
          candidate.setGeneration(agent.getGeneration());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.