RTPManager

Hi!
I'm developing an application to send audio. I use the class RTPManager but when I try to set up a second RTP session the application fail. Is there any problem with that and RTPManager? Thanks in advance!
It show me this message:
Exception in thread "JMF thread: SendEventQueue: com.sun.media.processor.unknown.Handler" java.lang.Error: DataSource must be connected before it can be started
     at com.sun.media.protocol.BasicPushBufferDataSource.start(BasicPushBufferDataSource.java:47)
     at com.sun.media.multiplexer.RawBufferMux$RawBufferDataSource.start(RawBufferMux.java:522)
     at com.sun.media.rtp.SendSSRCInfo.start(SendSSRCInfo.java:308)
     at com.indra.dicom.provider.voip.gestoraudio.AudioCall.initSessionManager(AudioCall.java:719)
     at com.indra.dicom.provider.voip.gestoraudio.AudioCall.controllerUpdate(AudioCall.java:281)
     at com.sun.media.BasicController.dispatchEvent(BasicController.java:1254)
     at com.sun.media.SendEventQueue.processEvent(BasicController.java:1286)
     at com.sun.media.util.ThreadedEventQueue.dispatchEvents(ThreadedEventQueue.java:65)
     at com.sun.media.util.ThreadedEventQueue.run(ThreadedEventQueue.java:92)
Edited by: pedrorp on May 27, 2009 12:54 AM

pedrorp wrote:
I'm developing an application to send audio. I use the class RTPManager but when I try to set up a second RTP session the application fail. Is there any problem with that and RTPManager? Thanks in advance!Ummmmm, it looks like you're trying to use the same DataSource twice. You can't do that...
Alternately, it looks like you're not creating your DataSource correctly...
Actually, you didn't post your code so I have no way of knowing what you did wrong ;-)

