Commit c5c12b78 authored by petter's avatar petter

Reverted changes


git-svn-id: https://www2.in.tum.de/repos/ttt/trunk@51 0463f305-d864-43cb-8a47-61cf597d4139
parent 5f7e641a
...@@ -9,7 +9,5 @@ ...@@ -9,7 +9,5 @@
<classpathentry kind="lib" path="lib/swing-layout-1.0.2.jar"/> <classpathentry kind="lib" path="lib/swing-layout-1.0.2.jar"/>
<classpathentry kind="lib" path="lib/jmf-2.1.1e.jar"/> <classpathentry kind="lib" path="lib/jmf-2.1.1e.jar"/>
<classpathentry kind="lib" path="lib/mp3plugin.jar"/> <classpathentry kind="lib" path="lib/mp3plugin.jar"/>
<classpathentry kind="lib" path="lib/v4l4j.jar"/>
<classpathentry kind="lib" path="lib/lti-civil.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>
...@@ -45,13 +45,11 @@ public class LectureProfile { ...@@ -45,13 +45,11 @@ public class LectureProfile {
private int port = 5900; private int port = 5900;
private boolean record = true; private boolean record = true;
private boolean recordVideo = true; private boolean recordVideo = true;
private boolean recordWebcam = true;
private boolean recordLinearAudio = true; // linear = wav private boolean recordLinearAudio = true; // linear = wav
private boolean loopbackRecorder = false; private boolean loopbackRecorder = false;
private int colorDepth = Constants.defaultColorDepth; private int colorDepth = Constants.defaultColorDepth;
private String RecordingCamera;
private ttt.videoRecorder.TTTVideoFormat Format;
private float VideoQuality;
// used whether to show info box or not // used whether to show info box or not
// stored in profile because other profile might be used by other person // stored in profile because other profile might be used by other person
// //
...@@ -103,9 +101,7 @@ public class LectureProfile { ...@@ -103,9 +101,7 @@ public class LectureProfile {
profile.loopbackRecorder = preferences.getBoolean("loopback_recorder", false); profile.loopbackRecorder = preferences.getBoolean("loopback_recorder", false);
profile.showRecordControlsInfo = preferences.getBoolean("show_record_controls_info", true); profile.showRecordControlsInfo = preferences.getBoolean("show_record_controls_info", true);
profile.showRecordPlayRecordWarning = preferences.getBoolean("show_record_play_record_warning", true); profile.showRecordPlayRecordWarning = preferences.getBoolean("show_record_play_record_warning", true);
profile.RecordingCamera = preferences.get("RecordingCamera", "");
profile.Format = new ttt.videoRecorder.TTTVideoFormat(preferences.getInt("FormatWidth", 160), preferences.getInt("FormatHeight", 120));
profile.VideoQuality = preferences.getFloat("VideoQuality", 0.1f);
return profile; return profile;
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -143,10 +139,7 @@ public class LectureProfile { ...@@ -143,10 +139,7 @@ public class LectureProfile {
preferences.putBoolean("loopback_recorder", loopbackRecorder); preferences.putBoolean("loopback_recorder", loopbackRecorder);
preferences.putBoolean("show_record_controls_info", showRecordControlsInfo); preferences.putBoolean("show_record_controls_info", showRecordControlsInfo);
preferences.putBoolean("show_record_play_record_warning", showRecordPlayRecordWarning); preferences.putBoolean("show_record_play_record_warning", showRecordPlayRecordWarning);
preferences.put("RecordingCamera", RecordingCamera);
preferences.putFloat("VideoQuality", VideoQuality);
preferences.putInt("FormatWidth", Format.getWidth());
preferences.putInt("FormatHeight", Format.getHeight());
preferences.flush(); preferences.flush();
} catch (Exception e) { } catch (Exception e) {
System.out.println("failed to write Lecture Profile: " + e); System.out.println("failed to write Lecture Profile: " + e);
...@@ -493,34 +486,6 @@ public class LectureProfile { ...@@ -493,34 +486,6 @@ public class LectureProfile {
return recordVideo; return recordVideo;
} }
public void setRecordingFormat (ttt.videoRecorder.TTTVideoFormat format) {
this.Format = format;
}
public String getRecordingCamera(){
return RecordingCamera;
}
public void setRecordingCamera(String recordCameraID) {
this.RecordingCamera = recordCameraID;
}
public ttt.videoRecorder.TTTVideoFormat getVideoFormat(){
return Format;
}
public float getVideoQuality(){
return VideoQuality;
}
public void setVideoQualiy(float Quality){
VideoQuality = Quality;
}
public void setRecordVideoEnabled(boolean recordVideo) { public void setRecordVideoEnabled(boolean recordVideo) {
this.recordVideo = recordVideo; this.recordVideo = recordVideo;
} }
......
...@@ -50,10 +50,6 @@ import javax.swing.SpringLayout; ...@@ -50,10 +50,6 @@ import javax.swing.SpringLayout;
import javax.swing.event.CaretEvent; import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener; import javax.swing.event.CaretListener;
import ttt.videoRecorder.OSUtils;
import ttt.videoRecorder.WebCamControl;
import ttt.videoRecorder.OSUtils.CameraException;
public class LectureProfileDialog { public class LectureProfileDialog {
public static void showLectureProfileDialog() { public static void showLectureProfileDialog() {
new LectureProfileDialog().show(); new LectureProfileDialog().show();
...@@ -214,34 +210,24 @@ public class LectureProfileDialog { ...@@ -214,34 +210,24 @@ public class LectureProfileDialog {
recorderCheckBox.setSelected(true); recorderCheckBox.setSelected(true);
recorderCheckBox.setEnabled(false); recorderCheckBox.setEnabled(false);
// video recording // video recording
WebCamControl webcam = null; final JCheckBox recordVideoCheckBox = new JCheckBox("incl. video");
final ttt.videoRecorder.VideoSettingPanel CameraSettings; recordVideoCheckBox.setToolTipText("enable video recoding");
JButton CameraSettingsButton = new JButton("Camera Setting"); recordVideoCheckBox.setOpaque(false);
CameraSettingsButton.setEnabled(false); recordVideoCheckBox.setSelected(true);
recordVideoCheckBox.setEnabled(false);
try {
webcam = OSUtils.obtainWebcam();
} catch (CameraException e) {
System.err.println("Could not connect to camera");
//e.printStackTrace();
}
if (webcam!=null) {
CameraSettings = new ttt.videoRecorder.VideoSettingPanel(webcam);
CameraSettings.show(false);
CameraSettingsButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
CameraSettings.show(true);
}
});
}
else CameraSettings=null;
// cam recording
final JCheckBox camCheckBox = new JCheckBox("incl. Webcam");
camCheckBox.setToolTipText("enable Webcam recoding");
camCheckBox.setOpaque(false);
camCheckBox.setSelected(true);
camCheckBox.setEnabled(false);
// enable/disable according to recorder selection // enable/disable according to recorder selection
recorderCheckBox.addActionListener(new ActionListener() { recorderCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
recordVideoCheckBox.setVisible(recorderCheckBox.isSelected());
filenameField.setVisible(recorderCheckBox.isSelected()); filenameField.setVisible(recorderCheckBox.isSelected());
filenameLabel.setVisible(recorderCheckBox.isSelected()); filenameLabel.setVisible(recorderCheckBox.isSelected());
} }
...@@ -322,8 +308,8 @@ public class LectureProfileDialog { ...@@ -322,8 +308,8 @@ public class LectureProfileDialog {
panel.add(label); panel.add(label);
panel.add(recorderCheckBox); panel.add(recorderCheckBox);
panel.add(new JLabel(" ")); panel.add(new JLabel(" "));
// panel.add(recordVideoCheckBox); panel.add(recordVideoCheckBox);
panel.add(filenameLabel); panel.add(filenameLabel);
panel.add(filenameField); panel.add(filenameField);
} }
...@@ -385,12 +371,13 @@ public class LectureProfileDialog { ...@@ -385,12 +371,13 @@ public class LectureProfileDialog {
videoRecordingPanel.add(Box.createVerticalStrut(5)); videoRecordingPanel.add(Box.createVerticalStrut(5));
final JLabel videolabel = new JLabel("Video Recording:"); label = new JLabel("Video Recording:");
videolabel.setEnabled(false); label.setEnabled(false);
videoRecordingPanel.add(videolabel); videoRecordingPanel.add(label);
videoRecordingPanel.add(videoRecordingOnCheckbox); videoRecordingPanel.add(videoRecordingOnCheckbox);
videoRecordingPanel.add(videoRecordingOffCheckbox); videoRecordingPanel.add(videoRecordingOffCheckbox);
videoRecordingPanel.add(CameraSettingsButton);
videoRecordingPanel.add(Box.createVerticalGlue());
videoRecordingPanel.add(audioFormatLabel); videoRecordingPanel.add(audioFormatLabel);
videoRecordingPanel.add(wavRadioButton); videoRecordingPanel.add(wavRadioButton);
...@@ -443,6 +430,8 @@ public class LectureProfileDialog { ...@@ -443,6 +430,8 @@ public class LectureProfileDialog {
portField.setText("5900"); portField.setText("5900");
displayDesktopCheckBox.setSelected(false); displayDesktopCheckBox.setSelected(false);
recorderCheckBox.setSelected(true); recorderCheckBox.setSelected(true);
recordVideoCheckBox.setSelected(true);
recordVideoCheckBox.setVisible(recorderCheckBox.isSelected());
videoRecordingOnCheckbox.setSelected(true); videoRecordingOnCheckbox.setSelected(true);
filenameField.setVisible(recorderCheckBox.isSelected()); filenameField.setVisible(recorderCheckBox.isSelected());
filenameLabel.setVisible(recorderCheckBox.isSelected()); filenameLabel.setVisible(recorderCheckBox.isSelected());
...@@ -470,9 +459,8 @@ public class LectureProfileDialog { ...@@ -470,9 +459,8 @@ public class LectureProfileDialog {
// buttons // buttons
final JButton okButton = new JButton("ok"); final JButton okButton = new JButton("ok");
okButton.setEnabled(false); okButton.setEnabled(false);
JButton cancelButton = new JButton("cancel"); JButton cancelButton = new JButton("cancel");
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
...@@ -556,10 +544,6 @@ public class LectureProfileDialog { ...@@ -556,10 +544,6 @@ public class LectureProfileDialog {
// set values // set values
if (profile != null) { if (profile != null) {
// CameraSettings.getCameraIDs().contains(profile.getRecordingCamera());
lectureComboBox.setSelectedItem(profile.getLecture()); lectureComboBox.setSelectedItem(profile.getLecture());
teacherComboBox.setSelectedItem(profile.getTeacher()); teacherComboBox.setSelectedItem(profile.getTeacher());
hostField.setText(profile.getHost()); hostField.setText(profile.getHost());
...@@ -578,16 +562,10 @@ public class LectureProfileDialog { ...@@ -578,16 +562,10 @@ public class LectureProfileDialog {
displayDesktopCheckBox.setSelected(!loopback); displayDesktopCheckBox.setSelected(!loopback);
recorderCheckBox.setSelected(profile.isRecordEnabled()); recorderCheckBox.setSelected(profile.isRecordEnabled());
// recordVideoCheckBox.setSelected(profile.isRecordVideoEnabled()); recordVideoCheckBox.setSelected(profile.isRecordVideoEnabled());
// recordVideoCheckBox.setVisible(recorderCheckBox.isSelected()); recordVideoCheckBox.setVisible(recorderCheckBox.isSelected());
if (CameraSettings!=null) if(CameraSettings.CamerasFound()){ videoRecordingOnCheckbox.setSelected(profile.isRecordVideoEnabled());
videoRecordingOnCheckbox.setSelected(profile.isRecordVideoEnabled()); videoRecordingOffCheckbox.setSelected(!profile.isRecordVideoEnabled());
videoRecordingOffCheckbox.setSelected(!profile.isRecordVideoEnabled());
if( CameraSettings.getCameraIDs().contains(profile.getRecordingCamera()))
CameraSettings.setRecordingCamera(profile.getRecordingCamera());
CameraSettings.setRecordingFormat(profile.getVideoFormat());
CameraSettings.setQuality(profile.getVideoQuality());
}
//Always use wave encoding in order to set profile.isRecordLinearAudioEnabled() to true //Always use wave encoding in order to set profile.isRecordLinearAudioEnabled() to true
wavRadioButton.setSelected(true); wavRadioButton.setSelected(true);
mp3RadioButton.setSelected(false); mp3RadioButton.setSelected(false);
...@@ -614,17 +592,11 @@ public class LectureProfileDialog { ...@@ -614,17 +592,11 @@ public class LectureProfileDialog {
profile.setPort(portField.getNumber() >= 100 ? portField.getNumber() profile.setPort(portField.getNumber() >= 100 ? portField.getNumber()
: (portField.getNumber() + 5900)); : (portField.getNumber() + 5900));
profile.setRecordEnabled(recorderCheckBox.isSelected()); profile.setRecordEnabled(recorderCheckBox.isSelected());
profile.setRecordVideoEnabled(recordVideoCheckBox.isSelected());
profile.setRecordVideoEnabled(videoRecordingOnCheckbox.isSelected()); profile.setRecordVideoEnabled(videoRecordingOnCheckbox.isSelected());
profile.setRecordLinearAudioEnabled(wavRadioButton.isSelected()); profile.setRecordLinearAudioEnabled(wavRadioButton.isSelected());
profile.setLoopbackRecorder(!displayDesktopCheckBox.isSelected()); profile.setLoopbackRecorder(!displayDesktopCheckBox.isSelected());
if (CameraSettings!=null){
profile.setRecordingFormat(CameraSettings.getRecordingFormat());
profile.setRecordingCamera(CameraSettings.getRecordingCamera());
profile.setVideoQualiy(CameraSettings.getQuality());
CameraSettings.show(false);
}
profile.storeProfile(); profile.storeProfile();
TTT.userPrefs.put("last_used_lecture_profile", profile.getLecture()); TTT.userPrefs.put("last_used_lecture_profile", profile.getLecture());
...@@ -676,18 +648,11 @@ public class LectureProfileDialog { ...@@ -676,18 +648,11 @@ public class LectureProfileDialog {
for (int i = 0; i < components.length; i++) { for (int i = 0; i < components.length; i++) {
components[i].setEnabled(true); components[i].setEnabled(true);
} }
components = videoRecordingPanel.getComponents();
if(CameraSettings==null || CameraSettings.CamerasFound()){ for (int i = 0; i < components.length; i++) {
components = videoRecordingPanel.getComponents(); components[i].setEnabled(true);
for (int i = 0; i < components.length; i++) {
components[i].setEnabled(true);
}
}else{
videolabel.setText("No Camera available");
videoRecordingOffCheckbox.setSelected(true);
} }
avLabel.setEnabled(true); avLabel.setEnabled(true);
audioVolumeLabel.setEnabled(true); audioVolumeLabel.setEnabled(true);
recordingPathButton.setEnabled(true); recordingPathButton.setEnabled(true);
......
...@@ -45,6 +45,8 @@ import javax.swing.JInternalFrame; ...@@ -45,6 +45,8 @@ import javax.swing.JInternalFrame;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.ProgressMonitor; import javax.swing.ProgressMonitor;
import com.sun.org.apache.xalan.internal.xsltc.runtime.Hashtable;
/** /**
* *
* @author ziewer * @author ziewer
......
...@@ -61,7 +61,7 @@ public class Recorder implements MessageConsumer, Closeable { ...@@ -61,7 +61,7 @@ public class Recorder implements MessageConsumer, Closeable {
private DataOutputStream out; private DataOutputStream out;
private AudioRecorder audioVideoRecorder; private AudioRecorder audioVideoRecorder;
private VideoRecorderPanel VideoRecorder; private VideoRecorder VideoRecorder;
private LectureProfile lectureProfile; private LectureProfile lectureProfile;
...@@ -330,17 +330,14 @@ public class Recorder implements MessageConsumer, Closeable { ...@@ -330,17 +330,14 @@ public class Recorder implements MessageConsumer, Closeable {
if (audioVideoRecorder != null) if (audioVideoRecorder != null)
audioVideoRecorder.startRec(file.getCanonicalPath()); audioVideoRecorder.startRec(file.getCanonicalPath());
//VideoRec start //VideoRecStuff start
//TODO recording options // TODO VideoRecStart
if(lectureProfile.isRecordVideoEnabled()){ if(lectureProfile.isRecordVideoEnabled()){
VideoRecorder = new VideoRecorderPanel(); VideoRecorder = new VideoRecorder();
VideoRecorder.setRecordingFormat(lectureProfile.getVideoFormat());
VideoRecorder.setRecordingCamera(lectureProfile.getRecordingCamera());
VideoRecorder.setVideoQuality(lectureProfile.getVideoQuality());
VideoRecorder.setRecordpath(file.getCanonicalPath().substring(0, file.getCanonicalPath().length()-4)); VideoRecorder.setRecordpath(file.getCanonicalPath().substring(0, file.getCanonicalPath().length()-4));
VideoRecorder.Start(); VideoRecorder.Start();
} }
//VideoRecStuff end
// startime // startime
long starttime = System.currentTimeMillis(); long starttime = System.currentTimeMillis();
...@@ -417,27 +414,27 @@ public class Recorder implements MessageConsumer, Closeable { ...@@ -417,27 +414,27 @@ public class Recorder implements MessageConsumer, Closeable {
audioVideoRecorder.stopRec(); audioVideoRecorder.stopRec();
} }
//TODO VideorecStop
if (VideoRecorder != null) { if (VideoRecorder != null) {
if (closing) { if (closing) {
VideoRecorder.close(); VideoRecorder.close();
VideoRecorder = null; VideoRecorder = null;
} else{
} else
VideoRecorder.Stop(); VideoRecorder.Stop();
} }
}
out.flush(); out.flush();
out.close(); out.close();
out = null; out = null;
}
TTT.userPrefs.put("last_opened_recording", file.getCanonicalPath()); TTT.userPrefs.put("last_opened_recording", file.getCanonicalPath());
System.out.println("Recorder stop."); System.out.println("Recorder stop.");
} }
}
// modified by Ziewer - 10.05.2007 // modified by Ziewer - 10.05.2007
// NOTE: writes file header WITHOUT starttime // NOTE: writes file header WITHOUT starttime
......
...@@ -37,10 +37,8 @@ import java.io.IOException; ...@@ -37,10 +37,8 @@ import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.Date; import java.util.Date;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
public class ScriptCreator { public class ScriptCreator {
final static int HTML_SCRIPT = 1; final static int HTML_SCRIPT = 1;
...@@ -313,9 +311,6 @@ public class ScriptCreator { ...@@ -313,9 +311,6 @@ public class ScriptCreator {
out.close(); out.close();
} }
// css style sheet // css style sheet
void writeStyleSheet() { void writeStyleSheet() {
try { try {
......
...@@ -1091,7 +1091,7 @@ public class TTT extends JFrame { ...@@ -1091,7 +1091,7 @@ public class TTT extends JFrame {
// TODO: position management // TODO: position management
private int position; private int position;
public void addInternalFrameCentered(JInternalFrame frame) { void addInternalFrameCentered(JInternalFrame frame) {
frame.pack(); frame.pack();
......
package ttt.videoRecorder;
//handles the incoming pictures for linuxcam and windowscam
public interface CaptureInterface {
public void onNewImage(byte[] image, String RecordPath, float Quality);
}
/**
*
* @author sigl ludwig
*
*/
package ttt.videoRecorder; package ttt.videoRecorder;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Vector;
import java.io.File;
import java.lang.Thread; import java.lang.Thread;
import javax.swing.ImageIcon;
import com.lti.civil.Image;
import au.edu.jcu.v4l4j.FrameGrabber; import au.edu.jcu.v4l4j.FrameGrabber;
import au.edu.jcu.v4l4j.ImageFormat;
import au.edu.jcu.v4l4j.VideoDevice; import au.edu.jcu.v4l4j.VideoDevice;
import au.edu.jcu.v4l4j.ResolutionInfo.DiscreteResolution;
import au.edu.jcu.v4l4j.exceptions.V4L4JException; import au.edu.jcu.v4l4j.exceptions.V4L4JException;
//This classs set and get methods are completly unfished!
public class LinuxCam implements WebCamControl, Runnable { public class LinuxCam implements WebCamControl, Runnable {
public static String RecordPath = "C:\\TTTImplement\\";
private CaptureInterface CI; private static VideoDevice vd;
private String v4lSysfsPath = "/sys/class/video4linux/"; private static FrameGrabber fg;
private String RecordPath; private Thread captureThread;
private List<VideoDevice> system = new LinkedList<VideoDevice>(); public static boolean isRecording = false;
private FrameGrabber fg;
private Thread captureThread; public LinuxCam() throws V4L4JException{
int w = 160, h = 120; String dev = "/dev/video0";
private boolean CamFound = false;
private float CompressionQuality = 0.1f; int w=160, h=120, std=0, channel = 0, qty = 60;
public boolean isRecording = false;
String dev = "/dev/video0"; initFrameGrabber(dev, w, h, std, channel, qty);
int currentdev = 0; }
public LinuxCam() throws V4L4JException { /* Shouldn't be needed but untetested...
initializeDevices(); public void setImage(byte[] b) {
} GUIMain.myLabel.setIcon(new ImageIcon(b));
}*/
protected void initializeDevices() throws V4L4JException {
for (Object i : listV4LDeviceFiles()) { /**
system.add(new VideoDevice(i.toString())); * is called in start by the new capture thread stuff
} */
} public void run(){
ByteBuffer bb;
/** byte[] b;
* Implements the capture thread: get a frame from the FrameGrabber, and try {
* display it //OnCapture.RecordPath = RecordPath;
*/ while(isRecording){
public void run() { bb = fg.getFrame();
ByteBuffer bb; b = new byte[bb.limit()];
byte[] image; bb.get(b);
OnCapture SafePic = new OnCapture();
SafePic.onNewImage((Image) new ImageIcon(b).getImage(),RecordPath);
// setImage(b);
}
} catch (V4L4JException e) {
e.printStackTrace();
System.out.println("Failed to capture image");
}
}
private void initFrameGrabber(String dev, int w, int h, int std, int channel, int qty) throws V4L4JException{
vd = new VideoDevice(dev);
fg = vd.getJPEGFrameGrabber(w, h, channel, std, qty);
}
@Override
public boolean Start() {
try { try {
while (isRecording) { if(!isRecording){
if (isRecording) { fg.startCapture();
bb = fg.getFrame(); captureThread = new Thread(this, "Capture Thread");
image = new byte[bb.limit()]; captureThread.start();
bb.get(image); isRecording = true;
CI.onNewImage(image, RecordPath, CompressionQuality);
}
} }
} catch (V4L4JException e) { } catch (V4L4JException e) {
e.printStackTrace(); e.printStackTrace();
System.out.println("Failed to capture image");
} }
}
return false;
private Object[] listV4LDeviceFiles() {
Vector<String> sdev = new Vector<String>();
File dir = new File(v4lSysfsPath);
String[] files = dir.list();
for (String file : files)
// the following test the presence of "video" in
// each file name - not very portable - relying on HAL
// would be much better ...
if (file.indexOf("video") != -1)
sdev.add("/dev/" + file);
if (sdev.size() != 0) {
CamFound = true;
}
return sdev.toArray();
}
private void initFrameGrabber(int std, int channel, int qty)
throws V4L4JException {
fg = system.get(currentdev)
.getJPEGFrameGrabber(w, h, channel, std, qty);
} }
@Override @Override
public void release() { public boolean Stopp() {
for (VideoDevice x : system) { if(isRecording){
x.releaseFrameGrabber(); fg.stopCapture();
x.release(); isRecording =false;
} // OnCapture.ZipOnStop();
} }
@Override
public boolean Start() {
if (CamFound)
try {
initFrameGrabber(0, 0, 1);
if (!isRecording) {
fg.startCapture();
captureThread = new Thread(this, "Capture Thread");
isRecording = true;
captureThread.start();
}
} catch (V4L4JException e) {
e.printStackTrace();
}
return false; return false;
} }
//returns the intern device id
@Override @Override
public boolean Stop() { public String getDeviceID(int Device) {
if (isRecording) { try {
captureThread = null; return vd.getDeviceInfo().toString();
isRecording = false; } catch (V4L4JException e) {
fg.stopCapture(); e.printStackTrace();
fg = null;
system.get(currentdev).releaseFrameGrabber();
} }
return false;
}
@Override
public String getDeviceID(int Device) {
if (CamFound)