Package org.jitsi.service.neomedia

Examples of org.jitsi.service.neomedia.MediaStream


  public JingleStream startStream( String name, byte payloadTypeId, MediaFormat format, TransportAddress remoteRtpAddress, TransportAddress remoteRtcpAddress, DatagramSocket rtpDatagramSocket, DatagramSocket rtcpDatagramSocket ) throws IOException {
    MediaDevice dev = devices.get(name);
   
    MediaService mediaService = LibJitsi.getMediaService();
   
        MediaStream mediaStream = mediaService.createMediaStream(dev);

        mediaStream.setDirection(MediaDirection.SENDRECV);

        /*
         * The MediaFormat instances which do not have a static RTP
         * payload type number association must be explicitly assigned
         * a dynamic RTP payload type number.
         */
        if ( format.getRTPPayloadType() == MediaFormat.RTP_PAYLOAD_TYPE_UNKNOWN ) {
            mediaStream.addDynamicRTPPayloadType(
                    payloadTypeId,
                    format);
        }
       
//        System.out.println( "++++++++++++++++++++++" );
//        System.out.println( "++++++++++++++++++++++" );
//        System.out.println( "++++++++++++++++++++++" );
//        System.out.println( "For stream: " + name );
//        System.out.println( "Format: " + format );
//        System.out.println( "Dynamic payload type: " + payloadTypeId );
//        System.out.println( "++++++++++++++++++++++" );
//        System.out.println( "++++++++++++++++++++++" );
//        System.out.println( "++++++++++++++++++++++" );

        mediaStream.setFormat(format);

        StreamConnector connector = new DefaultStreamConnector( rtpDatagramSocket, rtcpDatagramSocket );

        mediaStream.setConnector(connector);

        mediaStream.setTarget( new MediaStreamTarget( remoteRtpAddress, remoteRtcpAddress ) );

        mediaStream.setName(name);
       
        mediaStream.start();
       
        JingleStream js = new JingleStream( name, mediaStream, this );
        jingleStreams.put( name, js );
        return js;
  }
View Full Code Here

TOP

Related Classes of org.jitsi.service.neomedia.MediaStream

Copyright © 2018 www.massapicom. 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.