sltv team mailing list archive
-
sltv team
-
Mailing list archive
-
Message #00017
[Branch ~sltv/sltv/trunk] Rev 13: More small GUI improviments
------------------------------------------------------------
revno: 13
committer: lucasa@xxxxxxxxx
branch nick: SLTV
timestamp: Fri 2009-10-23 21:03:31 -0200
message:
More small GUI improviments
modified:
lib/sltv.jar
sltv.jnlp
src/br/org/softwarelivre/sltv/SLTVMain.java
src/br/org/softwarelivre/sltv/SLTVPlayerGst.java
src/br/org/softwarelivre/sltv/VideoPipeline.java
--
lp:sltv
https://code.launchpad.net/~sltv/sltv/trunk
Your team sltv is subscribed to branch lp:sltv.
To unsubscribe from this branch go to https://code.launchpad.net/~sltv/sltv/trunk/+edit-subscription.
=== modified file 'lib/sltv.jar'
Binary files lib/sltv.jar 2009-10-23 15:43:07 +0000 and lib/sltv.jar 2009-10-23 23:03:31 +0000 differ
=== modified file 'sltv.jnlp'
--- sltv.jnlp 2009-10-23 03:39:08 +0000
+++ sltv.jnlp 2009-10-23 23:03:31 +0000
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.5+"
- codebase="http://localhost/"
+ codebase="http://192.168.0.133/"
href="sltv.jnlp">
<information>
=== modified file 'src/br/org/softwarelivre/sltv/SLTVMain.java'
--- src/br/org/softwarelivre/sltv/SLTVMain.java 2009-10-23 15:43:07 +0000
+++ src/br/org/softwarelivre/sltv/SLTVMain.java 2009-10-23 23:03:31 +0000
@@ -66,9 +66,10 @@
public void run() {
SLTVMain.configureLookAndFeel();
NativeSwing.initialize();
- System.setProperty("apple.awt.graphics.UseQuartz", "false");
+ //System.setProperty("apple.awt.graphics.UseQuartz", "false");
SLTVMain SLTVMain = new SLTVMain(new String[0]);
+ SLTVMain.setExtendedState(JFrame.MAXIMIZED_BOTH);
SLTVMain.setVisible(true);
SLTVMain.detectLocalIpAddresss();
System.out.println(Arrays.toString(args));
@@ -197,7 +198,7 @@
private JMenuItem getJMenuItemPlay() {
if (jMenuItemPlay == null) {
jMenuItemPlay = new JMenuItem();
- jMenuItemPlay.setText("View video");
+ jMenuItemPlay.setText("Create Video Processing Server");
jMenuItemPlay.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
playVideo(null);
@@ -210,7 +211,7 @@
private JMenuItem getJMenuItemVideoFile() {
if (jMenuItemVideoFile == null) {
jMenuItemVideoFile = new JMenuItem();
- jMenuItemVideoFile.setText("Stream File");
+ jMenuItemVideoFile.setText("Stream Video File");
jMenuItemVideoFile.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
@@ -246,14 +247,14 @@
private JMenuItem getJMenuItemCapture() {
if (jMenuItemCapture == null) {
jMenuItemCapture = new JMenuItem();
- jMenuItemCapture.setText("Create client webcam video");
+ jMenuItemCapture.setText("Capture Webcam V4L2 Video");
jMenuItemCapture.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Runnable thread = new Thread(new Runnable() {
public void run() {
String ip = JOptionPane.showInputDialog(null,
- "What is the capture server IP?", "Enter the IP",
+ "What is the IP of the video procesing server?", "Enter the IP",
JOptionPane.QUESTION_MESSAGE);
if(ip == null || ip.equals(""))
ip = LOCAL_IP_ADDRESS;
@@ -273,7 +274,8 @@
private JMenuItem getJMenuItemStorage() {
if (jMenuItemStorage == null) {
jMenuItemStorage = new JMenuItem();
- jMenuItemStorage.setText("Create storage pipeline");
+ jMenuItemStorage.setEnabled(false);
+ jMenuItemStorage.setText("Create Storage Pipeline");
jMenuItemStorage.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
Thread thread = new Thread(new Runnable() {
=== modified file 'src/br/org/softwarelivre/sltv/SLTVPlayerGst.java'
--- src/br/org/softwarelivre/sltv/SLTVPlayerGst.java 2009-10-23 15:43:07 +0000
+++ src/br/org/softwarelivre/sltv/SLTVPlayerGst.java 2009-10-23 23:03:31 +0000
@@ -18,6 +18,7 @@
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JSpinner;
import javax.swing.JSplitPane;
@@ -73,6 +74,8 @@
private JPanel jTitledPanel_VideoPreview;
private JXTaskPaneContainer jxTaskePaneContainer;
+
+ private boolean collapsed = false;
public JXTaskPaneContainer getJxPaneContainer() {
@@ -82,80 +85,113 @@
jxTaskePaneContainer.setBorder(new DropShadowBorder());
JXTaskPane tpGeneric = new JXTaskPane();
- tpGeneric.setCollapsed(true);
+ tpGeneric.setCollapsed(collapsed);
// Define o tÃtulo.
tpGeneric.setTitle("Generic");
- JCheckBox jCheckBox_StreamOutput = new JCheckBox("Stream to Icecast");
- JCheckBox jCheckBox_VideoOutput = new JCheckBox("Output local Video");
- JCheckBox jCheckBox_AudioOutput = new JCheckBox("Output local Audio");
+ JCheckBox jCheckBox_StreamOutput = new JCheckBox("Stream to Icecast", true);
+ jCheckBox_StreamOutput.setEnabled(false);
+ JCheckBox jCheckBox_VideoOutput = new JCheckBox("Output local Video", true);
+ jCheckBox_VideoOutput.setEnabled(false);
+ JCheckBox jCheckBox_AudioOutput = new JCheckBox("Output local Audio", true);
+ jCheckBox_AudioOutput.setEnabled(false);
tpGeneric.add(jCheckBox_StreamOutput);
tpGeneric.add(jCheckBox_VideoOutput);
tpGeneric.add(jCheckBox_AudioOutput);
jxTaskePaneContainer.add(tpGeneric);
JXTaskPane jxTaskPane_Audio = new JXTaskPane();
- jxTaskPane_Audio.setCollapsed(true);
+ jxTaskPane_Audio.setCollapsed(collapsed);
jxTaskPane_Audio.setTitle("Audio");
- final JSpinner jSpinner = new JSpinner(new SpinnerNumberModel(50d,0d,100d,1d));
+ final JSpinner jSpinner = new JSpinner(new SpinnerNumberModel(100d,0d,200d,2d));
jSpinner.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
Number value = (Number) jSpinner.getValue();
double v = value.doubleValue();
- double volume = v/50;
+ double volume = ((50d*v)/100);
getVideoPipeline().getAudioVolume().set("volume", volume);
- System.out.println("Audio volume: "+volume*100+"%");
+ System.out.println("Audio volume: "+v+"%");
}
});
jxTaskPane_Audio.add(createPanel("Volume", jSpinner));
- JComboBox comboBoxRate = new JComboBox(new String[] {"44,1kHz", "22,05kHz"});
+ JComboBox comboBoxRate = new JComboBox(new String[] {"22,05kHz"});
+ //comboBoxRate.setEnabled(false);
jxTaskPane_Audio.add(createPanel("Rate", comboBoxRate));
jxTaskePaneContainer.add(jxTaskPane_Audio);
+ JXTaskPane jxTaskPane_Video = new JXTaskPane();
+ jxTaskPane_Video.setCollapsed(collapsed);
+ jxTaskPane_Video.setTitle("Video");
+
+ //double defaultQuality = 20;//getVideoPipeline().getTheoraStreamQuality();
+ final JSpinner jSpinnerTheoraQuality = new JSpinner(new SpinnerNumberModel(20d,0d,63d,1d));
+ jSpinnerTheoraQuality.addChangeListener(new ChangeListener() {
+ @Override
+ public void stateChanged(ChangeEvent e) {
+ Number quality = (Number) jSpinner.getValue();
+ int q = quality.intValue();
+ getVideoPipeline().setTheoraStreamQuality(q);
+ }
+ });
+ jSpinnerTheoraQuality.setEnabled(false);
+ jxTaskPane_Video.add(createPanel("Theora Quality", jSpinnerTheoraQuality));
+
+ final JSpinner jSpinnerTheoraBitrate = new JSpinner(new SpinnerNumberModel(0,0,2000,10));
+ jSpinnerTheoraBitrate.addChangeListener(new ChangeListener() {
+ @Override
+ public void stateChanged(ChangeEvent e) {
+ Number bitrate = (Number) jSpinner.getValue();
+ int q = bitrate.intValue();
+ getVideoPipeline().setTheoraStreamBitrate(q);
+ System.out.println("Theora bitrate: "+bitrate);
+ }
+ });
+ jSpinnerTheoraBitrate.setEnabled(false);
+ jxTaskPane_Video.add(createPanel("Theora Bitrate", jSpinnerTheoraBitrate));
+
+ final JSpinner jSpinnerFPS = new JSpinner(new SpinnerNumberModel(5,0,30,1));
+ jSpinnerFPS.addChangeListener(new ChangeListener() {
+ @Override
+ public void stateChanged(ChangeEvent e) {
+ Number bitrate = (Number) jSpinner.getValue();
+ int fps = bitrate.intValue();
+ getVideoPipeline().setVideoFPS(fps);
+ System.out.println("Video frames per second: "+bitrate);
+ }
+ });
+ jSpinnerFPS.setEnabled(false);
+ jxTaskPane_Video.add(createPanel("Framerate", jSpinnerFPS));
+ JComboBox comboBoxResolution = new JComboBox(new String[] {"320x240"});
+ //comboBoxResolution.setEnabled(false);
+ jxTaskPane_Video.add(createPanel("Video Size", comboBoxResolution));
+ jxTaskePaneContainer.add(jxTaskPane_Video);
+
JXTaskPane jxTaskPane_Stream = new JXTaskPane();
- jxTaskPane_Stream.setCollapsed(true);
+ jxTaskPane_Stream.setCollapsed(collapsed);
+ jxTaskPane_Stream.setScrollOnExpand(true);
+ //jxTaskPane_Stream.set Animated(false);
jxTaskPane_Stream.setTitle("Icecast");
JTextField jtextField_IcecastIP = new JTextField();
+ jtextField_IcecastIP.setEnabled(false);
JTextField jtextField_IcecastPort = new JTextField();
+ jtextField_IcecastPort.setEnabled(false);
jxTaskPane_Stream.add(createPanel("IP", jtextField_IcecastIP));
jxTaskPane_Stream.add(createPanel("Port", jtextField_IcecastPort));
+ JTextField jtextField_MountPoint = new JTextField();
+ jtextField_MountPoint.setEnabled(false);
+ jxTaskPane_Stream.add(createPanel("Mount Point", jtextField_MountPoint));
+ JPasswordField jtextField_Password = new JPasswordField();
+ jtextField_Password.setEnabled(false);
+ jxTaskPane_Stream.add(createPanel("Password", jtextField_Password));
jxTaskePaneContainer.add(jxTaskPane_Stream);
-// JXTaskPane tpCalendario = new JXTaskPane();
-// JXMonthView monthView = new JXMonthView();
-// JXTaskPane tpSearchUrl = new JXTaskPane();
-// JLabel labelURL = new JLabel();
-// JTextField tfURL = new JTextField();
-// JButton bGo = new JButton();
- // DropShadowBorder faz parte da biblioteca SwingX.
- // Define o Ãcone.
- //tpPrincipal.setIcon(new ImageIcon(getClass().getResource("/folder_home.png")));
- // Adiciona JXHyperlink's através de subclasses de javax.swing.Action.
- //tpPrincipal.add(new IrParaHome());
- //tpPrincipal.add(new IrParaCadastroPedido());
- //tpPrincipal.add(new IrParaCadastroCompra());
- // Coloca tpPrincipal em taskPaneContainer.
-// tpCalendario.setTitle("Calendário");
- // Faz com que o JXTaskPane esteja retraÃdo.
-// tpCalendario.setCollapsed(false);
- // Adiona JXMonthView, também parte do conjunto de componentes SwingX.
-// tpCalendario.add(monthView);
-// jxTaskePaneContainer.add(tpCalendario);
- // Apenas um indicador para o UI plugável pintar diferente a área de tÃtulo do JXTaskPane.
-// tpSearchUrl.setTitle("Pesquisar na Web");
- //tpSearchUrl.setSpecial(true);
- /*
- * Componentes labelURL, tfURL e bGo adicionados em tpSearchURL
- * através da Matisse do NetBeans.
- */
- //jxTaskePaneContainer.add(tpSearchUrl);
}
return jxTaskePaneContainer;
}
private JComponent createPanel(String string, JComponent component) {
JPanel panel = new JPanel(new VerticalLayout());
- panel.setPreferredSize(new Dimension(200,25));
+ panel.setMinimumSize(new Dimension(100,50));
component.setPreferredSize(new Dimension(150,25));
JLabel label = new JLabel(string);
panel.add(label);
@@ -199,6 +235,7 @@
controlPanel.add(getBotaoTextoOverlay());
controlPanel.add(getJCheckBoxOutput());
controlPanel.setBorder(new DropShadowBorder());
+ //controlPanel.setMinimumSize(new Dimension(350,100));
}
return controlPanel;
}
@@ -296,8 +333,7 @@
if (jScrollPane == null) {
NativeSwing.initialize();
NativeComponentWrapper ncw = new NativeComponentWrapper(getVideoComponent());
- jScrollPane = new JScrollPane(ncw.createEmbeddableComponent(new NSOption[] {}));
- getVideoComponent().setMaximumSize(new Dimension(320,240));
+ jScrollPane = new JScrollPane(ncw.createEmbeddableComponent(new NSOption[] {}));
}
return jScrollPane;
}
@@ -349,11 +385,11 @@
* @return void
*/
private void initialize() {
- this.setSize(680, 350);
+ this.setSize(750, 350);
//JPanel panel = new JPanel(new BorderLayout());
JSplitPane mainPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
mainPanel.setOneTouchExpandable(true);
- mainPanel.setDividerLocation(230);
+ mainPanel.setDividerLocation(200);
mainPanel.setLeftComponent(new JScrollPane(getJxPaneContainer()));
mainPanel.setRightComponent(getJContentPane1());
//panel.add(mainPanel, BorderLayout.CENTER);
@@ -362,6 +398,7 @@
this.setClosable(true);
this.setMaximizable(true);
this.setResizable(true);
+ this.setIconifiable(true);
//this.setBorder(new DropShadowBorder());
}
=== modified file 'src/br/org/softwarelivre/sltv/VideoPipeline.java'
--- src/br/org/softwarelivre/sltv/VideoPipeline.java 2009-10-23 03:37:58 +0000
+++ src/br/org/softwarelivre/sltv/VideoPipeline.java 2009-10-23 23:03:31 +0000
@@ -50,6 +50,11 @@
private Element teeAudio;
private Element audioVolume;
private DecodeBin decodeBin;
+ private Element theoraenc;
+
+ public Element getTheoraenc() {
+ return theoraenc;
+ }
public enum SLTVEffects {
noeffect("identity"), quarktv, revtv, vertigotv, shagadelictv, warptv, dicetv, agingtv, edgetv, optv, radioactv, streaktv, rippletv;
@@ -99,7 +104,7 @@
/* only link once */
if (pad.isLinked()) {
return;
- }
+ }
/* check media type */
Caps caps = pad.getCaps();
Structure struct = caps.getStructure(0);
@@ -354,7 +359,7 @@
Element queuev = ElementFactory.make("queue", null);
// queue1.set("max-size-buffers", 1000);
// queue1.set("max-size-bytes", 100000000);
- Element theoraenc = ElementFactory.make("theoraenc", "theoraenc");
+ theoraenc = ElementFactory.make("theoraenc", "theoraenc");
theoraenc.set("quality", theoraStreamQuality);
//theoraenc.set("keyframe-force", 6);
Element vorbisenc = ElementFactory.make("vorbisenc", "vorbisenc");
@@ -610,7 +615,24 @@
}
public void setTheoraStreamQuality(int theoraStreamQuality) {
- this.theoraStreamQuality = theoraStreamQuality;
+ if(theoraStreamQuality >= 1 && theoraStreamQuality <= 63)
+ {
+ this.theoraStreamQuality = theoraStreamQuality;
+ getTheoraenc().set("quality", this.theoraStreamQuality);
+ System.out.println("Theora quality: "+theoraStreamQuality);
+ }
+ }
+
+ public void setTheoraStreamBitrate(int b) {
+ getTheoraenc().set("bitrate", b);
+ }
+
+ public void setVideoFPS(int fps) {
+ // TODO Auto-generated method stub
+ }
+
+ public int getTheoraStreamQuality() {
+ return this.theoraStreamQuality;
}
/*