Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I fix this buffer issue?

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

like image 390
Zeveso Avatar asked Apr 10 '26 08:04

Zeveso


1 Answers

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.

like image 152
Zach L Avatar answered Apr 11 '26 20:04

Zach L



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!