Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.neomedia.directshow
Class DSCaptureDevice

java.lang.Object
  extended by net.java.sip.communicator.impl.neomedia.directshow.DSCaptureDevice

public class DSCaptureDevice
extends Object

DirectShow capture device.

Author:
Sebastien Vincent

Nested Class Summary
static class DSCaptureDevice.GrabberDelegate
          Delegate class to handle grabbing frames.
 
Constructor Summary
DSCaptureDevice(long ptr)
          Constructor.
 
Method Summary
 void close()
          Stop and close the capture device.
static int getBytes(long ptr, long buf, int length)
          Get bytes from buf native pointer and copy them to ptr byte native pointer.
 DSFormat getFormat()
          Get current format.
 String getName()
          Get name of the capture device.
 DSFormat[] getSupportedFormats()
          Get the supported video format this capture device supports.
 void open()
          Open and initialize the capture device.
 void setDelegate(DSCaptureDevice.GrabberDelegate delegate)
          Set a delegate to use when a frame is received.
 void setDelegate(long ptr, DSCaptureDevice.GrabberDelegate delegate)
          Native method to set a delegate to use when a frame is received.
 void setFormat(DSFormat format)
          Set format to use with this capture device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSCaptureDevice

public DSCaptureDevice(long ptr)
Constructor.

Parameters:
ptr - native pointer
Method Detail

open

public void open()
Open and initialize the capture device.


close

public void close()
Stop and close the capture device.


getName

public String getName()
Get name of the capture device.

Returns:
name of the capture device

setFormat

public void setFormat(DSFormat format)
Set format to use with this capture device.

Parameters:
format - format to set

getFormat

public DSFormat getFormat()
Get current format.

Returns:
current format used

getSupportedFormats

public DSFormat[] getSupportedFormats()
Get the supported video format this capture device supports.

Returns:
array of DSFormat

setDelegate

public void setDelegate(DSCaptureDevice.GrabberDelegate delegate)
Set a delegate to use when a frame is received.

Parameters:
delegate - delegate

setDelegate

public void setDelegate(long ptr,
                        DSCaptureDevice.GrabberDelegate delegate)
Native method to set a delegate to use when a frame is received.

Parameters:
ptr - native pointer
delegate - delegate

getBytes

public static int getBytes(long ptr,
                           long buf,
                           int length)
Get bytes from buf native pointer and copy them to ptr byte native pointer.

Parameters:
ptr - pointer to native data
buf - byte native pointer (see ByteBufferPool)
length - length of buf pointed by ptr
Returns:
length written to buf

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.