com.teamdev.jxcapture
Class VideoCapture

java.lang.Object
  extended by com.teamdev.jxcapture.VideoCapture
Direct Known Subclasses:
BaseDirectShowCapture, LinuxVideoCapture, LionVideoCapture, SnowLeopardVideoCapture

public abstract class VideoCapture
extends java.lang.Object

Base class that defines the video capture API.


Field Summary
static java.lang.String PROPERTY_AUDIO_SOURCE
           
static java.lang.String PROPERTY_CAPTURE_AREA
           
static java.lang.String PROPERTY_CAPTURE_TRANSPARENT_WINDOWS
           
static java.lang.String PROPERTY_FRAMERATE
           
static java.lang.String PROPERTY_INCLUDE_CURSOR
           
static java.lang.String PROPERTY_VIDEO_SOURCE
           
 
Constructor Summary
protected VideoCapture()
          Creates new video capture.
protected VideoCapture(VideoSource source)
          Creates new video capture for the specified video source.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add the specified property listener.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Add the specified property listener.
static VideoCapture create()
          Constructs video capture object for a native video format.
static VideoCapture create(VideoFormat videoFormat)
          Constructs video capture instance object for the specified video format.
protected abstract  void doPause()
          Performs the steps required to pause a video capture process.
protected abstract  void doStart()
          Performs the steps required to start a video capture process.
protected abstract  void doStop()
          Performs the steps required to stop a video capture process.
abstract  java.util.List<AudioCodec> getAudioCodecs()
          Returns the list of audio codecs that this video capture can provide.
 AudioSource getAudioSource()
          Returns the specified audio source.
static java.util.List<VideoFormat> getAvailableFormats()
          Returns the list of available video formats for a current platform.
 java.awt.Rectangle getCaptureArea()
           
 EncodingParameters getEncodingParameters()
          Returns the specified encoding settings.
 Framerate getFramerate()
          Returns the specified screen capture framerate in FPS units.
protected  java.beans.PropertyChangeSupport getPropertyChangeSupport()
           
abstract  java.util.List<Codec> getVideoCodecs()
          Returns the list of video codecs that this video capture can provide.
abstract  VideoFormat getVideoFormat()
          Returns the video format that this video capture provides.
 VideoSource getVideoSource()
          Returns the specified video source.
static boolean isAvailable()
          Checks whether video capture is supported for the current architecture and OS version
 boolean isCaptureTransparentWindows()
          Returns true if the capture operation allows to capture transparent or layered windows, otherwise - false.
 boolean isIncludeCursor()
          Determines whether the resulting image of the capture operation includes the cursor image.
 boolean isStarted()
          Returns the state of this video capture.
 void pause()
          Pauses current video capturing process.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove the specified property listener.
 void setAudioSource(AudioSource audioSource)
          Specifies new audio source for recording.
 void setCaptureArea(java.awt.Rectangle area)
           
 void setCaptureTransparentWindows(boolean captureTransparentWindows)
          Sets true if the captureTransparentWindows operation should allow to captureTransparentWindows transparent or layered windows, otherwise - false.
 void setEncodingParameters(EncodingParameters encodingParameters)
          Set the encoding parameters.
 void setFramerate(Framerate value)
          Specifies a required screen capture framerate in frames per second (FPS) units.
 void setFramerate(int value)
          Specifies a required screen capture framerate in frames per second (FPS) units.
 void setIncludeCursor(boolean includeCursor)
          Includes (or excludes) the cursor image to (or from) the resulting image of the capture operation.
 void setVideoSource(VideoSource videoSource)
          Specifies video source for recording.
 void start()
          Starts this video capture asynchronously.
 void start(EncodingParameters encodingParameters)
          Starts this video capture asynchronously.
 void stop()
          Stops a video capture process.
protected  void validate(EncodingParameters encodingParameters)
          Validates encoding settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_FRAMERATE

public static final java.lang.String PROPERTY_FRAMERATE
See Also:
Constant Field Values

PROPERTY_VIDEO_SOURCE

public static final java.lang.String PROPERTY_VIDEO_SOURCE
See Also:
Constant Field Values

PROPERTY_AUDIO_SOURCE

public static final java.lang.String PROPERTY_AUDIO_SOURCE
See Also:
Constant Field Values

PROPERTY_CAPTURE_AREA

public static final java.lang.String PROPERTY_CAPTURE_AREA
See Also:
Constant Field Values

PROPERTY_INCLUDE_CURSOR

public static final java.lang.String PROPERTY_INCLUDE_CURSOR
See Also:
Constant Field Values

PROPERTY_CAPTURE_TRANSPARENT_WINDOWS

public static final java.lang.String PROPERTY_CAPTURE_TRANSPARENT_WINDOWS
See Also:
Constant Field Values
Constructor Detail

VideoCapture

protected VideoCapture()
Creates new video capture.


VideoCapture

protected VideoCapture(VideoSource source)
Creates new video capture for the specified video source.

Parameters:
source - video source
Method Detail

isStarted

public boolean isStarted()
Returns the state of this video capture.

Returns:
true if it's already started; false otherwise;

getEncodingParameters

