Get the Data from a DataSource

Hi,

I start with JMF. I use a processor to get DataSource from an audio file. Until there, all runs very well.

But after that, I would like to get the raw data of my DataSource to aplly a filter on these data and after that, to create a new DataSource with filters data and play these data with my processor.

I searched in the API documentation of JMF but I did'nt find the solution to get the raw data of my DataSource !

Someone could help me ? and give me an idea of how to proceed ?

Thanks for yours answers.

Sylvain.

[564 byte] By [sylsaua] at [2007-11-26 22:41:08]
# 1

Hi,

It seems no one has replied to this post. I have a sample code that can help getting raw data from a DataSource. Here it is:

PushBufferDataSource source = null;

source = (PushBufferDataSource)processor.getDataOutput();

/* Now we can retrieve the PushBufferStreams that will enable us to

* access the data from the camera

*/

PushBufferStream[] streams = source.getStreams();

camStream = null;

for (int i = 0; i < streams.length; i++) {

/* Use the first Stream that is RGBFormat (there should be only one */

if (streams.getFormat() instanceof RGBFormat) {

camStream = streams;

RGBFormat rgbf = (RGBFormat)streams.getFormat();

converter = new BufferToImage(rgbf);

break;

}

}

Please let me know whether it helped solving your problem..

Suresh

Thummalapentaa at 2007-7-10 11:55:48 > top of Java-index,Security,Cryptography...