Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
andersontaylor
Posts: 11
Registered: ‎07-17-2009
My Device: Not Specified

Custom datasource for RTSP

I was wondering if it's possible to create a custom datasource for RTSP?

there is no problem for streaming data from a rtsp server by passing the rtsp url to

 

  Manager.createPlayer(rtsp_url);

 

it worked well. But it seemed not supporting the seekable feature, i.e., I cannot actually let the player move back and forth as expected.

 

My problem is: how to make a video clip seekable, i.e., users can move the progress bar back and forth?

Actually, a pre question should be: is it possible to set the media time for a streaming video data file on a remote server, considering no local copy of the data? 

 

It was said that in order to make the data seekable, you had better create a custom datasource for buffering. Following the bufferedplayback demo code, now create the player with

 

Manager.createPlayer(customDataSource);

 

where the customDataSource makes a connection to the remote server with

 

Connector.open(rtsp_url) ;

 

But, there was a exception: ConnectionNotFoundException: No RTSP Protocol found when  Connector.open() is called.

 

so my final queston is: can I create a custom datasource which can support a specified protocol?

 

thanks for any help,

 

andersontaylor 

 

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Custom datasource for RTSP

I think the idea that was suggested to you is that inside the custom data source you need to open the connection using the UDP or TCP protocol and implement your own RTSP stack (or at least the features you require).
New Developer
andersontaylor
Posts: 11
Registered: ‎07-17-2009
My Device: Not Specified

Re: Custom datasource for RTSP

Thanks for the reply.

 

I was wondering if you can shed a light with an example for this?

 

andersontaylor

 

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Custom datasource for RTSP

Sorry, I don't know enough about RTSP. In general though, you'll probably have a small buffer where you store the audio/video frames/samples received from the server and provide the OS with the frames/samples whenever it asks your for them via the SourceStream.read() method. To enable seeking, you'll need to tell the OS that the stream is seekable and then also properly pass on the seek commands to the server and/or to your receive buffer.