public EncodingParameters getEncodingParameters()
Returns the specified encoding settings.

Returns:
encoding settings

setEncodingParameters

public void setEncodingParameters(EncodingParameters encodingParameters)
Set the encoding parameters.

Parameters:
encodingParameters - parameter for encoding

getFramerate

public Framerate getFramerate()
Returns the specified screen capture framerate in FPS units.

Returns:
specified screen capture framerate

setFramerate

public void setFramerate(int value)
Specifies a required screen capture framerate in frames per second (FPS) units.
The specified frame rate must be in range defined by Framerate.MIN and Framerate.MAX constant, or Framerate.ACTUAL which defines an actual capture frame rate.

Parameters:
value - required frame rate value that must be in range [Framerate.MIN - Framerate.MAX]
Throws:
java.lang.IllegalArgumentException - if specified framerate is not valid

setFramerate

public void setFramerate(Framerate value)
Specifies a required screen capture framerate in frames per second (FPS) units.

Parameters:
value - required frame rate value

start

public final void start(EncodingParameters encodingParameters)
Starts this video capture asynchronously.

Parameters:
encodingParameters - encoding parameters

start

public final void start()
Starts this video capture asynchronously.


validate

protected void validate(EncodingParameters encodingParameters)
Validates encoding settings.

Parameters:
encodingParameters - specifies video encoding settings

doStart

protected abstract void doStart()
Performs the steps required to start a video capture process.


stop

public final void stop()
Stops a video capture process.


pause

public final void pause()
Pauses current video capturing process.


doPause

protected abstract void doPause()
Performs the steps required to pause a video capture process.


doStop

protected abstract void doStop()
Performs the steps required to stop a video capture process.


getVideoFormat

public abstract VideoFormat getVideoFormat()
Returns the video format that this video capture provides.

Returns:
video format provided by this video capture

getVideoCodecs

public abstract java.util.List<Codec> getVideoCodecs()
Returns the list of video codecs that this video capture can provide.

Returns:
list of Codec objects.

getAudioCodecs

public abstract java.util.List<AudioCodec> getAudioCodecs()
Returns the list of audio codecs that this video capture can provide.

Returns:
list of Codec objects.

create

public static VideoCapture create(VideoFormat videoFormat)
Constructs video capture instance object for the specified video format.

Parameters:
videoFormat - specifies the required video format
Returns:
a video capture instance; null if no appropriate video capture found for the specified video format

create

public static VideoCapture create()
Constructs video capture object for a native video format.

Returns:
a video capture instance; null if no appropriate video capture implementation is found for the specified video format

getAvailableFormats

public static java.util.List<VideoFormat> getAvailableFormats()
Returns the list of available video formats for a current platform.

Returns:
list of VideoFormat objects

getAudioSource

public AudioSource getAudioSource()
Returns the specified audio source.

Returns:
audio source

setAudioSource

public void setAudioSource(AudioSource audioSource)
Specifies new audio source for recording.

Parameters:
audioSource - new audio source; null is allowed value

getVideoSource

public VideoSource getVideoSource()
Returns the specified video source.

Returns:
video source

setVideoSource

public void setVideoSource(VideoSource videoSource)
Specifies video source for recording.

Parameters:
videoSource - new video source

isAvailable

public static boolean isAvailable()
Checks whether video capture is supported for the current architecture and OS version

Returns:
possibility of video capture

getPropertyChangeSupport

protected java.beans.PropertyChangeSupport getPropertyChangeSupport()

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Add the specified property listener.

Parameters:
propertyName - property name
listener - listener

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add the specified property listener.

Parameters:
listener - listener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove the specified property listener.

Parameters:
listener - listener

getCaptureArea

public java.awt.Rectangle getCaptureArea()
Returns:
specified capturing area

setCaptureArea

public void setCaptureArea(java.awt.Rectangle area)
Parameters:
area - required rectangular capture area

isIncludeCursor

public boolean isIncludeCursor()
Determines whether the resulting image of the capture operation includes the cursor image.

Returns:
true if the result of the capture operation includes the cursor image, false otherwise

setIncludeCursor

public void setIncludeCursor(boolean includeCursor)
Includes (or excludes) the cursor image to (or from) the resulting image of the capture operation.

Parameters:
includeCursor - If true, this cursor image is included into the result of the capture operation; otherwise not

isCaptureTransparentWindows

public boolean isCaptureTransparentWindows()
Returns true if the capture operation allows to capture transparent or layered windows, otherwise - false.

A layered or transparent window is used by some applications to create a fade-in/out effect for menus and windows. Layered windows are also used for desktop animation, such as animated help assistants.

Returns:
true if the capture transparent or layered window option is set, otherwise - false

setCaptureTransparentWindows

public void setCaptureTransparentWindows(boolean captureTransparentWindows)
Sets true if the captureTransparentWindows operation should allow to captureTransparentWindows transparent or layered windows, otherwise - false.

A layered or transparent window is used by some applications to create a fade-in/out effect for menus and windows. Layered windows are also used for desktop animation, such as animated help assistants.

Parameters:
captureTransparentWindows - true if the captureTransparentWindows operation should allow to captureTransparentWindows transparent or layered window, otherwise - false