Can I have a custom RTP payload, and still use a MediaLocator?

Hi,
I think I am a little confused. Can I have a custom RTP payload, and still use Manager.createPlayer(MediaLocator locator) to create my player?
This doesn't seem possible because the RTPManger's addPayload(Format format, int payloadType) method isn't static, forcing me to always create my RTPManager first.
Is this a valid observation, or am I missing something?
Your comments are highly appreciated.
Kind regards,
Erwin

Thanks for your prompt reply.
The short answer is yes.
The MediaLocator is used to identify the source, or destination for a media stream. For example this could be a file (file://c:\mydisk\audio.wav) or a URL (http://mydomain/music/audio.wav)
Ok, I get that, but the MediaLocator is also used to identify the protocol, rtp in this case, and the protocol in its turn is used by the framework to locate the DataSource. I am not suggesting what you write is incorrect, I am only trying to understand how this works the way it does.
RTP is used to transport streaming media in real time over a network (usually UDP).And that is exactly what I need it for.
The receiver of an RTP stream is an RTP receiver. Players take the datasource(created from the MediaLocator) and feed the data to the RTP manager so it can be streamed across the network or vice versa.
The vice versa part is what I am interested in. I need to handle a proprietary video format, packed as RTP, and shipped over UDP. My initial approach was to simply register my DePacketizer with the PlugInManager, and add my custom payload type to the RTPHandler (addFormat(Format fmt, int type)). That obviously doesn't work.
So what I'm trying to convey is that the MediaLocator used in creating a Player will be different, and is used for a different purpose, than the Internet address, and Port used to create an RTPManager.I need a good night of sleep to think that over. I.m.h.o. there is no reason to handle "http://host:port/video/whatever.ext" different from "rtp://host:port/video/whatever.ext". The only difference is that in the first case I can build my graph based on the extension of whatever, and in the second case I have to wait for my first packet in order to determine the payload type. In both cases I expect "DataSource ds = Manager.createDataSource(ml) to work (and it probably does for the standard payload types).
The JMF framework has a .../media/protocol/rtp/DataSource class as well as a .../media/protocol/http/DataSource class.
Is this making any sense?Not sure yet, but I certainly appreciate your help.
Note: In general you don't need to create a custom Payload for RTP.
What if I want to ship a proprietary video format?
Thanks a lot,
Erwin

Similar Messages

  • My ipad imessages are coming up on my husband's iphone. Is that because we share an apple id account. How can we have separate apple id's and still share the same music library.

    my ipad imessages are coming up on my husband's iphone. Is that because we share an apple id account. How can we have separate apple id's and still share the same music library.

    The biggest problem I have is with cross texting. My friends send my a imessage on ipad to ipad and it comes up as message on my husband's phone as well as my ipad?
    My friends definitely do not want my husband seeing their texts. (and I dont really need him to see my responses either)
    Also, apple id is based on my email account, how do I create a new apple id without setting up a new email account?

  • Can I have two apple id's but still use the same itunes

    My mom just got an iPhone. We use the same iTunes but can we both have different Apple ID's and still use the same iTunes??

    Log in and out of the iTunes Store as needed; content purchased from both can exist in the same library and on the same device.
    If you've purchased an application under one ID, you may need to be logged into it to make in-app purchases. If the iTunes library contains protected content from more than five Apple IDs, iTunes may not allow devices to be fully synced.
    (91939)

  • IMAC 24" screen went dead. Can I buy a mac compatible monitor and still use the IMAC hard drive?

    IMAC 24" screen went dead. Can I buy a mac compatible monitor and still use the IMAC hard drive - which is still working? I took it to the Apple store and they quoted $500+to replace the monitor. No help as usual. Can I buy a MAC compatible monitor ($189) and use it as a primary monitor? Can I set it up if the screen on the IMAC is dead? Any other solutions?

    The only negative to not having the original drive will be the work needed to reinstall all the apps and reconfigure to your liking. You will also have to decide whether to stay on Lion (which you should update to 10.7.4, BTW) or bite the bullet and take a leap of faith on Mountain Lion.
    In either case, to simplify matters you would do well to concoct a Lion or ML bootable installer on a USB stick. In either case, you need to get the corresponding installer downloaded onto the hard drive and, instead of running it to execute the install, extract the coveted InstallESD.dmg image from which you construct the bootable installer. See here for details: https://discussions.apple.com/message/17782820#17782820  The procedure applies the same to both of the latest cat flavors.

  • Can I cancel my Creative Cloud membership and still use Photoshop on my computer?

    I have the month-to-month Creative Cloud membership and am curious if I would be able to cancel my Creative Cloud membership and still have access to everything still involved with my Photoshop downloaded onto my computer?

    If you have licensed versions of software that you purchased separately from your Cloud subscription you can still use them.  There is a chance that the Cloud will have taken over for them in which case you may have to uninstall, clean things up, reinstall.

  • I use firefox but I do not want it in my dock. Can I remove it from the dock and still use it?

    I would like to keep firefox out of my dock so that customers do not click on it. Can I do this while I am still using it on another screen?

    I have Firefox open all the time. I use two screens, one is a large flatscreen tv that has surf reports and weather reports on it. So that customers to my store can see whats going on. I use Firefox for this. I have another screen that is computer size and I use this for internet patronage on Safari. The problem I have is people clicking on Firefox and messing up the weather and surf reports. I want then to only be able to identify Safari.
    Cheers

  • I already have an iPhone with Verizon, my upgrade isn't until next June 2014. Can I buy the iPhone 5s from Apple and still use it with verizon?

    I dropped my phone in some water and I don't have apple care. It's been about a week and I'd rather put the money into fixing my iPhone 4 to an iPhone 5s. But I'm not sure if I can just buy the phone from Apple and still use it with verizon. Can someone help?

    Yes, Apple will sell you an iPhone you can use with Verizon.

  • Problem with the examples of Transmitting and Receiving Custom RTP Payloads

    I have tried the examples of this web:
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/CustomPayload.html
    Transmitting and Receiving Custom RTP Payloads
    I run the examples all right.
    But I want to transmit the sound using my own format, so i want to change the file PcmPacketizer.java
    and PcmDepacketizer.java
    I think the sound data is in the byte[] inData ---- {byte[] inData = (byte[])inBuf.getData();}
    so i change the data with my own function, so the inData have the diffrent length:
    then i transmit the data with the packet header
    public synchronized int process(Buffer inBuf, Buffer outBuf) {
    int inLength = inBuf.getLength();
    byte[] inData = (enbase((byte[])inBuf.getData()));
    byte[] outData = (byte[])outBuf.getData();
         if (outData == null || outData.length < PACKET_SIZE) {
         outData = new byte[PACKET_SIZE];
         outBuf.setData(outData);
         // Generate the packet header.
         int rate = (int)inFormat.getSampleRate();
         int size = (int)inFormat.getSampleSizeInBits();
         int channels = (int)inFormat.getChannels();
         outData[0] = 0;     // filler
         outData[1] = (byte)((rate >> 16) & 0xff);
         outData[2] = (byte)((rate >> 8) & 0xff);
         outData[3] = (byte)(rate & 0xff);
         outData[4] = (byte)inFormat.getSampleSizeInBits();
         outData[5] = (byte)inFormat.getChannels();
         outData[6] = (byte)inFormat.getEndian();
         outData[7] = (byte)inFormat.getSigned();
         int frameSize = inFormat.getSampleSizeInBits() * inFormat.getChannels();
         // Recompute the output format if the input format has changed.
         // The crucial info is the frame rate and size. These are used
         // to compute the actual rate the data being sent.
         if (rate != (int)outFormat.getFrameRate() ||
         frameSize != outFormat.getFrameSizeInBits()) {
              outFormat = new AudioFormat(CUSTOM_PCM,
                        AudioFormat.NOT_SPECIFIED, // rate
                        AudioFormat.NOT_SPECIFIED, // size
                        AudioFormat.NOT_SPECIFIED, // channel
                        AudioFormat.NOT_SPECIFIED, // endian
                        AudioFormat.NOT_SPECIFIED, // signed
                        size * channels,     // frame size
                        rate,               // frame rate
                        null);
    if (inLength + historyLength >= DATA_SIZE) {
         // Enough data for one packet.
                   int copyFromHistory = Math.min(historyLength, DATA_SIZE);
                   System.arraycopy(history, 0, outData, HDR_SIZE , copyFromHistory);
    int remainingBytes = DATA_SIZE - copyFromHistory;
    System.arraycopy(inData, inBuf.getOffset(),
                   outData, copyFromHistory + HDR_SIZE, remainingBytes);
    historyLength -= copyFromHistory;
    inBuf.setOffset( inBuf.getOffset() + remainingBytes);
    inBuf.setLength( inLength - remainingBytes);
         outBuf.setFormat(outFormat);
         outBuf.setLength(PACKET_SIZE);
         outBuf.setOffset(0);
    return INPUT_BUFFER_NOT_CONSUMED ;
    if (inBuf.isEOM()) { // last packet
    System.arraycopy(history, 0, outData, HDR_SIZE, historyLength);
    System.arraycopy(inData, inBuf.getOffset(),
                   outData, historyLength + HDR_SIZE, inLength);
         outBuf.setFormat(outFormat);
         outBuf.setLength(inLength + historyLength + HDR_SIZE);
         outBuf.setOffset(0);
    historyLength = 0;
    return BUFFER_PROCESSED_OK;
    // Not enough data for one packet. Save the remainder
         // for next time.
    System.arraycopy(inData, inBuf.getOffset(),
                   history, historyLength,inLength) ;
    historyLength += inLength;
    return OUTPUT_BUFFER_NOT_FILLED ;
    I think I change the data use my own function debase(), so i should decode the data in the file:PcmDepacketizer.java
    but int PcmDepacketizer.java the example is so simple that i don't know how to find and change the data.
    there is only a few lines here:
    Object outData = outBuf.getData();
         outBuf.setData(inBuf.getData());
         inBuf.setData(outData);
         outBuf.setLength(inBuf.getLength() - HDR_SIZE);
         outBuf.setOffset(inBuf.getOffset() + HDR_SIZE);
         System.out.println("the outBuf length is "+inBuf.getLength());
    I write a function : public static byte [] debase(byte[] str)
    but i don't know where can i use it.
    please tell me what should i do or where is wrong about my thought.

    the function in PcmPackettizer.java is
    public static byte[] enbase(byte [] b) {
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         //byte[] oo = new byte[(b.length + 2) / 3*4];
         //for (int i = 0; i < (b.length + 2) / 3; i++) {
         for (int i = 0; i < (b.length + 2) / 3; i++) {
              short [] s = new short[3];
              short [] t = new short[4];
              for (int j = 0; j < 3; j++) {
                   if ((i * 3 + j) < b.length)
                        s[j] = (short) (b[i*3+j] & 0xFF);
                   else
                        s[j] = -1;
              t[0] = (short) (s[0] >> 2);
              if (s[1] == -1)
                   t[1] = (short) (((s[0] & 0x3) << 4));
              else
                   t[1] = (short) (((s[0] & 0x3) << 4) + (s[1] >> 4));
              if (s[1] == -1)
                   t[2] = t[3] = 64;
              else if (s[2] == -1) {
                   t[2] = (short) (((s[1] & 0xF) << 2));
                   t[3] = 64;
              else {
                   t[2] = (short) (((s[1] & 0xF) << 2) + (s[2] >> 6));
                   t[3] = (short) (s[2] & 0x3F);
              for (int j = 0; j < 4; j++)
                   os.write(t[j]);
                   //os.write(t[j],(3*i+j),1);
                   //os.write(Base64.charAt(t[j]));
         //return new String(os.toByteArray());
         return os.toByteArray();
    just like the base64 function

  • In an upright and landscape folio Can i have multiple (custom) page sizes?

    In an upright and landscape folio Can i have multiple (custom) page sizes?
    i.e if 99% of pages are 768x1024 each with a landscape version when you rotate, can the folio also contain bespoke long pages i.e 768 x 2048.....??
    It appears not...

    *FACE PALM* YES! that works, of course it does, simple when you know how ;-)   ......  Thank you Alastair i was missing the obvious answer

  • Custom RTP Payloads

    Hi all
    In the "Transmitting and Receiving Custom RTP Payloads"
    http://java.sun.com/products/java-media/jmf/2.1.1/solutions/CustomPayload.html
    I want to do packetizer/depacketizer for video
    so, I have VideoPacketizer.java and VideoDepacketizer.java like PcmDepacketizer/PcmPacketizer
    public class VideoPacketizer implements Codec {
    public VideoPacketizer() {
         supportedInputFormats = new VideoFormat[] {
         new VideoFormat(
              VideoFormat.RGB
    supportedOutputFormats = new VideoFormat[] {
         new VideoFormat(
    CUSTOM_VIDEO
              System.out.println(supportedOutputFormats[0].getEncoding());
              System.out.println("PA construct ok!");
    public synchronized int process(Buffer inBuf, Buffer outBuf) {
    int inLength = inBuf.getLength();
    byte[] inData = (byte[])inBuf.getData();
    byte[] outData = (byte[])outBuf.getData();
         if (outData == null || outData.length < PACKET_SIZE) {
         outData = new byte[PACKET_SIZE];
         outBuf.setData(outData);
         outData[0] = 0;
         if (first) {
              outFormat = new VideoFormat(CUSTOM_VIDEO,
    new Dimension(160, 120),
                   VideoFormat.NOT_SPECIFIED,
                   null,
                   VideoFormat.NOT_SPECIFIED);
              first = false;
              System.out.println("first................................");
    When I run AVCustomTrans.java,it has a error
    Error : Format of Stream not supported in RTP Session Manager
    I know that my custom_video don't supported RTP
    so,I wonder how can I do that.
    thanks a lot.
    fcustd

    Have you solved this problem.
    Please can you tell me how i can implement a video packetizer/depacketizer.
    It would be very helpfull.
    Thanks a lot

  • Custom RTP payload

    I used the sample "Custom RTP payload"of sun,sed when program run it tell on console that "the track is not possibile to send as MyPCM Format" and it is sent with another format!! Why????

    I used the sample "Custom RTP payload"of sun,sed when program run it tell on console that "the track is not possibile to send as MyPCM Format" and it is sent with another format!! Why????

  • HT2506 After updating my system to Mountain Lion 10.8.2 I can no longer view videos on Facebook or other sites. The only one I can view videos on is youtube. I have downloaded Adobe Flash player and still no luck. I cannot even open Preview on my computer

    After updating my system to Mountain Lion 10.8.2 I can no longer view videos on Facebook or other sites. The only one I can view videos on is youtube. I have downloaded Adobe Flash player and still no luck. I cannot even open Preview on my computer anymore. Any ideas would be helpful thanks

    Merely clicking the Preview icon in the Dock doesn't cause it to open anything, unless you had one or more windows open the last time it quit.
    If you're sure you've installed the latest version of Flash, take each of the following steps that you haven't already tried. After each step, relaunch Safari and test.
    1. If you're getting a "blocked plug-in" error, triple-click the line below to select it:
    /Library/Internet Plug-Ins Right-click or control-click the highlighted text and select
    Services ▹ Open
    from the contextual menu. A folder should open. If there is more than one item in the folder with the words "Flash Player" (not "flashplayer") in the name, open the respective Info windows, check the version numbers, and delete all except the latest. You may be prompted for your login password. If you get the same error after doing that, re-download and reinstall Flash. Download it from this page:
    Adobe - Install Adobe Flash Player
    Never download a Flash update from anywhere else.
    2. If you get a "missing plug-in" error, select
    Safari ▹ Preferences... ▹ Security
    from the Safari menu bar and check the box marked Enable plug-ins.
    3. Select
    Safari ▹ Preferences... ▹ Extensions
    from the Safari menu bar. If any extensions are installed, disable them.
    4. In the Safari preference window, select
    Privacy ▹ Remove All Website Data
    Close the window. Then select
     ▹ System Preferences… ▹ Flash Player ▹ Advanced
    and click Delete All. Close the preference pane.

  • Can you have two apple ID's and iTunes accounts on 1 home computer?

    Can you have two apple ID's and iTunes accounts on 1 home computer?

    Yes. Use separate user accounts on the computer.
    (94753)

  • HT4759 How can i delete an old iCloud account and start using my own using my Apple ID? If I don't have the old password??

    How can i delete an old iCloud account and start using my own using my Apple ID? If I don't have the old password??

    If your device is signed into an old iCloud ID that is an earlier version of the ID you want to sign in with, do the following:
    If you are using iMessage and FaceTime, make sure you are signed into these services with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iDevice and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then save any photo stream photos that you wish to keep to your camera roll (unless you are using iCloud Photo Library).  When finished go to Settings>iCloud, tap Sign Out (or Delete Account if you are not running iOS 8) and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • Can I have separate password for appstore and icloud email account?

    Can I have other password for appstore and icloud email account? Me and my girlfriend have iphones and i would like to share my apps with her, but i dont want to give her possibility to acces my email account....

    Well you can only have a different password if you are going to use a different Apple ID

Maybe you are looking for