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
[517 byte] By [
ehogewega] at [2007-11-26 17:42:56]

# 1
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)
RTP is used to transport streaming media in real time over a network (usually UDP). 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.
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.
Is this making any sense? Note: In general you don't need to create a custom Payload for RTP.
# 2
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
# 3
Ok, now I see what you're doing. I'll plead ignorance on this. I've never used an rtp protocol as a media locator string. Not sure how this works but JMF does some strange things and finding out exactly what that is can be down right impossible.
You might be able to add the format to the DataSink similar to adding a format to the DataSource (an RTP DataSource will have an RTPControl). But as I said before I'm rather clueless on using this method and I'm just tossing out ideas.