net.luniks.linux.jv4linfo
Class V4L2Ctrl

java.lang.Object
  extended bynet.luniks.linux.jv4linfo.V4L2Ctrl

public class V4L2Ctrl
extends java.lang.Object

Class to query and control a v4l2 device such as getting or setting the currently selected video standard

Author:
Torsten Römer, www.luniks.net

Field Summary
private  java.lang.String device
           
private  V4L2Info info
           
 
Constructor Summary
V4L2Ctrl(java.lang.String device)
           
 
Method Summary
 V4L2Info getInfo()
           
 int getSelectedAudiomode()
          Looks at all inputs starting with index '0' and returns the audiomode of the tuner associated with the first input of type tuner
 V4L2Frequency getSelectedFrequency()
          Looks at all inputs starting with index '0' and returns the frequency of the tuner associated with the first input of type tuner as V4L2Frequency instance
 V4L2Input getSelectedInput()
          Returns the currently selected input as V4L2Input instance.
 V4L2Standard getSelectedStandard()
          Returns the currently selected standard as V4L2Standard instance.
 V4L2Tuner getTuner()
          Looks at all inputs starting with index '0' and returns the tuner associated with the first input of type tuner
 void setMuted(boolean mute)
          Mutes or unmutes the device
 void setSelectedAudiomode(int value)
          Looks at all inputs starting with index '0' and sets the audiomode of the tuner associated with the first input of type tuner to the audiomode value given as argument
 void setSelectedFrequency(int units)
          Looks at all inputs starting with index '0' and sets the frequency of the tuner associated with the first input of type tuner to the frequency value given as argument in units of 62.5 Hz if V4L2Tuner.isCapLow() returns true, in units of 62.5 kHz otherwise.
 void setSelectedInput(int index)
          Sets the selected input by the index given as argument
 void setSelectedStandard(int index)
          Sets the selected standard by the index given as argument
 void setSelectedStandard(long id)
          Sets the selected standard by the id given as argument
 java.lang.String toString()
          String representation of the current selection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

device

private java.lang.String device

info

private V4L2Info info
Constructor Detail

V4L2Ctrl

public V4L2Ctrl(java.lang.String device)
         throws JV4LInfoException
Method Detail

getInfo

public V4L2Info getInfo()

getSelectedInput

public V4L2Input getSelectedInput()
                           throws JV4LInfoException
Returns the currently selected input as V4L2Input instance.

Returns:
the currently selected input
Throws:
JV4LInfoException

getSelectedStandard

public V4L2Standard getSelectedStandard()
                                 throws JV4LInfoException
Returns the currently selected standard as V4L2Standard instance.

Returns:
the currently selected standard
Throws:
JV4LInfoException

getTuner

public V4L2Tuner getTuner()
                   throws JV4LInfoException
Looks at all inputs starting with index '0' and returns the tuner associated with the first input of type tuner

Returns:
the tuner
Throws:
JV4LInfoException

getSelectedFrequency

public V4L2Frequency getSelectedFrequency()
                                   throws JV4LInfoException
Looks at all inputs starting with index '0' and returns the frequency of the tuner associated with the first input of type tuner as V4L2Frequency instance

Returns:
the frequency
Throws:
JV4LInfoException

getSelectedAudiomode

public int getSelectedAudiomode()
                         throws JV4LInfoException
Looks at all inputs starting with index '0' and returns the audiomode of the tuner associated with the first input of type tuner

Returns:
the frequency
Throws:
JV4LInfoException

setSelectedInput

public void setSelectedInput(int index)
                      throws JV4LInfoException
Sets the selected input by the index given as argument

Parameters:
index - the index to set the input to
Throws:
JV4LInfoException

setSelectedStandard

public void setSelectedStandard(long id)
                         throws JV4LInfoException
Sets the selected standard by the id given as argument

Parameters:
id - the id to set the standard to
Throws:
JV4LInfoException

setSelectedStandard

public void setSelectedStandard(int index)
                         throws JV4LInfoException
Sets the selected standard by the index given as argument

Parameters:
index - the index to set the standard to
Throws:
JV4LInfoException

setSelectedFrequency

public void setSelectedFrequency(int units)
                          throws JV4LInfoException
Looks at all inputs starting with index '0' and sets the frequency of the tuner associated with the first input of type tuner to the frequency value given as argument in units of 62.5 Hz if V4L2Tuner.isCapLow() returns true, in units of 62.5 kHz otherwise.

Parameters:
units - the units to set the frequency to
Throws:
JV4LInfoException

setSelectedAudiomode

public void setSelectedAudiomode(int value)
                          throws JV4LInfoException
Looks at all inputs starting with index '0' and sets the audiomode of the tuner associated with the first input of type tuner to the audiomode value given as argument

Parameters:
value - the value of the audiomode to be set
Throws:
JV4LInfoException

setMuted

public void setMuted(boolean mute)
              throws JV4LInfoException
Mutes or unmutes the device

Parameters:
mute - true to mute, false to unmute
Throws:
JV4LInfoException

toString

public java.lang.String toString()
String representation of the current selection



Copyright © 2004 Torsten Römer, dode@luniks.net