|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objecttoxi.video.capture.JMFSimpleCapture
public class JMFSimpleCapture
JMFSimpleCapture is a implementation of the
SimpleCapture interface using Sun's Java Media Framework.
It came about as hopefully slightly more robust alternative to the the
QT4Java approach of the existing Processing Capture class, though so far has
only been tested under Windows and with a small set of camera models. Since
meanwhile JMF is an unmaintained product, there might be major issues with
newer cameras and/or larger capture sizes. I wrote this code for a particular
project and I had a good user experience with the underlying technology.
| Constructor Summary | |
|---|---|
JMFSimpleCapture()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getError()
String description of an error occured previously. |
processing.core.PImage |
getFrame()
Reads the current frame from the internal video capture and converts it into a PImage object |
int |
getHeight()
Retrieves the pixel height of the capture instance |
int |
getWidth()
Retrieves the pixel width of the capture instance |
boolean |
initVideo(java.lang.String deviceID,
int width,
int height,
int fps)
Initializes video capture for the given device. |
static void |
listDeviceFormats(java.io.PrintStream ps,
java.lang.String deviceID)
Prints all available capture formats of the given device to a PrintStream |
static void |
listDeviceFormats(java.lang.String deviceID)
Prints all available capture formats of the given device to the console |
static void |
listDevices()
Lists all connected capture devices to the console |
static void |
listDevices(java.io.PrintStream ps,
boolean showFormats)
Writes details of all connected capture devices to the given PrintStream and optionally shows available capture formats too |
void |
shutdown()
Handles freeing up any resources used by the SimpleCapture instance |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JMFSimpleCapture()
| Method Detail |
|---|
public java.lang.String getError()
SimpleCapture
getError in interface SimpleCapturepublic processing.core.PImage getFrame()
SimpleCapture
getFrame in interface SimpleCapturepublic int getHeight()
SimpleCapture
getHeight in interface SimpleCapturepublic int getWidth()
SimpleCapture
getWidth in interface SimpleCapture
public boolean initVideo(java.lang.String deviceID,
int width,
int height,
int fps)
IMPORTANT: framerate is currently ignored. The device's default framerate for the chosen resolution is used.
initVideo in interface SimpleCapturedeviceID - device descriptorwidth - capture frame widthheight - capture frame heightfps - frame rate
getError().SimpleCapture.initVideo(java.lang.String, int,
int, int)
public static void listDeviceFormats(java.io.PrintStream ps,
java.lang.String deviceID)
ps - a valid PrintStream instancedeviceID - descriptor string of devicepublic static void listDeviceFormats(java.lang.String deviceID)
deviceID - descriptor string of devicepublic static void listDevices()
public static void listDevices(java.io.PrintStream ps,
boolean showFormats)
ps - a valid PrintStream instanceshowFormats - true, if format information is requiredpublic void shutdown()
SimpleCapture
shutdown in interface SimpleCapture
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||