UDP doesn't guarantee packet delivery. If your CPU can't process the
incoming packets, they will likely get dropped.
As an experiment, you can always spawn a CPU-intensive Java-only
thread and see if that has the same effect as the thread doing ffmpeg
stuff.
On Oct 17, 2007, at 10:17 AM, Glick, Gene (GE Indust, Security) wrote:
I'm just wondering about threads and JNA. My application uses java
to receive streaming data over UDP, then pass the data to ffmpeg
video decoder. There are 2 threads running in a producer/consumer
model and they run at the same priority level. One thread simply
gets the packets in, and buffers them up (producer). The other
thread does a bunch of stuff, including calling ffmpeg decoder (the
consumer thread). FFMPEG is setup and called with JNA. All this
is working so far. But, the producer thread seems to be missing
some packets periodically. If the ffmpeg stuff is turned off,
temporarily, far fewer packets get missed. Oh, the FFMEG decode
software consumes a lot of CPU time.
Any idea if this is a jna issue? Maybe it's just java? Or maybe
my threading model is wrong?
regards,
gene