How do I fix this buffer issue?

605 views Asked by At

enter image description here

Basically I don't know what to do...

I downloaded the JMF library and inserted the library into the project. It was working fine until I came across this problem. Let me know what you think. Thanks!!!

Zev

1

There are 1 answers

10
Zach L On BEST ANSWER

You could explicitly make _buf into a javax.media.Buffer by writing out its full name, like

javax.media.Buffer _buf = frameGrabber.grabFrame();

Alternatively, you could import all of the classes of javax.media by placing in your import statements (or above the class definition public class mediaFunction) :

import javax.media.*;

Or you could import specifically javax.media.Buffer so Java knows that Buffer really means javax.media.Buffer, by importing:

import javax.media.Buffer;

This article on packages and imports may help.

What I'm guessing is you imported java.nio.* or java.nio.Buffer, so it thinks that Buffer implicitly means java.nio.Buffer, not the buffer type that frameGrabber.grabFrame() returns, or in other words, javax.media.Buffer. Regardless, my first solution ought to fix your problem.