Similar Messages

  • Using RTPConnector and RTPManager in Relay server

    Hi
    Reposting it as suggested:
    If I pass RTPConnector object in RTPManager then api discourages using addTarget. So in this case my questions are:
    1. Do I have to create multiple OutputDataStreams or mange with single OutputDataStream.
    2. When does getDataOutputStream get called.
    3. If I use one OutputDataStream how do I avoid sending packet to the destination that sent the packet.
    I just want to pass the audio stream received from one endpoint to the other recipients in unicast mode.
    -Thanks in advance and I sincerely appreciate your help.

    1. Do I have to create multiple OutputDataStreams or mange with single OutputDataStream.You have to manage with a single OutputDataSteam because that's the format that the object gives you to follow.
    2. When does getDataOutputStream get called.I have no idea, but I don't really think it matters when it gets called. That information is abstracted away from us.
    What you need to know is that it will be called at least once, maybe multiple times, per instance of the RTPConnector, and that the RTPManager is going to call write on it to send out data, and receive on it to receive data.
    3. If I use one OutputDataStream how do I avoid sending packet to the destination that sent the packet.
    I just want to pass the audio stream received from one endpoint to the other recipients in unicast mode.Take a look at the following example code:
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/RTPSocketAdapter.java]
    Take special notice of the read / write functions. In this example, notice how it uses a UDPSocket to send packets, and that it addresses each one as it sends it out.
    Well, for your example, you'll probably maintain a list of hosts to send to, and everytime a call to write is made, you'd create one packet for each host, and send them all out over a UDPSocket.
    So, putting that all together...
    When the RTPConnector is created, you can create some functions to add some data you need (ie, a list of targets) to your RTPConnector object.
    You construct the output stream implementation in getDataOutputStream, so you can throw whatever data into that class you want before you return the reference to the RTPManager (ie, a list targets)
    You control what happens when OutputStream.write is called, so you can just do whatever you want (ie, send a UDP packet to each of the list of targets)...
    If you maintain your own list of targets to send to, then you just don't add yourself as a target. Same as if you were using the normal addTarget method.
    -Thanks in advance and I sincerely appreciate your help.No problem.

  • Ignore new Payload Type in RTPManager

    Hi,
    Im working on a project who receives sound from a cell phone. The cell phone send Audio trough the SIP Server in G711 ALAW, with a Payload of 8.
    Following this tutorial:
    [http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/CustomPayload.html]
    I achieve to register the new type of payload, and decode the audio without any problem.
    The problem comes when the SIP Server sends (from time to time) a new packet, with a Payload 13 (Comfort Noise). I want to just ignore this packet, but the RTPManager send me a message saying that I dont have the Payload 13 registered, and STOP the RTPManager.
    I could register this new type of Payload, but if I dont know just how to ignore it!.
    Any help? Thanks!
    PS: Im thinking about creating my own RTP implementation, do you think it worths?
    Edited by: AntonioMG on May 30, 2010 2:43 AM

    AntonioMG wrote:
    The problem comes when the SIP Server sends (from time to time) a new packet, with a Payload 13 (Comfort Noise). I want to just ignore this packet, but the RTPManager send me a message saying that I dont have the Payload 13 registered, and STOP the RTPManager.Is there a "RemotePayloadChangeEvent" generated by your RTPManager when the payload-8 packet arrives?
    I could register this new type of Payload, but if I dont know just how to ignore it!.You could try just
    rtpManager.addFormat(null, 8);or
    Format myFormat = new Format("none");
    rtpManager.addFormat(myFormat, 8);And just ignore whatever events occur when those packets are recieved...
    PS: Im thinking about creating my own RTP implementation, do you think it worths?No, I wouldn't say it's worth it at all...

  • Send 2 dataSource in the same RTPManager

    Hi!
    Could I send 2 DataSource in the same RTPManager? I tried creating 2 sendStream and starting them but It didn't work. Any idea?
    Thanks in advance! :D

    I tried too, but It didn't work. Really, I want to send a cloned DataSource, but I don't know if I'm cloning it right. I do this:
    cloneInputDS=((SourceCloneable)Manager.createCloneableDataSource(inputDSf)).createClone();And then I create the sendStream with cloneInputDS. Should I do something previously?
    Thanks! :D

  • What is the difference from RTPSessionMgr and RTPManager?

    I find some people dont use RTPManager but RTPSessionMgr. I don't know the difference from the
    RTPSessionMgr and RTPManager.Help me!!
    RTPSessionMgr belongs to the package of com.sun.media. There is another pakcage name com.ibm.media. I want to know how to use the package of com.sun.media and com.ibm.media. who gives me the specification.Help me!

    Hi :
    I finally find the solution. In the sun website there is JMf open source code to be downloaded. In the src there is better specification than the sun's api specification and there is source code of com.sun.media and com.ibm.media. Wish it helps you!

  • Where is the RTPManager class?

    I have install JMStudio,but in the jar package,no the RTPManager class?the class is where?

    Jar package has no RTPManager class.
    It is in the com.sun.media.RTPManager;

  • Additional method to RTPManager

    Since RTPManager is an abstract class, I got the source code and added 1 more abstract method:
    abstract public RTPConnector getRTPConnector ();
    Since RTPSessionMgr is the actual implementation of RTPManager, but I don't have source code. I decompile it from jmf.jar, patched it up, then add:
    public RTPConnector getRTPConnector () { return rtpConnector; }
    All compiled just fine. I unjar jmf.jar and replace RTPManager.class and RTPSessionMgr.class, and jar it back to jmf.jar. However when I call rtpMgr.getRTPConnector(), I get a method not found exception like the old RTPSessionMgr is till in jmf.jar. I put on debug and sure enough, it's the good old RTPSessionMgr. Where do you think it comes from?

    Check your classpath settings to make sure that your new jar file is listed earlier than the standard JMF jar files
    you can also check which files/classes are loaded by running your app with the -verbose option
    java -verbose -jar myJarFile.jar

  • RTPManager don't release port

    Hi!
    I want to transmit a video over RTP to a multicast address and used the code from AVTransmit2.java:
    1. Create a Datasource and a processor for that Datasource
    2. Get the DataOutput from the processor and create a rtpmanager
    3. Initialize the rtpmanager with my local address
    4. Add target (multicast) address
    5. Create a SendStream with the rtpmanager for the datasource and start it
    6. Start Processor
    Everything works fine for the first transmission.
    On Media-End I disconnect the DataSource, stop and close the SendStream. Then I remove the targets from the rtpmanager and call dispose() and then stop and close the processor.
    BUT if I want to retransmit, the 3rd Step fails with this exception:
    javax.media.rtp.InvalidSessionAddressException: Can't open local data port: 16000
    at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2576)
    at com.sun.media.rtp.RTPSessionMgr.initialize(RTPSessionMgr.java:2415)
    I know, that the problem is the opened port, but don't know why the port is not closed.... grml
    Can anybody help my please?

    HI klschoef
    I'm doing almost same thing as you did, but i got a big problem ,when i start the sendstream"sendstream.start();", but it seems no UDP packet has been sent, so my client-side always wating on the receive , please tell me how to solve this problem

  • RTPManager initializing with multicast address!

    Hi every body..
    i use RTPManager and initializes it to multicastAddress and then in
    addTarget() call i again pass same IP multicast address on two RTPManagers running on different machines.... but y dont i get NewParticipantEvent on any of the two PC`s ???
    i did this i.e use same Multicasting address for initializing and addTraget(), cause JMF docs says it..
    but... if i initializes to localAddress.. then things seems to work fine.. thats another question y is this so ??
    i thing i am using 224.0.0.1 as a multicasting address in my LAN!
    any body have a clue abt it??
    Thanks in advance
    bye

    up

  • About RTPManager and SendStream~~~~Urgent.....please help me!!!!!

    hi guys, i try to send a datasource in RGBFormat, and i use RTPManager to breate a sendstream but on the client side, i can only receive session event, but when i want to show the datasource in the receivestream . it's display null!!!
    why this happened???when i print out the datasource which included in the receivestream,it's null!!i don't know why this happened?please help me!!!

    Hi. Can you show your source code?

  • RTPManager and DatagramSocket will only bind to local ipv6 udp sockets

    Setup: Java 1.6.0, JMF 2.1.1e linux pack.
    I'm writing a simple utility to receive and playback audio from an RTP stream directed at a specific local udp port. I need the RTPManager to bind to all local addresses on that port. To acheive this I'm using RTPManager and passing in a session address created as so -
    local = new SessionAddress();
    local.setDataPort(9000);
    local.setControlPort(9001);
    try {
       manager.initialize(local);
    } catch ...netstat -ulpn reveals that the application has only bound to the udp6 "wildcard" addresses and not bound to any local ipv4 address -
    udp6 0 0 ::ffff:127.0.1.1:9000 :::* 20679/java
    udp6 0 0 ::ffff:127.0.1.1:9001 :::* 20679/java
    I've tried a few different ways of creating the SessionAddress to try and get it to bind correctly with no luck.
    Also, the same issue appears to confront me when using DatagramSockets directly -
    s = new DatagramSocket(9000);netstat again says -
    udp6 0 0 :::9000 :::* 22061/java
    If it helps, I'm happily talking over ipv4 StreamSockets on the same system.
    Can anyone tell me what I'm doing wrong ?
    Dan

    I've made a bit of progress on this since my original post. I've removed all ipv6 addresses from any interface on my machine can now get a DatagramSocket to bind as expected -
    udp 0 0 0.0.0.0:9000 0.0.0.0:* 26527/java
    RTPManager seems to bind to whatever address your system hostname is associated with in /etc/hosts, in my case (ubuntu system) it was 127.0.1.1. removing this entry (as I may have expected) causes an UnknownHostException.
    I can change the entry in /etc/hosts to read -
    0.0.0.0 dan-laptop
    and netstat output looks right, although I'm not sure of the validity of doing things this way -
    udp 0 0 0.0.0.0:9000 0.0.0.0:* 27410/java
    udp 0 0 0.0.0.0:9001 0.0.0.0:* 27410/java
    Any comments on how to do this the right way ?

  • RTPManager.addTarget() - takes few sec (2-3)

    Hi all,
    I use AVTransmit2 as base for my test. When call is answered at CTI port I call
    AV2Transmit.start().
    It takes 2-3 second to open session.
    (RTPManager.addTarget() )
    If I call AV2Transmit.stop() and after it AV2Transmit.start() again, it starts streaming imediately.
    What takes so long and how to avoid these delays?
    Cisco phone, Call manager and PC are in the same subnet.
    Zdenko

    Here is a solution to addTarget() problem I first posted on JMF forum on Nov 4, 2005
    http://forum.java.sun.com/thread.jspa?threadID=247408
    This is a quote from my post:
    To resolve addTarget delay problem do this trick for the first target:
    String ipadr = [target ip address];
    int port=[target port];
    InetAddress adr = InetAddress.getByName(ipadr);
    byte[] badr = adr.getAddress();
    InetAddress nadr = InetAddress.getByAddress( InetAddress.getLocalHost().getHostName(), badr );
    [Or even simpler: InetAddress nadr = InetAddress.getByAddress( “localhost”, badr );]
    Now addTarget (new SessionAddress(nadr, port)) takes no time at all.
    Again it's enough to do this only for the first target.

  • RTPManager: problem joining multicast group

    We've written an application that sends and receives audio and video streams over RTP to a multicast group. If two of these applications are both running on the LAN, it works fine (our router is multicast-enabled). If one application (A) is running on the LAN, and another (B) is running remote and connected to the LAN via VPN, then A receives B's audio and video, but B sometimes doesn't receive A's audio and video. If another application (C) is added on the LAN, C behaves just like A - C receives audio and video from both A and B, but B still doesn't see either A or C.
    On some occasions, rebooting B and re-establishing the VPN connection fixes the problem, and on other occasions, this doesn't change the behavior at all.
    Using Ethereal, we've confirmed that B doesn't receive any of the traffic from the multicast group, even though its successfully sending traffic to that group. Further research revealed that, on B, the IGMP join requests were being sent to B's normal network interface, and NOT to the VPN network interface. However, all the RTP and RTCP traffic was being sent to the VPN network interface.
    Does anyone know how to control (or at least affect) which network interface is used by RTPManager when joining the multicast group? I'm not sure if this problem is a result of RTPManager, of the NIC driver, or something else. I think one option is to write an RTPConnector implementation that handles all the transmission and reception manually, but I hope there's a better, easier option. Thanks for any help.

    Hi Eric,
    I am doing exactly the same thing. I have the video running fine, and I am relying on VPN connection for remote monitoring of the video. My setup is a little more complicated - I am running a setup/start/stop/teardown session manager (like rtsp) and also a keep alive listener (like rtcp) for each user.
    I have one little annoyance which is stoppping me from testing this over the VPN, on my remote machiens I get a startup error:
    11:40:13.4 request = control_start
    11:40:15.1 Video transmitted as:
    11:40:15.1   JPEG/RTP, 320x240, FrameRate=15.0
    Failed to realize: com.sun.media.ProcessEngine@7cbde6
      Cannot build a flow graph with the customized options:
        Unable to transcode format: RGB, 320x240, FrameRate=15.0, Length=230400, 24-
    bit, Masks=3:2:1, PixelStride=3, LineStride=960, Flipped
          to: JPEG/RTP, 320x240, FrameRate=15.0
          outputting to: RAW/RTP
    Error: Unable to realize com.sun.media.ProcessEngine@7cbde6
    11:40:16.1 response = 500I have run a debug on the two networks, the multicast runs fine on my machine, and the processor is realized, and the cameras have identical traces looping over the supported formats. Is this purely a format issue or could this be a router not configured for multicast?
    Do you (or anyone!) have an idea about this? The program works on my setup of camera etc, and on a clone machine, with diff cameras (but the same if you know what I mean) it fails...
    I'll let you know if I solve the VPN problem (after I fix this) I watched this topic.

  • RTPManager vs SessionManager - what's the situation?

    I'm quite new to the JMF api...but I think the RTP part is the most confusing for a novice. In particular the guide's examples use SessionManager, but also referr to RTPManager's methods.
    On the forum somebody is saying SessionManager is deprecated (for shure I was not able to use it without strange null pointer that I later found submitted as 'bugs').
    Can somebody please clarify this issue?
    The API docs I download is not up to date with the on line API (not linked in the site?)
    Basically I'm asking all the JMF gurus out there what's the current 'health' status of this libray: is it supported? evolving? bug-fixed? are new codecs avaliable? is it worth using... or is it a waste of time since it is limited?
    My first impression is not as good as other frameworks avaliable in the Java world, so all your suggestions are wellcome.
    Regards
    Marco

    JMF seemed to have been neglected. The last build was quite a while back. Despite the fact that JMF web site repeatedly stated that 2.1.1e is only an implementation update (compared to 2.0), there were apparently also API enhancements which were mentioned once, in a not very intuitive place. The only way to get an up-to-date API is through this URL: http://java.sun.com/products/java-media/jmf/2.1.1/apidocs/index.html, again not mentioned anywhere.
    All books written on this subject were published back in 2000 or prior, ancient history when it comes to hightech evolution. So I am not sure where Sun is taking this. It would sure be great if they take this somewhere since it makes a very compelling reason to write application on Java. I raised some issues on JMF and the states of its documentation and compatibility with JRE1.5.0 sometimes ago:
    http://forums.java.sun.com/thread.jspa?threadID=586287&tstart=1
    http://forum.java.sun.com/thread.jspa?messageID=3018576
    Good luck,

  • RTPManager in JXTA

    Hello to all. I have been working these last days making video conference using the RTPManager in JXTA networks. i had maden tests.. and is possible do it in the unicast way by means of the implementation of the RTPConnector... which I do customization of transport by means of JXTASocket.. this works for communications of unicast mode . Well my problem comes at the time that i want to do it in multicast way since metodo addTarget(SessionAddress remoteAddress) does not work in JXTA.. reason for which I have decided to construct a RTPManager from the JMF sources to change java.net.MulticastSocket by net.jxta.socket.JXTAMulticastSocket somebody knows which is the class that implements or extends RTPManager?

    Hi Culosabroso,
    First of all, congrates you on successfully build an unicast peer-to-peer video conference JXTA client.
    I have the same question, why you want to use multicast?
    Is it a video conferencing which involved more than 1 peer in a Group? So it's a group to group multicast?
    Please update your progress, I'm interested in your work. I'm exciting to bring you in my team in developing "Instant Messenger for Java User Group" (JUGIM), we need some kind of video conferencing too ... that will be cool.
    By Avatar
    leader of KLJUG
    project owner of JUGIM (http://jugim.dev.java.net)

Maybe you are looking for