[longomatch] Add support to select capture cards output format



commit 92c0e2adb53815b4bd0d9fe989471eedf139ccdf
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Feb 7 11:25:36 2015 +0100

    Add support to select capture cards output format

 LongoMatch.Core/Common/CaptureSettings.cs          |   15 +-
 LongoMatch.Core/Common/Device.cs                   |   19 +
 LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs        |   56 ++-
 .../LongoMatch.Gui.Panel.NewProjectPanel.cs        |  489 +++++++++++---------
 LongoMatch.GUI/gtk-gui/gui.stetic                  |  315 ++++++++-----
 .../Capturer/GstCameraCapturer.cs                  |   25 +-
 LongoMatch.Multimedia/LongoMatch.Multimedia.csproj |    2 +-
 LongoMatch.Multimedia/Makefile.am                  |    2 +-
 LongoMatch.Multimedia/Utils/Devices.cs             |   85 ++++
 LongoMatch.Multimedia/Utils/MultimediaFactory.cs   |    2 +-
 LongoMatch.Multimedia/Utils/VideoDevice.cs         |   60 ---
 libcesarplayer/Makefile.am                         |    2 +
 libcesarplayer/gst-camera-capturer.c               |  145 ++-----
 libcesarplayer/gst-camera-capturer.h               |    4 +
 libcesarplayer/lgm-device.c                        |  329 +++++++++++++
 libcesarplayer/lgm-device.h                        |   75 +++
 libcesarplayer/liblongomatch.cproj                 |    4 +-
 libcesarplayer/test-capturer.c                     |    3 +-
 18 files changed, 1062 insertions(+), 570 deletions(-)
---
diff --git a/LongoMatch.Core/Common/CaptureSettings.cs b/LongoMatch.Core/Common/CaptureSettings.cs
index 905b20e..fafb017 100644
--- a/LongoMatch.Core/Common/CaptureSettings.cs
+++ b/LongoMatch.Core/Common/CaptureSettings.cs
@@ -23,20 +23,9 @@ namespace LongoMatch.Core.Common
 
        public struct CaptureSettings
        {
-               public CaptureSourceType CaptureSourceType;
-               public string DeviceID;
-               public string SourceElement;
+               public Device Device;
+               public DeviceVideoFormat Format;
                public EncodingSettings EncodingSettings;
-
-               public static CaptureSettings DefaultSettings() {
-                       CaptureSettings settings = new CaptureSettings();
-                       settings.CaptureSourceType = CaptureSourceType.System;
-                       settings.EncodingSettings = new EncodingSettings(Config.CaptureVideoStandard,
-                                                                        Config.CaptureEncodingProfile,
-                                                                        Config.CaptureEncodingQuality,
-                                                                        25, 1, "", true, false, 20);
-                       return settings;
-               }
        }
        
 }
diff --git a/LongoMatch.Core/Common/Device.cs b/LongoMatch.Core/Common/Device.cs
index 23f48f3..1f8c704 100644
--- a/LongoMatch.Core/Common/Device.cs
+++ b/LongoMatch.Core/Common/Device.cs
@@ -28,6 +28,7 @@ namespace LongoMatch.Core.Common
        public class Device
        {
                public Device() {
+                       Formats = new List<DeviceVideoFormat>();
 
                }
 
@@ -52,6 +53,11 @@ namespace LongoMatch.Core.Common
                        get;
                        set;
                }
+
+               public List<DeviceVideoFormat> Formats {
+                       get;
+                       set;
+               }
                
                public string Desc  {
                        get {
@@ -59,4 +65,17 @@ namespace LongoMatch.Core.Common
                        }
                }
        }
+       
+       public struct DeviceVideoFormat {
+               public int width;
+               public int height;
+               public int fps_n;
+               public int fps_d;
+               
+               public override string ToString ()
+               {
+                       return string.Format ("{0}x{1} {2}fps", width, height,
+                                             ((double)fps_n/fps_d).ToString ("#.##"));
+               }
+       }
 }
diff --git a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
index d0f0dc1..7dc2b6d 100644
--- a/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
+++ b/LongoMatch.GUI/Gui/Panel/NewProjectPanel.cs
@@ -57,6 +57,7 @@ namespace LongoMatch.Gui.Panel
                TeamTemplate hometemplate, awaytemplate;
                Dashboard analysisTemplate;
                TeamTagger teamtagger;
+               SizeGroup sg;
 
                public NewProjectPanel (Project project)
                {
@@ -70,6 +71,7 @@ namespace LongoMatch.Gui.Panel
                        notebook1.ShowBorder = false;
                        
                        LoadIcons ();
+                       GroupLabels ();
                        ConnectSignals ();
                        FillCategories ();
                        FillFormats ();
@@ -111,7 +113,6 @@ namespace LongoMatch.Gui.Panel
                        lefttable.RowSpacing = outputfiletable.RowSpacing =
                                righttable.RowSpacing = StyleConf.NewTableHSpacing;
                        lefttable.ColumnSpacing = righttable.ColumnSpacing = StyleConf.NewTableHSpacing;
-                       outputfiletable.ColumnSpacing = StyleConf.NewTeamsSpacing; 
                        vsimage.WidthRequest = StyleConf.NewTeamsSpacing;
                        hometeamscombobox.WidthRequest = awayteamscombobox.WidthRequest = 
StyleConf.NewTeamsComboWidth;
                        hometeamscombobox.HeightRequest = awayteamscombobox.HeightRequest = 
StyleConf.NewTeamsComboHeight;
@@ -138,6 +139,17 @@ namespace LongoMatch.Gui.Panel
                        ipbutton.Clicked += HandleProjectTypeSet;
                }
 
+               void GroupLabels ()
+               {
+                       sg = new SizeGroup (SizeGroupMode.Horizontal);
+                       sg.AddWidget (urilabel);
+                       sg.AddWidget (outputfilelabel);
+                       sg.AddWidget (device);
+                       sg.AddWidget (videoformatlabel);
+                       sg.AddWidget (deviceformatlabel);
+                       sg.AddWidget (outputsizelabel);
+               }
+
                void LoadTeams (Project project)
                {
                        List<TeamTemplate> teams;
@@ -175,7 +187,9 @@ namespace LongoMatch.Gui.Panel
                        panelheader1.ApplyClicked += HandleNextClicked;
                        panelheader1.BackClicked += HandleBackClicked;
                        urientry.Changed += HandleEntryChanged;
+                       capturemediafilechooser.ChangedEvent += HandleEntryChanged;
                        tagscombobox.Changed += HandleSportsTemplateChanged;
+                       devicecombobox.Changed += HandleDeviceChanged;
                }
 
                void FillProjectDetails ()
@@ -224,13 +238,9 @@ namespace LongoMatch.Gui.Panel
                                urimode = true;
                        }
                        mediafilesetselection1.Visible = filemode;
-                       outputfiletable.Visible = capturemode || urimode;
-                       rcapturetable.Visible = capturemode || urimode;
-                       lcapturetable.Visible = capturemode || urimode;
-                       urientry.Visible = urimode;
-                       urilabel.Visible = urimode;
-                       device.Visible = capturemode;
-                       devicecombobox.Visible = capturemode;
+                       capturebox.Visible = capturemode || urimode;
+                       urltable.Visible = urimode;
+                       devicetable.Visible = capturemode;
                }
 
                void FillFormats ()
@@ -244,10 +254,16 @@ namespace LongoMatch.Gui.Panel
                public void FillDevices (List<Device> devices)
                {
                        videoDevices = devices;
+                       bool includeSourceName;
+                       
+                       includeSourceName = devices.GroupBy (d => d.SourceElement).Count() > 1;
 
                        foreach (Device device in devices) {
                                string deviceName;
                                deviceName = (device.ID == "") ? Catalog.GetString ("Unknown") : device.ID;
+                               if (includeSourceName) {
+                                       deviceName += String.Format (" ({0})", device.SourceElement);
+                               }
                                devicecombobox.AppendText (deviceName);
                                devicecombobox.Active = 0;
                        }
@@ -391,19 +407,16 @@ namespace LongoMatch.Gui.Panel
                        }
                        
                        if (projectType == ProjectType.CaptureProject) {
-                               Device device = videoDevices [devicecombobox.Active];
-                               captureSettings.CaptureSourceType = device.DeviceType;
-                               captureSettings.DeviceID = device.ID;
-                               captureSettings.SourceElement = device.SourceElement;
+                               captureSettings.Device = videoDevices [devicecombobox.Active];
+                               captureSettings.Format = 
captureSettings.Device.Formats[deviceformatcombobox.Active];
                                file.VideoHeight = encSettings.VideoStandard.Height;
                                file.VideoWidth = encSettings.VideoStandard.Width;
                        } else if (projectType == ProjectType.URICaptureProject) {
-                               captureSettings.CaptureSourceType = CaptureSourceType.URI;
-                               captureSettings.DeviceID = urientry.Text;
+                               captureSettings.Device = new Device {DeviceType = CaptureSourceType.URI,
+                                       ID = urientry.Text};
                                file.VideoHeight = encSettings.VideoStandard.Height;
                                file.VideoWidth = encSettings.VideoStandard.Width;
                        } else if (projectType == ProjectType.FakeCaptureProject) {
-                               captureSettings.CaptureSourceType = CaptureSourceType.None;
                                file.FilePath = Constants.FAKE_PROJECT;
                        }
                        return true;
@@ -428,7 +441,7 @@ namespace LongoMatch.Gui.Panel
                        } else {
                                urilabel.ModifyFg (StateType.Normal, red);
                        }
-                       if (String.IsNullOrEmpty (capturemediafilechooser.CurrentPath)) {
+                       if (!String.IsNullOrEmpty (capturemediafilechooser.CurrentPath)) {
                                outputfilelabel.ModifyFg (StateType.Normal);
                        } else {
                                outputfilelabel.ModifyFg (StateType.Normal, red);
@@ -594,6 +607,17 @@ namespace LongoMatch.Gui.Panel
                        }
                        drawingarea.QueueDraw ();
                }
+               
+               void HandleDeviceChanged (object sender, EventArgs e)
+               {
+                       Device device = videoDevices [devicecombobox.Active];
+                       ListStore store = new ListStore (typeof(string));
+                       deviceformatcombobox.Model = store;
+                       foreach (DeviceVideoFormat format in device.Formats) {
+                               deviceformatcombobox.AppendText (format.ToString ());
+                       }
+                       deviceformatcombobox.Active = 0;
+               }
        }
 }
 
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
index 067a57d..c82232b 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Panel.NewProjectPanel.cs
@@ -50,23 +50,24 @@ namespace LongoMatch.Gui.Panel
                private global::Gtk.Image vsimage;
                private global::LongoMatch.Gui.Component.AwayTeamsComboBox awayteamscombobox;
                private global::LongoMatch.Gui.Component.MediaFileSetSelection mediafilesetselection1;
+               private global::Gtk.VBox capturebox;
                private global::Gtk.Table outputfiletable;
                private global::LongoMatch.Gui.Component.MediaFileChooser capturemediafilechooser;
                private global::Gtk.Label outputfilelabel;
-               private global::Gtk.HBox hbox10;
-               private global::Gtk.Table lcapturetable;
-               private global::Gtk.HBox hbox7;
-               private global::Gtk.ComboBox devicecombobox;
+               private global::Gtk.Table urltable;
                private global::Gtk.Entry urientry;
-               private global::Gtk.HBox hbox8;
-               private global::Gtk.Label device;
                private global::Gtk.Label urilabel;
-               private global::Gtk.ComboBox imagecombobox;
-               private global::Gtk.Label sizelabel;
-               private global::Gtk.Table rcapturetable;
+               private global::Gtk.Table devicetable;
+               private global::Gtk.Label device;
+               private global::Gtk.ComboBox devicecombobox;
+               private global::Gtk.ComboBox deviceformatcombobox;
+               private global::Gtk.Label deviceformatlabel;
+               private global::Gtk.Table encpropstable;
                private global::Gtk.ComboBox encodingcombobox;
+               private global::Gtk.ComboBox imagecombobox;
+               private global::Gtk.Label outputsizelabel;
                private global::Gtk.ComboBox qualitycombobox;
-               private global::Gtk.Label qualitylabel;
+               private global::Gtk.Label qualityformatlabel;
                private global::Gtk.Label videoformatlabel;
                private global::Gtk.Table righttable;
                private global::Gtk.Label analysislabel;
@@ -76,7 +77,7 @@ namespace LongoMatch.Gui.Panel
                private global::Gtk.HBox hbox14;
                private global::Gtk.Alignment homealignment;
                private global::Gtk.HBox hbox16;
-               private global::Gtk.Label label8;
+               private global::Gtk.Label label11;
                private global::Gtk.Entry hometacticsentry;
                private global::Gtk.Button hometacticsbutton;
                private global::Gtk.ToggleButton homecolor1button;
@@ -85,7 +86,7 @@ namespace LongoMatch.Gui.Panel
                private global::Gtk.DrawingArea homecolor2;
                private global::Gtk.Alignment awayalignment;
                private global::Gtk.HBox hbox17;
-               private global::Gtk.Label label9;
+               private global::Gtk.Label label12;
                private global::Gtk.Entry awaytacticsentry;
                private global::Gtk.Button awaytacticsbutton;
                private global::Gtk.ToggleButton awaycolor1button;
@@ -93,9 +94,9 @@ namespace LongoMatch.Gui.Panel
                private global::Gtk.ToggleButton awaycolor2button;
                private global::Gtk.DrawingArea awaycolor2;
                private global::Gtk.DrawingArea drawingarea;
-               private global::Gtk.Label label3;
+               private global::Gtk.Label label13;
                private global::LongoMatch.Gui.Component.ProjectPeriods projectperiods1;
-               private global::Gtk.Label label7;
+               private global::Gtk.Label label14;
 
                protected virtual void Build ()
                {
@@ -460,6 +461,10 @@ namespace LongoMatch.Gui.Panel
                        w39.Expand = false;
                        w39.Fill = false;
                        // Container child centerbox.Gtk.Box+BoxChild
+                       this.capturebox = new global::Gtk.VBox ();
+                       this.capturebox.Name = "capturebox";
+                       this.capturebox.Spacing = 6;
+                       // Container child capturebox.Gtk.Box+BoxChild
                        this.outputfiletable = new global::Gtk.Table (((uint)(1)), ((uint)(2)), false);
                        this.outputfiletable.Name = "outputfiletable";
                        this.outputfiletable.RowSpacing = ((uint)(6));
@@ -476,149 +481,174 @@ namespace LongoMatch.Gui.Panel
                        // Container child outputfiletable.Gtk.Table+TableChild
                        this.outputfilelabel = new global::Gtk.Label ();
                        this.outputfilelabel.Name = "outputfilelabel";
+                       this.outputfilelabel.Xalign = 1F;
                        this.outputfilelabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Output file");
                        this.outputfiletable.Add (this.outputfilelabel);
                        global::Gtk.Table.TableChild w41 = 
((global::Gtk.Table.TableChild)(this.outputfiletable [this.outputfilelabel]));
                        w41.XOptions = ((global::Gtk.AttachOptions)(4));
                        w41.YOptions = ((global::Gtk.AttachOptions)(4));
-                       this.centerbox.Add (this.outputfiletable);
-                       global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.centerbox 
[this.outputfiletable]));
-                       w42.Position = 2;
+                       this.capturebox.Add (this.outputfiletable);
+                       global::Gtk.Box.BoxChild w42 = ((global::Gtk.Box.BoxChild)(this.capturebox 
[this.outputfiletable]));
+                       w42.Position = 0;
                        w42.Expand = false;
                        w42.Fill = false;
-                       // Container child centerbox.Gtk.Box+BoxChild
-                       this.hbox10 = new global::Gtk.HBox ();
-                       this.hbox10.Name = "hbox10";
-                       this.hbox10.Homogeneous = true;
-                       this.hbox10.Spacing = 6;
-                       // Container child hbox10.Gtk.Box+BoxChild
-                       this.lcapturetable = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false);
-                       this.lcapturetable.Name = "lcapturetable";
-                       this.lcapturetable.RowSpacing = ((uint)(6));
-                       this.lcapturetable.ColumnSpacing = ((uint)(6));
-                       // Container child lcapturetable.Gtk.Table+TableChild
-                       this.hbox7 = new global::Gtk.HBox ();
-                       this.hbox7.Name = "hbox7";
-                       this.hbox7.Spacing = 6;
-                       // Container child hbox7.Gtk.Box+BoxChild
-                       this.devicecombobox = global::Gtk.ComboBox.NewText ();
-                       this.devicecombobox.Name = "devicecombobox";
-                       this.hbox7.Add (this.devicecombobox);
-                       global::Gtk.Box.BoxChild w43 = ((global::Gtk.Box.BoxChild)(this.hbox7 
[this.devicecombobox]));
-                       w43.Position = 0;
-                       // Container child hbox7.Gtk.Box+BoxChild
+                       // Container child capturebox.Gtk.Box+BoxChild
+                       this.urltable = new global::Gtk.Table (((uint)(1)), ((uint)(2)), false);
+                       this.urltable.Name = "urltable";
+                       this.urltable.RowSpacing = ((uint)(6));
+                       this.urltable.ColumnSpacing = ((uint)(6));
+                       // Container child urltable.Gtk.Table+TableChild
                        this.urientry = new global::Gtk.Entry ();
                        this.urientry.CanFocus = true;
                        this.urientry.Name = "urientry";
                        this.urientry.IsEditable = true;
                        this.urientry.InvisibleChar = '•';
-                       this.hbox7.Add (this.urientry);
-                       global::Gtk.Box.BoxChild w44 = ((global::Gtk.Box.BoxChild)(this.hbox7 
[this.urientry]));
-                       w44.Position = 1;
-                       this.lcapturetable.Add (this.hbox7);
-                       global::Gtk.Table.TableChild w45 = ((global::Gtk.Table.TableChild)(this.lcapturetable 
[this.hbox7]));
-                       w45.LeftAttach = ((uint)(1));
-                       w45.RightAttach = ((uint)(2));
-                       w45.YOptions = ((global::Gtk.AttachOptions)(4));
-                       // Container child lcapturetable.Gtk.Table+TableChild
-                       this.hbox8 = new global::Gtk.HBox ();
-                       this.hbox8.Name = "hbox8";
-                       this.hbox8.Spacing = 6;
-                       // Container child hbox8.Gtk.Box+BoxChild
-                       this.device = new global::Gtk.Label ();
-                       this.device.Name = "device";
-                       this.device.LabelProp = global::Mono.Unix.Catalog.GetString ("Device");
-                       this.hbox8.Add (this.device);
-                       global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.hbox8 [this.device]));
-                       w46.Position = 0;
-                       // Container child hbox8.Gtk.Box+BoxChild
+                       this.urltable.Add (this.urientry);
+                       global::Gtk.Table.TableChild w43 = ((global::Gtk.Table.TableChild)(this.urltable 
[this.urientry]));
+                       w43.LeftAttach = ((uint)(1));
+                       w43.RightAttach = ((uint)(2));
+                       w43.YOptions = ((global::Gtk.AttachOptions)(4));
+                       // Container child urltable.Gtk.Table+TableChild
                        this.urilabel = new global::Gtk.Label ();
                        this.urilabel.Name = "urilabel";
+                       this.urilabel.Xalign = 1F;
                        this.urilabel.LabelProp = global::Mono.Unix.Catalog.GetString ("URL");
-                       this.hbox8.Add (this.urilabel);
-                       global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.hbox8 
[this.urilabel]));
-                       w47.Position = 1;
-                       this.lcapturetable.Add (this.hbox8);
-                       global::Gtk.Table.TableChild w48 = ((global::Gtk.Table.TableChild)(this.lcapturetable 
[this.hbox8]));
+                       this.urltable.Add (this.urilabel);
+                       global::Gtk.Table.TableChild w44 = ((global::Gtk.Table.TableChild)(this.urltable 
[this.urilabel]));
+                       w44.XOptions = ((global::Gtk.AttachOptions)(4));
+                       w44.YOptions = ((global::Gtk.AttachOptions)(4));
+                       this.capturebox.Add (this.urltable);
+                       global::Gtk.Box.BoxChild w45 = ((global::Gtk.Box.BoxChild)(this.capturebox 
[this.urltable]));
+                       w45.Position = 1;
+                       w45.Expand = false;
+                       w45.Fill = false;
+                       // Container child capturebox.Gtk.Box+BoxChild
+                       this.devicetable = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false);
+                       this.devicetable.Name = "devicetable";
+                       this.devicetable.RowSpacing = ((uint)(6));
+                       this.devicetable.ColumnSpacing = ((uint)(6));
+                       // Container child devicetable.Gtk.Table+TableChild
+                       this.device = new global::Gtk.Label ();
+                       this.device.Name = "device";
+                       this.device.Xalign = 1F;
+                       this.device.LabelProp = global::Mono.Unix.Catalog.GetString ("Device");
+                       this.devicetable.Add (this.device);
+                       global::Gtk.Table.TableChild w46 = ((global::Gtk.Table.TableChild)(this.devicetable 
[this.device]));
+                       w46.XOptions = ((global::Gtk.AttachOptions)(4));
+                       w46.YOptions = ((global::Gtk.AttachOptions)(4));
+                       // Container child devicetable.Gtk.Table+TableChild
+                       this.devicecombobox = global::Gtk.ComboBox.NewText ();
+                       this.devicecombobox.WidthRequest = 300;
+                       this.devicecombobox.Name = "devicecombobox";
+                       this.devicetable.Add (this.devicecombobox);
+                       global::Gtk.Table.TableChild w47 = ((global::Gtk.Table.TableChild)(this.devicetable 
[this.devicecombobox]));
+                       w47.LeftAttach = ((uint)(1));
+                       w47.RightAttach = ((uint)(2));
+                       w47.YOptions = ((global::Gtk.AttachOptions)(4));
+                       // Container child devicetable.Gtk.Table+TableChild
+                       this.deviceformatcombobox = global::Gtk.ComboBox.NewText ();
+                       this.deviceformatcombobox.Name = "deviceformatcombobox";
+                       this.devicetable.Add (this.deviceformatcombobox);
+                       global::Gtk.Table.TableChild w48 = ((global::Gtk.Table.TableChild)(this.devicetable 
[this.deviceformatcombobox]));
+                       w48.TopAttach = ((uint)(1));
+                       w48.BottomAttach = ((uint)(2));
+                       w48.LeftAttach = ((uint)(1));
+                       w48.RightAttach = ((uint)(2));
                        w48.XOptions = ((global::Gtk.AttachOptions)(4));
                        w48.YOptions = ((global::Gtk.AttachOptions)(4));
-                       // Container child lcapturetable.Gtk.Table+TableChild
-                       this.imagecombobox = global::Gtk.ComboBox.NewText ();
-                       this.imagecombobox.Name = "imagecombobox";
-                       this.lcapturetable.Add (this.imagecombobox);
-                       global::Gtk.Table.TableChild w49 = ((global::Gtk.Table.TableChild)(this.lcapturetable 
[this.imagecombobox]));
+                       // Container child devicetable.Gtk.Table+TableChild
+                       this.deviceformatlabel = new global::Gtk.Label ();
+                       this.deviceformatlabel.Name = "deviceformatlabel";
+                       this.deviceformatlabel.Xalign = 1F;
+                       this.deviceformatlabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Device 
format");
+                       this.devicetable.Add (this.deviceformatlabel);
+                       global::Gtk.Table.TableChild w49 = ((global::Gtk.Table.TableChild)(this.devicetable 
[this.deviceformatlabel]));
                        w49.TopAttach = ((uint)(1));
                        w49.BottomAttach = ((uint)(2));
-                       w49.LeftAttach = ((uint)(1));
-                       w49.RightAttach = ((uint)(2));
                        w49.XOptions = ((global::Gtk.AttachOptions)(4));
                        w49.YOptions = ((global::Gtk.AttachOptions)(4));
-                       // Container child lcapturetable.Gtk.Table+TableChild
-                       this.sizelabel = new global::Gtk.Label ();
-                       this.sizelabel.Name = "sizelabel";
-                       this.sizelabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Size");
-                       this.lcapturetable.Add (this.sizelabel);
-                       global::Gtk.Table.TableChild w50 = ((global::Gtk.Table.TableChild)(this.lcapturetable 
[this.sizelabel]));
-                       w50.TopAttach = ((uint)(1));
-                       w50.BottomAttach = ((uint)(2));
-                       w50.XOptions = ((global::Gtk.AttachOptions)(4));
-                       w50.YOptions = ((global::Gtk.AttachOptions)(4));
-                       this.hbox10.Add (this.lcapturetable);
-                       global::Gtk.Box.BoxChild w51 = ((global::Gtk.Box.BoxChild)(this.hbox10 
[this.lcapturetable]));
-                       w51.Position = 0;
-                       // Container child hbox10.Gtk.Box+BoxChild
-                       this.rcapturetable = new global::Gtk.Table (((uint)(2)), ((uint)(2)), false);
-                       this.rcapturetable.Name = "rcapturetable";
-                       this.rcapturetable.RowSpacing = ((uint)(6));
-                       this.rcapturetable.ColumnSpacing = ((uint)(6));
-                       // Container child rcapturetable.Gtk.Table+TableChild
+                       this.capturebox.Add (this.devicetable);
+                       global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.capturebox 
[this.devicetable]));
+                       w50.Position = 2;
+                       w50.Expand = false;
+                       w50.Fill = false;
+                       // Container child capturebox.Gtk.Box+BoxChild
+                       this.encpropstable = new global::Gtk.Table (((uint)(2)), ((uint)(4)), false);
+                       this.encpropstable.Name = "encpropstable";
+                       this.encpropstable.RowSpacing = ((uint)(6));
+                       this.encpropstable.ColumnSpacing = ((uint)(6));
+                       // Container child encpropstable.Gtk.Table+TableChild
                        this.encodingcombobox = global::Gtk.ComboBox.NewText ();
                        this.encodingcombobox.Name = "encodingcombobox";
-                       this.rcapturetable.Add (this.encodingcombobox);
-                       global::Gtk.Table.TableChild w52 = ((global::Gtk.Table.TableChild)(this.rcapturetable 
[this.encodingcombobox]));
+                       this.encpropstable.Add (this.encodingcombobox);
+                       global::Gtk.Table.TableChild w51 = ((global::Gtk.Table.TableChild)(this.encpropstable 
[this.encodingcombobox]));
+                       w51.LeftAttach = ((uint)(1));
+                       w51.RightAttach = ((uint)(2));
+                       w51.YOptions = ((global::Gtk.AttachOptions)(4));
+                       // Container child encpropstable.Gtk.Table+TableChild
+                       this.imagecombobox = global::Gtk.ComboBox.NewText ();
+                       this.imagecombobox.Name = "imagecombobox";
+                       this.encpropstable.Add (this.imagecombobox);
+                       global::Gtk.Table.TableChild w52 = ((global::Gtk.Table.TableChild)(this.encpropstable 
[this.imagecombobox]));
+                       w52.TopAttach = ((uint)(1));
+                       w52.BottomAttach = ((uint)(2));
                        w52.LeftAttach = ((uint)(1));
                        w52.RightAttach = ((uint)(2));
+                       w52.XOptions = ((global::Gtk.AttachOptions)(4));
                        w52.YOptions = ((global::Gtk.AttachOptions)(4));
-                       // Container child rcapturetable.Gtk.Table+TableChild
-                       this.qualitycombobox = global::Gtk.ComboBox.NewText ();
-                       this.qualitycombobox.Name = "qualitycombobox";
-                       this.rcapturetable.Add (this.qualitycombobox);
-                       global::Gtk.Table.TableChild w53 = ((global::Gtk.Table.TableChild)(this.rcapturetable 
[this.qualitycombobox]));
+                       // Container child encpropstable.Gtk.Table+TableChild
+                       this.outputsizelabel = new global::Gtk.Label ();
+                       this.outputsizelabel.Name = "outputsizelabel";
+                       this.outputsizelabel.Xalign = 1F;
+                       this.outputsizelabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Output size");
+                       this.encpropstable.Add (this.outputsizelabel);
+                       global::Gtk.Table.TableChild w53 = ((global::Gtk.Table.TableChild)(this.encpropstable 
[this.outputsizelabel]));
                        w53.TopAttach = ((uint)(1));
                        w53.BottomAttach = ((uint)(2));
-                       w53.LeftAttach = ((uint)(1));
-                       w53.RightAttach = ((uint)(2));
+                       w53.XOptions = ((global::Gtk.AttachOptions)(4));
                        w53.YOptions = ((global::Gtk.AttachOptions)(4));
-                       // Container child rcapturetable.Gtk.Table+TableChild
-                       this.qualitylabel = new global::Gtk.Label ();
-                       this.qualitylabel.Name = "qualitylabel";
-                       this.qualitylabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Quality");
-                       this.rcapturetable.Add (this.qualitylabel);
-                       global::Gtk.Table.TableChild w54 = ((global::Gtk.Table.TableChild)(this.rcapturetable 
[this.qualitylabel]));
-                       w54.TopAttach = ((uint)(1));
-                       w54.BottomAttach = ((uint)(2));
-                       w54.XOptions = ((global::Gtk.AttachOptions)(4));
+                       // Container child encpropstable.Gtk.Table+TableChild
+                       this.qualitycombobox = global::Gtk.ComboBox.NewText ();
+                       this.qualitycombobox.Name = "qualitycombobox";
+                       this.encpropstable.Add (this.qualitycombobox);
+                       global::Gtk.Table.TableChild w54 = ((global::Gtk.Table.TableChild)(this.encpropstable 
[this.qualitycombobox]));
+                       w54.LeftAttach = ((uint)(3));
+                       w54.RightAttach = ((uint)(4));
                        w54.YOptions = ((global::Gtk.AttachOptions)(4));
-                       // Container child rcapturetable.Gtk.Table+TableChild
+                       // Container child encpropstable.Gtk.Table+TableChild
+                       this.qualityformatlabel = new global::Gtk.Label ();
+                       this.qualityformatlabel.Name = "qualityformatlabel";
+                       this.qualityformatlabel.Xalign = 1F;
+                       this.qualityformatlabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Quality");
+                       this.encpropstable.Add (this.qualityformatlabel);
+                       global::Gtk.Table.TableChild w55 = ((global::Gtk.Table.TableChild)(this.encpropstable 
[this.qualityformatlabel]));
+                       w55.LeftAttach = ((uint)(2));
+                       w55.RightAttach = ((uint)(3));
+                       w55.XOptions = ((global::Gtk.AttachOptions)(4));
+                       w55.YOptions = ((global::Gtk.AttachOptions)(4));
+                       // Container child encpropstable.Gtk.Table+TableChild
                        this.videoformatlabel = new global::Gtk.Label ();
                        this.videoformatlabel.Name = "videoformatlabel";
+                       this.videoformatlabel.Xalign = 1F;
                        this.videoformatlabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Format");
-                       this.rcapturetable.Add (this.videoformatlabel);
-                       global::Gtk.Table.TableChild w55 = ((global::Gtk.Table.TableChild)(this.rcapturetable 
[this.videoformatlabel]));
-                       w55.XOptions = ((global::Gtk.AttachOptions)(4));
-                       w55.YOptions = ((global::Gtk.AttachOptions)(4));
-                       this.hbox10.Add (this.rcapturetable);
-                       global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.hbox10 
[this.rcapturetable]));
-                       w56.Position = 1;
-                       this.centerbox.Add (this.hbox10);
-                       global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.centerbox 
[this.hbox10]));
+                       this.encpropstable.Add (this.videoformatlabel);
+                       global::Gtk.Table.TableChild w56 = ((global::Gtk.Table.TableChild)(this.encpropstable 
[this.videoformatlabel]));
+                       w56.XOptions = ((global::Gtk.AttachOptions)(4));
+                       w56.YOptions = ((global::Gtk.AttachOptions)(4));
+                       this.capturebox.Add (this.encpropstable);
+                       global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.capturebox 
[this.encpropstable]));
                        w57.Position = 3;
                        w57.Expand = false;
                        w57.Fill = false;
-                       this.topbox.Add (this.centerbox);
-                       global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.topbox 
[this.centerbox]));
-                       w58.Position = 1;
+                       this.centerbox.Add (this.capturebox);
+                       global::Gtk.Box.BoxChild w58 = ((global::Gtk.Box.BoxChild)(this.centerbox 
[this.capturebox]));
+                       w58.Position = 2;
+                       w58.Expand = false;
                        w58.Fill = false;
+                       this.topbox.Add (this.centerbox);
+                       global::Gtk.Box.BoxChild w59 = ((global::Gtk.Box.BoxChild)(this.topbox 
[this.centerbox]));
+                       w59.Position = 1;
+                       w59.Fill = false;
                        // Container child topbox.Gtk.Box+BoxChild
                        this.righttable = new global::Gtk.Table (((uint)(1)), ((uint)(2)), false);
                        this.righttable.Name = "righttable";
@@ -629,28 +659,28 @@ namespace LongoMatch.Gui.Panel
                        this.analysislabel.Name = "analysislabel";
                        this.analysislabel.LabelProp = global::Mono.Unix.Catalog.GetString ("Dashboard");
                        this.righttable.Add (this.analysislabel);
-                       global::Gtk.Table.TableChild w59 = ((global::Gtk.Table.TableChild)(this.righttable 
[this.analysislabel]));
-                       w59.XOptions = ((global::Gtk.AttachOptions)(4));
-                       w59.YOptions = ((global::Gtk.AttachOptions)(0));
+                       global::Gtk.Table.TableChild w60 = ((global::Gtk.Table.TableChild)(this.righttable 
[this.analysislabel]));
+                       w60.XOptions = ((global::Gtk.AttachOptions)(4));
+                       w60.YOptions = ((global::Gtk.AttachOptions)(0));
                        // Container child righttable.Gtk.Table+TableChild
                        this.tagscombobox = global::Gtk.ComboBox.NewText ();
                        this.tagscombobox.Name = "tagscombobox";
                        this.righttable.Add (this.tagscombobox);
-                       global::Gtk.Table.TableChild w60 = ((global::Gtk.Table.TableChild)(this.righttable 
[this.tagscombobox]));
-                       w60.LeftAttach = ((uint)(1));
-                       w60.RightAttach = ((uint)(2));
-                       w60.YOptions = ((global::Gtk.AttachOptions)(0));
+                       global::Gtk.Table.TableChild w61 = ((global::Gtk.Table.TableChild)(this.righttable 
[this.tagscombobox]));
+                       w61.LeftAttach = ((uint)(1));
+                       w61.RightAttach = ((uint)(2));
+                       w61.YOptions = ((global::Gtk.AttachOptions)(0));
                        this.topbox.Add (this.righttable);
-                       global::Gtk.Box.BoxChild w61 = ((global::Gtk.Box.BoxChild)(this.topbox 
[this.righttable]));
-                       w61.Position = 2;
-                       w61.Expand = false;
-                       w61.Fill = false;
+                       global::Gtk.Box.BoxChild w62 = ((global::Gtk.Box.BoxChild)(this.topbox 
[this.righttable]));
+                       w62.Position = 2;
+                       w62.Expand = false;
+                       w62.Fill = false;
                        this.alignment1.Add (this.topbox);
                        this.vbox5.Add (this.alignment1);
-                       global::Gtk.Box.BoxChild w63 = ((global::Gtk.Box.BoxChild)(this.vbox5 
[this.alignment1]));
-                       w63.Position = 0;
-                       w63.Expand = false;
-                       w63.Fill = false;
+                       global::Gtk.Box.BoxChild w64 = ((global::Gtk.Box.BoxChild)(this.vbox5 
[this.alignment1]));
+                       w64.Position = 0;
+                       w64.Expand = false;
+                       w64.Fill = false;
                        // Container child vbox5.Gtk.Box+BoxChild
                        this.vbox6 = new global::Gtk.VBox ();
                        this.vbox6.Name = "vbox6";
@@ -659,10 +689,10 @@ namespace LongoMatch.Gui.Panel
                        this.hseparator1 = new global::Gtk.HSeparator ();
                        this.hseparator1.Name = "hseparator1";
                        this.vbox6.Add (this.hseparator1);
-                       global::Gtk.Box.BoxChild w64 = ((global::Gtk.Box.BoxChild)(this.vbox6 
[this.hseparator1]));
-                       w64.Position = 0;
-                       w64.Expand = false;
-                       w64.Fill = false;
+                       global::Gtk.Box.BoxChild w65 = ((global::Gtk.Box.BoxChild)(this.vbox6 
[this.hseparator1]));
+                       w65.Position = 0;
+                       w65.Expand = false;
+                       w65.Fill = false;
                        // Container child vbox6.Gtk.Box+BoxChild
                        this.hbox14 = new global::Gtk.HBox ();
                        this.hbox14.Name = "hbox14";
@@ -675,14 +705,14 @@ namespace LongoMatch.Gui.Panel
                        this.hbox16.Name = "hbox16";
                        this.hbox16.Spacing = 6;
                        // Container child hbox16.Gtk.Box+BoxChild
-                       this.label8 = new global::Gtk.Label ();
-                       this.label8.Name = "label8";
-                       this.label8.LabelProp = global::Mono.Unix.Catalog.GetString ("Tactics");
-                       this.hbox16.Add (this.label8);
-                       global::Gtk.Box.BoxChild w65 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.label8]));
-                       w65.Position = 0;
-                       w65.Expand = false;
-                       w65.Fill = false;
+                       this.label11 = new global::Gtk.Label ();
+                       this.label11.Name = "label11";
+                       this.label11.LabelProp = global::Mono.Unix.Catalog.GetString ("Tactics");
+                       this.hbox16.Add (this.label11);
+                       global::Gtk.Box.BoxChild w66 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.label11]));
+                       w66.Position = 0;
+                       w66.Expand = false;
+                       w66.Fill = false;
                        // Container child hbox16.Gtk.Box+BoxChild
                        this.hometacticsentry = new global::Gtk.Entry ();
                        this.hometacticsentry.CanFocus = true;
@@ -690,33 +720,34 @@ namespace LongoMatch.Gui.Panel
                        this.hometacticsentry.IsEditable = true;
                        this.hometacticsentry.InvisibleChar = '•';
                        this.hbox16.Add (this.hometacticsentry);
-                       global::Gtk.Box.BoxChild w66 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.hometacticsentry]));
-                       w66.Position = 1;
-                       w66.Expand = false;
+                       global::Gtk.Box.BoxChild w67 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.hometacticsentry]));
+                       w67.Position = 1;
+                       w67.Expand = false;
                        // Container child hbox16.Gtk.Box+BoxChild
                        this.hometacticsbutton = new global::Gtk.Button ();
                        this.hometacticsbutton.CanFocus = true;
                        this.hometacticsbutton.Name = "hometacticsbutton";
                        this.hometacticsbutton.UseUnderline = true;
                        // Container child hometacticsbutton.Gtk.Container+ContainerChild
-                       global::Gtk.Alignment w67 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+                       global::Gtk.Alignment w68 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
                        // Container child GtkAlignment.Gtk.Container+ContainerChild
-                       global::Gtk.HBox w68 = new global::Gtk.HBox ();
-                       w68.Spacing = 2;
+                       global::Gtk.HBox w69 = new global::Gtk.HBox ();
+                       w69.Spacing = 2;
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Image w69 = new global::Gtk.Image ();
-                       w69.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", 
global::Gtk.IconSize.Menu);
-                       w68.Add (w69);
+                       global::Gtk.Image w70 = new global::Gtk.Image ();
+                       w70.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", 
global::Gtk.IconSize.Menu);
+                       w69.Add (w70);
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Label w71 = new global::Gtk.Label ();
-                       w68.Add (w71);
-                       w67.Add (w68);
-                       this.hometacticsbutton.Add (w67);
+                       global::Gtk.Label w72 = new global::Gtk.Label ();
+                       w72.LabelProp = "";
+                       w69.Add (w72);
+                       w68.Add (w69);
+                       this.hometacticsbutton.Add (w68);
                        this.hbox16.Add (this.hometacticsbutton);
-                       global::Gtk.Box.BoxChild w75 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.hometacticsbutton]));
-                       w75.Position = 2;
-                       w75.Expand = false;
-                       w75.Fill = false;
+                       global::Gtk.Box.BoxChild w76 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.hometacticsbutton]));
+                       w76.Position = 2;
+                       w76.Expand = false;
+                       w76.Fill = false;
                        // Container child hbox16.Gtk.Box+BoxChild
                        this.homecolor1button = new global::Gtk.ToggleButton ();
                        this.homecolor1button.WidthRequest = 30;
@@ -728,8 +759,8 @@ namespace LongoMatch.Gui.Panel
                        this.homecolor1button.Add (this.homecolor1);
                        this.homecolor1button.Label = null;
                        this.hbox16.Add (this.homecolor1button);
-                       global::Gtk.Box.BoxChild w77 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.homecolor1button]));
-                       w77.Position = 3;
+                       global::Gtk.Box.BoxChild w78 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.homecolor1button]));
+                       w78.Position = 3;
                        // Container child hbox16.Gtk.Box+BoxChild
                        this.homecolor2button = new global::Gtk.ToggleButton ();
                        this.homecolor2button.WidthRequest = 30;
@@ -741,12 +772,12 @@ namespace LongoMatch.Gui.Panel
                        this.homecolor2button.Add (this.homecolor2);
                        this.homecolor2button.Label = null;
                        this.hbox16.Add (this.homecolor2button);
-                       global::Gtk.Box.BoxChild w79 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.homecolor2button]));
-                       w79.Position = 4;
+                       global::Gtk.Box.BoxChild w80 = ((global::Gtk.Box.BoxChild)(this.hbox16 
[this.homecolor2button]));
+                       w80.Position = 4;
                        this.homealignment.Add (this.hbox16);
                        this.hbox14.Add (this.homealignment);
-                       global::Gtk.Box.BoxChild w81 = ((global::Gtk.Box.BoxChild)(this.hbox14 
[this.homealignment]));
-                       w81.Position = 0;
+                       global::Gtk.Box.BoxChild w82 = ((global::Gtk.Box.BoxChild)(this.hbox14 
[this.homealignment]));
+                       w82.Position = 0;
                        // Container child hbox14.Gtk.Box+BoxChild
                        this.awayalignment = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 1F);
                        this.awayalignment.Name = "awayalignment";
@@ -755,14 +786,14 @@ namespace LongoMatch.Gui.Panel
                        this.hbox17.Name = "hbox17";
                        this.hbox17.Spacing = 6;
                        // Container child hbox17.Gtk.Box+BoxChild
-                       this.label9 = new global::Gtk.Label ();
-                       this.label9.Name = "label9";
-                       this.label9.LabelProp = global::Mono.Unix.Catalog.GetString ("Tactics");
-                       this.hbox17.Add (this.label9);
-                       global::Gtk.Box.BoxChild w82 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.label9]));
-                       w82.Position = 0;
-                       w82.Expand = false;
-                       w82.Fill = false;
+                       this.label12 = new global::Gtk.Label ();
+                       this.label12.Name = "label12";
+                       this.label12.LabelProp = global::Mono.Unix.Catalog.GetString ("Tactics");
+                       this.hbox17.Add (this.label12);
+                       global::Gtk.Box.BoxChild w83 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.label12]));
+                       w83.Position = 0;
+                       w83.Expand = false;
+                       w83.Fill = false;
                        // Container child hbox17.Gtk.Box+BoxChild
                        this.awaytacticsentry = new global::Gtk.Entry ();
                        this.awaytacticsentry.CanFocus = true;
@@ -770,33 +801,34 @@ namespace LongoMatch.Gui.Panel
                        this.awaytacticsentry.IsEditable = true;
                        this.awaytacticsentry.InvisibleChar = '•';
                        this.hbox17.Add (this.awaytacticsentry);
-                       global::Gtk.Box.BoxChild w83 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaytacticsentry]));
-                       w83.Position = 1;
-                       w83.Expand = false;
+                       global::Gtk.Box.BoxChild w84 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaytacticsentry]));
+                       w84.Position = 1;
+                       w84.Expand = false;
                        // Container child hbox17.Gtk.Box+BoxChild
                        this.awaytacticsbutton = new global::Gtk.Button ();
                        this.awaytacticsbutton.CanFocus = true;
                        this.awaytacticsbutton.Name = "awaytacticsbutton";
                        this.awaytacticsbutton.UseUnderline = true;
                        // Container child awaytacticsbutton.Gtk.Container+ContainerChild
-                       global::Gtk.Alignment w84 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
+                       global::Gtk.Alignment w85 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
                        // Container child GtkAlignment.Gtk.Container+ContainerChild
-                       global::Gtk.HBox w85 = new global::Gtk.HBox ();
-                       w85.Spacing = 2;
+                       global::Gtk.HBox w86 = new global::Gtk.HBox ();
+                       w86.Spacing = 2;
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Image w86 = new global::Gtk.Image ();
-                       w86.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", 
global::Gtk.IconSize.Menu);
-                       w85.Add (w86);
+                       global::Gtk.Image w87 = new global::Gtk.Image ();
+                       w87.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-apply", 
global::Gtk.IconSize.Menu);
+                       w86.Add (w87);
                        // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Label w88 = new global::Gtk.Label ();
-                       w85.Add (w88);
-                       w84.Add (w85);
-                       this.awaytacticsbutton.Add (w84);
+                       global::Gtk.Label w89 = new global::Gtk.Label ();
+                       w89.LabelProp = "";
+                       w86.Add (w89);
+                       w85.Add (w86);
+                       this.awaytacticsbutton.Add (w85);
                        this.hbox17.Add (this.awaytacticsbutton);
-                       global::Gtk.Box.BoxChild w92 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaytacticsbutton]));
-                       w92.Position = 2;
-                       w92.Expand = false;
-                       w92.Fill = false;
+                       global::Gtk.Box.BoxChild w93 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaytacticsbutton]));
+                       w93.Position = 2;
+                       w93.Expand = false;
+                       w93.Fill = false;
                        // Container child hbox17.Gtk.Box+BoxChild
                        this.awaycolor1button = new global::Gtk.ToggleButton ();
                        this.awaycolor1button.WidthRequest = 30;
@@ -808,8 +840,8 @@ namespace LongoMatch.Gui.Panel
                        this.awaycolor1button.Add (this.awaycolor1);
                        this.awaycolor1button.Label = null;
                        this.hbox17.Add (this.awaycolor1button);
-                       global::Gtk.Box.BoxChild w94 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaycolor1button]));
-                       w94.Position = 3;
+                       global::Gtk.Box.BoxChild w95 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaycolor1button]));
+                       w95.Position = 3;
                        // Container child hbox17.Gtk.Box+BoxChild
                        this.awaycolor2button = new global::Gtk.ToggleButton ();
                        this.awaycolor2button.WidthRequest = 30;
@@ -821,61 +853,56 @@ namespace LongoMatch.Gui.Panel
                        this.awaycolor2button.Add (this.awaycolor2);
                        this.awaycolor2button.Label = null;
                        this.hbox17.Add (this.awaycolor2button);
-                       global::Gtk.Box.BoxChild w96 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaycolor2button]));
-                       w96.Position = 4;
+                       global::Gtk.Box.BoxChild w97 = ((global::Gtk.Box.BoxChild)(this.hbox17 
[this.awaycolor2button]));
+                       w97.Position = 4;
                        this.awayalignment.Add (this.hbox17);
                        this.hbox14.Add (this.awayalignment);
-                       global::Gtk.Box.BoxChild w98 = ((global::Gtk.Box.BoxChild)(this.hbox14 
[this.awayalignment]));
-                       w98.Position = 1;
-                       this.vbox6.Add (this.hbox14);
-                       global::Gtk.Box.BoxChild w99 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox14]));
+                       global::Gtk.Box.BoxChild w99 = ((global::Gtk.Box.BoxChild)(this.hbox14 
[this.awayalignment]));
                        w99.Position = 1;
-                       w99.Expand = false;
+                       this.vbox6.Add (this.hbox14);
+                       global::Gtk.Box.BoxChild w100 = ((global::Gtk.Box.BoxChild)(this.vbox6 
[this.hbox14]));
+                       w100.Position = 1;
+                       w100.Expand = false;
                        // Container child vbox6.Gtk.Box+BoxChild
                        this.drawingarea = new global::Gtk.DrawingArea ();
                        this.drawingarea.Name = "drawingarea";
                        this.vbox6.Add (this.drawingarea);
-                       global::Gtk.Box.BoxChild w100 = ((global::Gtk.Box.BoxChild)(this.vbox6 
[this.drawingarea]));
-                       w100.Position = 2;
+                       global::Gtk.Box.BoxChild w101 = ((global::Gtk.Box.BoxChild)(this.vbox6 
[this.drawingarea]));
+                       w101.Position = 2;
                        this.vbox5.Add (this.vbox6);
-                       global::Gtk.Box.BoxChild w101 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.vbox6]));
-                       w101.Position = 1;
-                       this.notebook1.Add (this.vbox5);
-                       global::Gtk.Notebook.NotebookChild w102 = 
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox5]));
+                       global::Gtk.Box.BoxChild w102 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.vbox6]));
                        w102.Position = 1;
-                       w102.TabFill = false;
-                       w102.MenuLabel = "";
+                       this.notebook1.Add (this.vbox5);
+                       global::Gtk.Notebook.NotebookChild w103 = 
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox5]));
+                       w103.Position = 1;
+                       w103.TabFill = false;
+                       w103.MenuLabel = "";
                        // Notebook tab
-                       this.label3 = new global::Gtk.Label ();
-                       this.label3.Name = "label3";
-                       this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("page2");
-                       this.notebook1.SetTabLabel (this.vbox5, this.label3);
-                       this.label3.ShowAll ();
+                       this.label13 = new global::Gtk.Label ();
+                       this.label13.Name = "label13";
+                       this.label13.LabelProp = global::Mono.Unix.Catalog.GetString ("page2");
+                       this.notebook1.SetTabLabel (this.vbox5, this.label13);
+                       this.label13.ShowAll ();
                        // Container child notebook1.Gtk.Notebook+NotebookChild
                        this.projectperiods1 = new global::LongoMatch.Gui.Component.ProjectPeriods ();
                        this.projectperiods1.Events = ((global::Gdk.EventMask)(256));
                        this.projectperiods1.Name = "projectperiods1";
                        this.notebook1.Add (this.projectperiods1);
-                       global::Gtk.Notebook.NotebookChild w103 = 
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.projectperiods1]));
-                       w103.Position = 2;
+                       global::Gtk.Notebook.NotebookChild w104 = 
((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.projectperiods1]));
+                       w104.Position = 2;
                        // Notebook tab
-                       this.label7 = new global::Gtk.Label ();
-                       this.label7.Name = "label7";
-                       this.label7.LabelProp = global::Mono.Unix.Catalog.GetString ("page3");
-                       this.notebook1.SetTabLabel (this.projectperiods1, this.label7);
-                       this.label7.ShowAll ();
+                       this.label14 = new global::Gtk.Label ();
+                       this.label14.Name = "label14";
+                       this.label14.LabelProp = global::Mono.Unix.Catalog.GetString ("page3");
+                       this.notebook1.SetTabLabel (this.projectperiods1, this.label14);
+                       this.label14.ShowAll ();
                        this.vbox3.Add (this.notebook1);
-                       global::Gtk.Box.BoxChild w104 = ((global::Gtk.Box.BoxChild)(this.vbox3 
[this.notebook1]));
-                       w104.Position = 1;
+                       global::Gtk.Box.BoxChild w105 = ((global::Gtk.Box.BoxChild)(this.vbox3 
[this.notebook1]));
+                       w105.Position = 1;
                        this.Add (this.vbox3);
                        if ((this.Child != null)) {
                                this.Child.ShowAll ();
                        }
-                       this.devicecombobox.Hide ();
-                       this.urientry.Hide ();
-                       this.device.Hide ();
-                       this.urilabel.Hide ();
-                       this.rcapturetable.Hide ();
                        this.Hide ();
                }
        }
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 65b6391..fe0ba10 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -2654,6 +2654,7 @@ Away</property>
             <child>
               <widget class="Gtk.Label" id="playLabel">
                 <property name="MemberName" />
+                <property name="LabelProp" translatable="yes" />
               </widget>
               <packing>
                 <property name="LeftAttach">1</property>
@@ -4863,6 +4864,7 @@ You can continue with the current capture, cancel it or save your project.
             <child>
               <widget class="Gtk.Label" id="dblabel">
                 <property name="MemberName" />
+                <property name="LabelProp" translatable="yes" />
               </widget>
               <packing>
                 <property name="Position">0</property>
@@ -6373,102 +6375,129 @@ You can continue with the current capture, cancel it or save your project.
                               </packing>
                             </child>
                             <child>
-                              <widget class="Gtk.Table" id="outputfiletable">
+                              <widget class="Gtk.VBox" id="capturebox">
                                 <property name="MemberName" />
-                                <property name="NColumns">2</property>
-                                <property name="RowSpacing">6</property>
-                                <property name="ColumnSpacing">6</property>
+                                <property name="Spacing">6</property>
                                 <child>
-                                  <widget class="LongoMatch.Gui.Component.MediaFileChooser" 
id="capturemediafilechooser">
+                                  <widget class="Gtk.Table" id="outputfiletable">
                                     <property name="MemberName" />
-                                    <property name="Events">ButtonPressMask</property>
+                                    <property name="NColumns">2</property>
+                                    <property name="RowSpacing">6</property>
+                                    <property name="ColumnSpacing">6</property>
+                                    <child>
+                                      <widget class="LongoMatch.Gui.Component.MediaFileChooser" 
id="capturemediafilechooser">
+                                        <property name="MemberName" />
+                                        <property name="Events">ButtonPressMask</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="LeftAttach">1</property>
+                                        <property name="RightAttach">2</property>
+                                        <property name="AutoSize">True</property>
+                                        <property name="YOptions">Fill</property>
+                                        <property name="XExpand">True</property>
+                                        <property name="XFill">True</property>
+                                        <property name="XShrink">False</property>
+                                        <property name="YExpand">False</property>
+                                        <property name="YFill">True</property>
+                                        <property name="YShrink">False</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="Gtk.Label" id="outputfilelabel">
+                                        <property name="MemberName" />
+                                        <property name="Xalign">1</property>
+                                        <property name="LabelProp" translatable="yes">Output file</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="AutoSize">True</property>
+                                        <property name="XOptions">Fill</property>
+                                        <property name="YOptions">Fill</property>
+                                        <property name="XExpand">False</property>
+                                        <property name="XFill">True</property>
+                                        <property name="XShrink">False</property>
+                                        <property name="YExpand">False</property>
+                                        <property name="YFill">True</property>
+                                        <property name="YShrink">False</property>
+                                      </packing>
+                                    </child>
                                   </widget>
                                   <packing>
-                                    <property name="LeftAttach">1</property>
-                                    <property name="RightAttach">2</property>
+                                    <property name="Position">0</property>
                                     <property name="AutoSize">True</property>
-                                    <property name="YOptions">Fill</property>
-                                    <property name="XExpand">True</property>
-                                    <property name="XFill">True</property>
-                                    <property name="XShrink">False</property>
-                                    <property name="YExpand">False</property>
-                                    <property name="YFill">True</property>
-                                    <property name="YShrink">False</property>
+                                    <property name="Expand">False</property>
+                                    <property name="Fill">False</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="Gtk.Label" id="outputfilelabel">
+                                  <widget class="Gtk.Table" id="urltable">
                                     <property name="MemberName" />
-                                    <property name="LabelProp" translatable="yes">Output file</property>
+                                    <property name="NColumns">2</property>
+                                    <property name="RowSpacing">6</property>
+                                    <property name="ColumnSpacing">6</property>
+                                    <child>
+                                      <widget class="Gtk.Entry" id="urientry">
+                                        <property name="MemberName" />
+                                        <property name="CanFocus">True</property>
+                                        <property name="IsEditable">True</property>
+                                        <property name="InvisibleChar">•</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="LeftAttach">1</property>
+                                        <property name="RightAttach">2</property>
+                                        <property name="AutoSize">True</property>
+                                        <property name="YOptions">Fill</property>
+                                        <property name="XExpand">True</property>
+                                        <property name="XFill">True</property>
+                                        <property name="XShrink">False</property>
+                                        <property name="YExpand">False</property>
+                                        <property name="YFill">True</property>
+                                        <property name="YShrink">False</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="Gtk.Label" id="urilabel">
+                                        <property name="MemberName" />
+                                        <property name="Xalign">1</property>
+                                        <property name="LabelProp" translatable="yes">URL</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="AutoSize">True</property>
+                                        <property name="XOptions">Fill</property>
+                                        <property name="YOptions">Fill</property>
+                                        <property name="XExpand">False</property>
+                                        <property name="XFill">True</property>
+                                        <property name="XShrink">False</property>
+                                        <property name="YExpand">False</property>
+                                        <property name="YFill">True</property>
+                                        <property name="YShrink">False</property>
+                                      </packing>
+                                    </child>
                                   </widget>
                                   <packing>
+                                    <property name="Position">1</property>
                                     <property name="AutoSize">True</property>
-                                    <property name="XOptions">Fill</property>
-                                    <property name="YOptions">Fill</property>
-                                    <property name="XExpand">False</property>
-                                    <property name="XFill">True</property>
-                                    <property name="XShrink">False</property>
-                                    <property name="YExpand">False</property>
-                                    <property name="YFill">True</property>
-                                    <property name="YShrink">False</property>
+                                    <property name="Expand">False</property>
+                                    <property name="Fill">False</property>
                                   </packing>
                                 </child>
-                              </widget>
-                              <packing>
-                                <property name="Position">2</property>
-                                <property name="AutoSize">True</property>
-                                <property name="Expand">False</property>
-                                <property name="Fill">False</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <widget class="Gtk.HBox" id="hbox10">
-                                <property name="MemberName" />
-                                <property name="Homogeneous">True</property>
-                                <property name="Spacing">6</property>
                                 <child>
-                                  <widget class="Gtk.Table" id="lcapturetable">
+                                  <widget class="Gtk.Table" id="devicetable">
                                     <property name="MemberName" />
                                     <property name="NRows">2</property>
                                     <property name="NColumns">2</property>
                                     <property name="RowSpacing">6</property>
                                     <property name="ColumnSpacing">6</property>
                                     <child>
-                                      <widget class="Gtk.HBox" id="hbox7">
+                                      <widget class="Gtk.Label" id="device">
                                         <property name="MemberName" />
-                                        <property name="Spacing">6</property>
-                                        <child>
-                                          <widget class="Gtk.ComboBox" id="devicecombobox">
-                                            <property name="MemberName" />
-                                            <property name="Visible">False</property>
-                                            <property name="IsTextCombo">True</property>
-                                            <property name="Items" translatable="yes" />
-                                          </widget>
-                                          <packing>
-                                            <property name="Position">0</property>
-                                            <property name="AutoSize">False</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="Gtk.Entry" id="urientry">
-                                            <property name="MemberName" />
-                                            <property name="Visible">False</property>
-                                            <property name="CanFocus">True</property>
-                                            <property name="IsEditable">True</property>
-                                            <property name="InvisibleChar">•</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="Position">1</property>
-                                            <property name="AutoSize">False</property>
-                                          </packing>
-                                        </child>
+                                        <property name="Xalign">1</property>
+                                        <property name="LabelProp" translatable="yes">Device</property>
                                       </widget>
                                       <packing>
-                                        <property name="LeftAttach">1</property>
-                                        <property name="RightAttach">2</property>
-                                        <property name="AutoSize">False</property>
+                                        <property name="AutoSize">True</property>
+                                        <property name="XOptions">Fill</property>
                                         <property name="YOptions">Fill</property>
-                                        <property name="XExpand">True</property>
+                                        <property name="XExpand">False</property>
                                         <property name="XFill">True</property>
                                         <property name="XShrink">False</property>
                                         <property name="YExpand">False</property>
@@ -6477,37 +6506,18 @@ You can continue with the current capture, cancel it or save your project.
                                       </packing>
                                     </child>
                                     <child>
-                                      <widget class="Gtk.HBox" id="hbox8">
+                                      <widget class="Gtk.ComboBox" id="devicecombobox">
                                         <property name="MemberName" />
-                                        <property name="Spacing">6</property>
-                                        <child>
-                                          <widget class="Gtk.Label" id="device">
-                                            <property name="MemberName" />
-                                            <property name="Visible">False</property>
-                                            <property name="LabelProp" translatable="yes">Device</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="Position">0</property>
-                                            <property name="AutoSize">False</property>
-                                          </packing>
-                                        </child>
-                                        <child>
-                                          <widget class="Gtk.Label" id="urilabel">
-                                            <property name="MemberName" />
-                                            <property name="Visible">False</property>
-                                            <property name="LabelProp" translatable="yes">URL</property>
-                                          </widget>
-                                          <packing>
-                                            <property name="Position">1</property>
-                                            <property name="AutoSize">False</property>
-                                          </packing>
-                                        </child>
+                                        <property name="WidthRequest">300</property>
+                                        <property name="IsTextCombo">True</property>
+                                        <property name="Items" translatable="yes" />
                                       </widget>
                                       <packing>
-                                        <property name="AutoSize">True</property>
-                                        <property name="XOptions">Fill</property>
+                                        <property name="LeftAttach">1</property>
+                                        <property name="RightAttach">2</property>
+                                        <property name="AutoSize">False</property>
                                         <property name="YOptions">Fill</property>
-                                        <property name="XExpand">False</property>
+                                        <property name="XExpand">True</property>
                                         <property name="XFill">True</property>
                                         <property name="XShrink">False</property>
                                         <property name="YExpand">False</property>
@@ -6516,7 +6526,7 @@ You can continue with the current capture, cancel it or save your project.
                                       </packing>
                                     </child>
                                     <child>
-                                      <widget class="Gtk.ComboBox" id="imagecombobox">
+                                      <widget class="Gtk.ComboBox" id="deviceformatcombobox">
                                         <property name="MemberName" />
                                         <property name="IsTextCombo">True</property>
                                         <property name="Items" translatable="yes" />
@@ -6538,9 +6548,10 @@ You can continue with the current capture, cancel it or save your project.
                                       </packing>
                                     </child>
                                     <child>
-                                      <widget class="Gtk.Label" id="sizelabel">
+                                      <widget class="Gtk.Label" id="deviceformatlabel">
                                         <property name="MemberName" />
-                                        <property name="LabelProp" translatable="yes">Size</property>
+                                        <property name="Xalign">1</property>
+                                        <property name="LabelProp" translatable="yes">Device 
format</property>
                                       </widget>
                                       <packing>
                                         <property name="TopAttach">1</property>
@@ -6558,19 +6569,26 @@ You can continue with the current capture, cancel it or save your project.
                                     </child>
                                   </widget>
                                   <packing>
-                                    <property name="Position">0</property>
-                                    <property name="AutoSize">False</property>
+                                    <property name="Position">2</property>
+                                    <property name="AutoSize">True</property>
+                                    <property name="Expand">False</property>
+                                    <property name="Fill">False</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <widget class="Gtk.Table" id="rcapturetable">
+                                  <widget class="Gtk.Table" id="encpropstable">
                                     <property name="MemberName" />
-                                    <property name="Visible">False</property>
                                     <property name="NRows">2</property>
-                                    <property name="NColumns">2</property>
+                                    <property name="NColumns">4</property>
                                     <property name="RowSpacing">6</property>
                                     <property name="ColumnSpacing">6</property>
                                     <child>
+                                      <placeholder />
+                                    </child>
+                                    <child>
+                                      <placeholder />
+                                    </child>
+                                    <child>
                                       <widget class="Gtk.ComboBox" id="encodingcombobox">
                                         <property name="MemberName" />
                                         <property name="IsTextCombo">True</property>
@@ -6590,7 +6608,7 @@ You can continue with the current capture, cancel it or save your project.
                                       </packing>
                                     </child>
                                     <child>
-                                      <widget class="Gtk.ComboBox" id="qualitycombobox">
+                                      <widget class="Gtk.ComboBox" id="imagecombobox">
                                         <property name="MemberName" />
                                         <property name="IsTextCombo">True</property>
                                         <property name="Items" translatable="yes" />
@@ -6600,6 +6618,46 @@ You can continue with the current capture, cancel it or save your project.
                                         <property name="BottomAttach">2</property>
                                         <property name="LeftAttach">1</property>
                                         <property name="RightAttach">2</property>
+                                        <property name="AutoSize">True</property>
+                                        <property name="XOptions">Fill</property>
+                                        <property name="YOptions">Fill</property>
+                                        <property name="XExpand">False</property>
+                                        <property name="XFill">True</property>
+                                        <property name="XShrink">False</property>
+                                        <property name="YExpand">False</property>
+                                        <property name="YFill">True</property>
+                                        <property name="YShrink">False</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="Gtk.Label" id="outputsizelabel">
+                                        <property name="MemberName" />
+                                        <property name="Xalign">1</property>
+                                        <property name="LabelProp" translatable="yes">Output size</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="TopAttach">1</property>
+                                        <property name="BottomAttach">2</property>
+                                        <property name="AutoSize">True</property>
+                                        <property name="XOptions">Fill</property>
+                                        <property name="YOptions">Fill</property>
+                                        <property name="XExpand">False</property>
+                                        <property name="XFill">True</property>
+                                        <property name="XShrink">False</property>
+                                        <property name="YExpand">False</property>
+                                        <property name="YFill">True</property>
+                                        <property name="YShrink">False</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="Gtk.ComboBox" id="qualitycombobox">
+                                        <property name="MemberName" />
+                                        <property name="IsTextCombo">True</property>
+                                        <property name="Items" translatable="yes" />
+                                      </widget>
+                                      <packing>
+                                        <property name="LeftAttach">3</property>
+                                        <property name="RightAttach">4</property>
                                         <property name="AutoSize">False</property>
                                         <property name="YOptions">Fill</property>
                                         <property name="XExpand">True</property>
@@ -6611,13 +6669,14 @@ You can continue with the current capture, cancel it or save your project.
                                       </packing>
                                     </child>
                                     <child>
-                                      <widget class="Gtk.Label" id="qualitylabel">
+                                      <widget class="Gtk.Label" id="qualityformatlabel">
                                         <property name="MemberName" />
+                                        <property name="Xalign">1</property>
                                         <property name="LabelProp" translatable="yes">Quality</property>
                                       </widget>
                                       <packing>
-                                        <property name="TopAttach">1</property>
-                                        <property name="BottomAttach">2</property>
+                                        <property name="LeftAttach">2</property>
+                                        <property name="RightAttach">3</property>
                                         <property name="AutoSize">True</property>
                                         <property name="XOptions">Fill</property>
                                         <property name="YOptions">Fill</property>
@@ -6632,10 +6691,11 @@ You can continue with the current capture, cancel it or save your project.
                                     <child>
                                       <widget class="Gtk.Label" id="videoformatlabel">
                                         <property name="MemberName" />
+                                        <property name="Xalign">1</property>
                                         <property name="LabelProp" translatable="yes">Format</property>
                                       </widget>
                                       <packing>
-                                        <property name="AutoSize">True</property>
+                                        <property name="AutoSize">False</property>
                                         <property name="XOptions">Fill</property>
                                         <property name="YOptions">Fill</property>
                                         <property name="XExpand">False</property>
@@ -6648,13 +6708,15 @@ You can continue with the current capture, cancel it or save your project.
                                     </child>
                                   </widget>
                                   <packing>
-                                    <property name="Position">1</property>
-                                    <property name="AutoSize">False</property>
+                                    <property name="Position">3</property>
+                                    <property name="AutoSize">True</property>
+                                    <property name="Expand">False</property>
+                                    <property name="Fill">False</property>
                                   </packing>
                                 </child>
                               </widget>
                               <packing>
-                                <property name="Position">3</property>
+                                <property name="Position">2</property>
                                 <property name="AutoSize">True</property>
                                 <property name="Expand">False</property>
                                 <property name="Fill">False</property>
@@ -6755,7 +6817,7 @@ You can continue with the current capture, cancel it or save your project.
                                 <property name="MemberName" />
                                 <property name="Spacing">6</property>
                                 <child>
-                                  <widget class="Gtk.Label" id="label8">
+                                  <widget class="Gtk.Label" id="label11">
                                     <property name="MemberName" />
                                     <property name="LabelProp" translatable="yes">Tactics</property>
                                   </widget>
@@ -6846,7 +6908,7 @@ You can continue with the current capture, cancel it or save your project.
                                 <property name="MemberName" />
                                 <property name="Spacing">6</property>
                                 <child>
-                                  <widget class="Gtk.Label" id="label9">
+                                  <widget class="Gtk.Label" id="label12">
                                     <property name="MemberName" />
                                     <property name="LabelProp" translatable="yes">Tactics</property>
                                   </widget>
@@ -6958,7 +7020,7 @@ You can continue with the current capture, cancel it or save your project.
               </packing>
             </child>
             <child>
-              <widget class="Gtk.Label" id="label3">
+              <widget class="Gtk.Label" id="label13">
                 <property name="MemberName" />
                 <property name="LabelProp" translatable="yes">page2</property>
               </widget>
@@ -6976,7 +7038,7 @@ You can continue with the current capture, cancel it or save your project.
               </packing>
             </child>
             <child>
-              <widget class="Gtk.Label" id="label7">
+              <widget class="Gtk.Label" id="label14">
                 <property name="MemberName" />
                 <property name="LabelProp" translatable="yes">page3</property>
               </widget>
@@ -8600,6 +8662,7 @@ You can continue with the current capture, cancel it or save your project.
                                               <widget class="Gtk.Label" id="templatelabel">
                                                 <property name="MemberName" />
                                                 <property name="Xalign">0</property>
+                                                <property name="LabelProp" translatable="yes" />
                                               </widget>
                                               <packing>
                                                 <property name="TopAttach">1</property>
@@ -8817,6 +8880,7 @@ You can continue with the current capture, cancel it or save your project.
                 <child>
                   <widget class="Gtk.Label" id="label1">
                     <property name="MemberName" />
+                    <property name="LabelProp" translatable="yes" />
                   </widget>
                   <packing>
                     <property name="type">tab</property>
@@ -8828,6 +8892,7 @@ You can continue with the current capture, cancel it or save your project.
                 <child>
                   <widget class="Gtk.Label" id="label3">
                     <property name="MemberName" />
+                    <property name="LabelProp" translatable="yes" />
                   </widget>
                   <packing>
                     <property name="type">tab</property>
@@ -9641,6 +9706,7 @@ You can continue with the current capture, cancel it or save your project.
                   <widget class="Gtk.Label" id="synclabel">
                     <property name="MemberName" />
                     <property name="WidthRequest">300</property>
+                    <property name="LabelProp" translatable="yes" />
                     <property name="UseMarkup">True</property>
                   </widget>
                   <packing>
@@ -9821,7 +9887,7 @@ You can continue with the current capture, cancel it or save your project.
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.MediaFileChooser" design-size="300 64">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.MediaFileChooser" design-size="259 64">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
@@ -10819,6 +10885,7 @@ You can continue with the current capture, cancel it or save your project.
         <child>
           <widget class="Gtk.Label" id="localPlaysList">
             <property name="MemberName" />
+            <property name="LabelProp" translatable="yes" />
           </widget>
           <packing>
             <property name="type">tab</property>
@@ -10836,6 +10903,7 @@ You can continue with the current capture, cancel it or save your project.
         <child>
           <widget class="Gtk.Label" id="visitorPlaysList">
             <property name="MemberName" />
+            <property name="LabelProp" translatable="yes" />
           </widget>
           <packing>
             <property name="type">tab</property>
@@ -10898,6 +10966,7 @@ You can continue with the current capture, cancel it or save your project.
                           <widget class="Gtk.Label" id="authorlabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="TopAttach">2</property>
@@ -10919,6 +10988,7 @@ You can continue with the current capture, cancel it or save your project.
                           <widget class="Gtk.Label" id="desclabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                             <property name="Wrap">True</property>
                             <property name="WidthChars">70</property>
                             <property name="MaxWidthChars">100</property>
@@ -10942,6 +11012,7 @@ You can continue with the current capture, cancel it or save your project.
                           <widget class="Gtk.Label" id="filelabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                             <property name="Wrap">True</property>
                             <property name="Ellipsize">Start</property>
                             <property name="SingleLineMode">True</property>
@@ -11047,6 +11118,7 @@ You can continue with the current capture, cancel it or save your project.
                           <widget class="Gtk.Label" id="namelabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="LeftAttach">1</property>
@@ -11390,6 +11462,7 @@ To avoid this, and to enjoy many additional functional benefits, we encourage yo
                       <widget class="Gtk.Label" id="filelabel">
                         <property name="MemberName" />
                         <property name="Xalign">0</property>
+                        <property name="LabelProp" translatable="yes" />
                         <property name="Ellipsize">Start</property>
                       </widget>
                       <packing>
@@ -11408,6 +11481,7 @@ To avoid this, and to enjoy many additional functional benefits, we encourage yo
                           <widget class="Gtk.Label" id="audiolabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="TopAttach">1</property>
@@ -11427,6 +11501,7 @@ To avoid this, and to enjoy many additional functional benefits, we encourage yo
                           <widget class="Gtk.Label" id="containerlabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="TopAttach">2</property>
@@ -11444,6 +11519,7 @@ To avoid this, and to enjoy many additional functional benefits, we encourage yo
                           <widget class="Gtk.Label" id="durationlabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="AutoSize">False</property>
@@ -11459,6 +11535,7 @@ To avoid this, and to enjoy many additional functional benefits, we encourage yo
                           <widget class="Gtk.Label" id="formatlabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="LeftAttach">1</property>
@@ -11476,6 +11553,7 @@ To avoid this, and to enjoy many additional functional benefits, we encourage yo
                           <widget class="Gtk.Label" id="label9">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="TopAttach">2</property>
@@ -11495,6 +11573,7 @@ To avoid this, and to enjoy many additional functional benefits, we encourage yo
                           <widget class="Gtk.Label" id="videolabel">
                             <property name="MemberName" />
                             <property name="Xalign">0</property>
+                            <property name="LabelProp" translatable="yes" />
                           </widget>
                           <packing>
                             <property name="TopAttach">1</property>
diff --git a/LongoMatch.Multimedia/Capturer/GstCameraCapturer.cs 
b/LongoMatch.Multimedia/Capturer/GstCameraCapturer.cs
index a281b0e..ed3f8fc 100644
--- a/LongoMatch.Multimedia/Capturer/GstCameraCapturer.cs
+++ b/LongoMatch.Multimedia/Capturer/GstCameraCapturer.cs
@@ -48,7 +48,8 @@ namespace LongoMatch.Video.Capturer {
                [DllImport("libcesarplayer.dll")]
                static extern unsafe IntPtr gst_camera_capturer_configure (
                        IntPtr raw, IntPtr output_file, int type, IntPtr source_element,
-                       IntPtr device_id, int video_encoder, int audio_encoder, int muxer,
+                       IntPtr device_id, int width, int height, int fps_n, int fps_d,
+                       int video_encoder, int audio_encoder, int muxer,
                        uint video_bitrate, uint audio_bitrate, bool record_audio,
                        uint output_width, uint output_height, IntPtr window_handle,
                        out IntPtr err);
@@ -355,6 +356,8 @@ namespace LongoMatch.Video.Capturer {
                public void Configure (CaptureSettings settings, IntPtr window_handle) {
                        IntPtr err = IntPtr.Zero;
                        EncodingQuality qual = settings.EncodingSettings.EncodingQuality;
+                       Device device = settings.Device;
+                       DeviceVideoFormat format = settings.Format;
                        EncodingProfile enc;
                        VideoStandard std;
                        IntPtr outFile, sourceElement, deviceID;
@@ -363,11 +366,12 @@ namespace LongoMatch.Video.Capturer {
                        std = settings.EncodingSettings.VideoStandard;
                        
                        outFile = Marshaller.StringToPtrGStrdup (settings.EncodingSettings.OutputFile);
-                       sourceElement = Marshaller.StringToPtrGStrdup (settings.SourceElement);
-                       deviceID = Marshaller.StringToPtrGStrdup (settings.DeviceID);
+                       sourceElement = Marshaller.StringToPtrGStrdup (device.SourceElement);
+                       deviceID = Marshaller.StringToPtrGStrdup (device.ID);
                        
-                       gst_camera_capturer_configure (Handle, outFile, (int) settings.CaptureSourceType,
+                       gst_camera_capturer_configure (Handle, outFile, (int) settings.Device.DeviceType,
                                                       sourceElement, deviceID,
+                                                      format.width, format.height, format.fps_n, 
format.fps_d,
                                                       (int) enc.VideoEncoder, (int) enc.AudioEncoder,
                                                       (int) enc.Muxer, qual.VideoQuality,
                                                       qual.AudioQuality,
@@ -413,19 +417,6 @@ namespace LongoMatch.Video.Capturer {
                        gst_camera_capturer_expose(Handle);
                }
 
-               public static string[] AudioDevices {
-                       get {
-                               IntPtr raw_ret = gst_camera_capturer_enum_audio_devices();
-                               return (string[])GLib.Marshaller.ListPtrToArray(raw_ret, typeof(GLib.List),  
true, false, typeof(String));
-                       }
-               }
-
-               public static string[] ListVideoDevices (string devname) {
-                       IntPtr raw_ret = gst_camera_capturer_enum_video_devices(devname);
-                       return (string[])GLib.Marshaller.ListPtrToArray(raw_ret, typeof(GLib.List),  true, 
false, typeof(String));
-               }
-
-
                public Image CurrentFrame {
                        get {
                                IntPtr raw_ret = gst_camera_capturer_get_current_frame(Handle);
diff --git a/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj 
b/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
index 3560a63..f78fc32 100644
--- a/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
+++ b/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
@@ -39,7 +39,6 @@
     <Compile Include="Capturer\LiveSourceTimer.cs" />
     <Compile Include="Utils\TimeString.cs" />
     <Compile Include="Utils\GstDiscoverer.cs" />
-    <Compile Include="Utils\VideoDevice.cs" />
     <Compile Include="Utils\GStreamer.cs" />
     <Compile Include="Common\Handlers.cs" />
     <Compile Include="Remuxer\GstRemuxer.cs" />
@@ -51,6 +50,7 @@
     <Compile Include="Player\GstPlayer.cs" />
     <Compile Include="Player\ObjectManager.cs" />
     <Compile Include="Utils\WindowHandle.cs" />
+    <Compile Include="Utils\Devices.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Capturer\" />
diff --git a/LongoMatch.Multimedia/Makefile.am b/LongoMatch.Multimedia/Makefile.am
index 0f46226..b5fef10 100644
--- a/LongoMatch.Multimedia/Makefile.am
+++ b/LongoMatch.Multimedia/Makefile.am
@@ -23,7 +23,7 @@ SOURCES = Capturer/FakeCapturer.cs \
        Utils/MultimediaFactory.cs \
        Utils/Seeker.cs \
        Utils/TimeString.cs \
-       Utils/VideoDevice.cs \
+       Utils/Devices.cs \
        Utils/WindowHandle.cs
 
 DLLCONFIG = LongoMatch.Multimedia.dll.config
diff --git a/LongoMatch.Multimedia/Utils/Devices.cs b/LongoMatch.Multimedia/Utils/Devices.cs
new file mode 100644
index 0000000..0eb0547
--- /dev/null
+++ b/LongoMatch.Multimedia/Utils/Devices.cs
@@ -0,0 +1,85 @@
+// 
+//  Copyright (C) 2011 Andoni Morales Alastruey
+// 
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+// 
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+//  GNU General Public License for more details.
+//  
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+// 
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+using LongoMatch.Core.Common;
+using LongoMatch.Video.Capturer;
+using System;
+using System.Runtime.InteropServices;
+
+namespace LongoMatch.Multimedia.Utils
+{
+       public class Devices
+       {
+               [DllImport("libcesarplayer.dll")]
+               static extern IntPtr lgm_device_enum_video_devices (string source);
+               [DllImport("libcesarplayer.dll")]
+               static extern IntPtr lgm_device_get_formats (IntPtr raw);
+               [DllImport("libcesarplayer.dll")]
+               static extern IntPtr lgm_device_get_device_name (IntPtr raw);
+               [DllImport("libcesarplayer.dll")]
+               static extern void lgm_device_free (IntPtr raw);
+               [DllImport("libcesarplayer.dll")]
+               static extern IntPtr lgm_device_video_format_get_info (IntPtr raw, out int width, out int 
height,
+                                                                      out int fps_n, out int fps_d);
+               #if OSTYPE_OS_X
+               static string[] devices = new string[1] {"avfvideosrc"};
+               #elif OSTYPE_WINDOWS
+               static string[] devices = new string[2] {"ksvideosrc", "dshowvideosrc"};
+               #else
+               static string[] devices = new string[2] { "v4l2src", "dv1394src" };
+               #endif
+               
+               static public List<Device> ListVideoDevices ()
+               {
+                       List<Device> devicesList = new List<Device> ();
+
+                       foreach (string source in devices) {
+                               GLib.List devices_raw = new GLib.List (lgm_device_enum_video_devices (source),
+                                                                      typeof (IntPtr), true, false);
+                               
+                               foreach (IntPtr device_raw in devices_raw) {
+                                       /* The Direct Show GStreamer element seems to have problems with the
+                                        * BlackMagic DeckLink cards, so filter them out. They are also
+                                        * available through the ksvideosrc element. */
+                                       if (source == "dshowvideosrc" &&
+                                               Regex.Match (source, ".*blackmagic.*|.*decklink.*", 
RegexOptions.IgnoreCase).Success) {
+                                               continue;
+                                       }
+                                       
+                                       Device device = new Device ();
+                                       device.DeviceType = CaptureSourceType.System;
+                                       device.SourceElement = source;
+                                       device.ID = GLib.Marshaller.PtrToStringGFree 
(lgm_device_get_device_name (device_raw));
+                                       GLib.List formats_raw = new GLib.List (lgm_device_get_formats 
(device_raw),
+                                                                              typeof (IntPtr), false, false);
+                                       foreach (IntPtr format_raw in formats_raw) {
+                                               DeviceVideoFormat format = new DeviceVideoFormat ();
+                                               lgm_device_video_format_get_info (format_raw, out 
format.width, out format.height,
+                                                                                 out format.fps_n, out 
format.fps_d);
+                                               device.Formats.Add (format);
+                                       }
+                                       devicesList.Add (device);
+                                       lgm_device_free (device_raw);
+                               }
+                       }
+                       return devicesList;
+               }
+       }
+}
+
diff --git a/LongoMatch.Multimedia/Utils/MultimediaFactory.cs 
b/LongoMatch.Multimedia/Utils/MultimediaFactory.cs
index 77bc1c5..1b73b2a 100644
--- a/LongoMatch.Multimedia/Utils/MultimediaFactory.cs
+++ b/LongoMatch.Multimedia/Utils/MultimediaFactory.cs
@@ -103,7 +103,7 @@ namespace LongoMatch.Video
 
                public List<Device> VideoDevices {
                        get {
-                               return VideoDevice.ListVideoDevices ();
+                               return Devices.ListVideoDevices ();
                        }
                }
 
diff --git a/libcesarplayer/Makefile.am b/libcesarplayer/Makefile.am
index f6188f4..4d18b07 100644
--- a/libcesarplayer/Makefile.am
+++ b/libcesarplayer/Makefile.am
@@ -37,6 +37,8 @@ libcesarplayer_la_SOURCES = \
        lgm-gtk-glue.h\
        lgm-video-player.h\
        lgm-video-player.c\
+       lgm-device.h\
+       lgm-device.c\
        gstscreenshot.c \
        gstscreenshot.h \
        gst-camera-capturer.c\
diff --git a/libcesarplayer/gst-camera-capturer.c b/libcesarplayer/gst-camera-capturer.c
index 4090954..de11fcc 100644
--- a/libcesarplayer/gst-camera-capturer.c
+++ b/libcesarplayer/gst-camera-capturer.c
@@ -27,7 +27,6 @@
 
 #include <gst/app/gstappsrc.h>
 #include <gst/interfaces/xoverlay.h>
-#include <gst/interfaces/propertyprobe.h>
 #include <gst/gst.h>
 #include <gst/video/video.h>
 
@@ -57,6 +56,10 @@ struct GstCameraCapturerPrivate
   /*Encoding properties */
   gchar *output_file;
   gchar *device_id;
+  gint source_width;
+  gint source_height;
+  gint source_fps_n;
+  gint source_fps_d;
   guint output_height;
   guint output_width;
   guint audio_quality;
@@ -325,8 +328,7 @@ gst_camera_capturer_create_converter_bin (GstCameraCapturer * gcc)
   videoscale = gst_element_factory_make ("videoscale", NULL);
   filter = gst_element_factory_make ("capsfilter", NULL);
   /* Set caps for the encoding resolution */
-  caps = gst_caps_from_string ("video/x-raw-yuv, framerate=25/1;"
-      "video/x-raw-rgb, framerate=25/1");
+  caps = gst_caps_from_string ("video/x-raw-yuv; video/x-raw-rgb");
   if (gcc->priv->output_width != 0) {
     gst_caps_set_simple (caps, "width", G_TYPE_INT, gcc->priv->output_width,
         NULL);
@@ -335,6 +337,18 @@ gst_camera_capturer_create_converter_bin (GstCameraCapturer * gcc)
     gst_caps_set_simple (caps, "height", G_TYPE_INT, gcc->priv->output_height,
         NULL);
   }
+  if (gcc->priv->source_fps_n != 0 && gcc->priv->source_fps_d != 0) {
+    gint fps_n, fps_d;
+
+    /* If the source frame rate is 50 or 60, reduce it to 25 or 30 */
+    fps_n = gcc->priv->source_fps_n;
+    fps_d = gcc->priv->source_fps_d;
+    if ((gfloat)fps_n / fps_d > 30) {
+      fps_d = fps_d * 2;
+    }
+    gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
+        fps_n, fps_d, NULL);
+  }
   g_object_set (filter, "caps", caps, NULL);
   gst_bin_add_many (GST_BIN (bin), videorate, videoscale, filter, NULL);
 
@@ -827,45 +841,23 @@ gst_camera_capturer_fill_audio_source_bin (GstCameraCapturer * gcc)
 }
 
 static GstCaps *
-gst_camera_capturer_find_highest_res (GstCameraCapturer *gcc, GstCaps *caps)
+gst_camera_capturer_source_caps (GstCameraCapturer *gcc)
 {
-  gint max_width = 0, max_height = 0, i = 0;
-  gint width, height;
   gchar *caps_str;
-  GstCaps *rcaps;
+  GstCaps *caps;
 
-  if (gst_caps_get_size (caps) == 0) {
-    return NULL;
+  caps = gst_caps_from_string ("video/x-raw-yuv;video/x-raw-rgb;"
+      "video/x-dv, systemstream=true");
+  if (gcc->priv->source_width == 0 && gcc->priv->source_height == 0) {
+    return caps;
   }
-  for (i=0; i < gst_caps_get_size (caps); i++) {
-    GstStructure *s = gst_caps_get_structure (caps, i);
-    if (gst_structure_get_int (s, "width", &width) &&
-      gst_structure_get_int (s, "height", &height)) {
-      if (width + height > max_width + max_height) {
-        max_width = width;
-        max_height = height;
-      }
-    }
-  }
-  if (max_width == 0 || max_height == 0) {
-    max_width = gcc->priv->output_width;
-    max_height = gcc->priv->output_height;
-  } else if (max_width < gcc->priv->output_width &&
-      max_height < gcc->priv->output_height) {
-    gcc->priv->output_width = max_width;
-    gcc->priv->output_height = max_height;
-    GST_INFO_OBJECT (gcc, "Reconfiguring the output size to %dx%d",
-        gcc->priv->output_width, gcc->priv->output_height);
-  }
-
-  caps_str = g_strdup_printf ("video/x-raw-yuv, width=%d, height=%d;"
-      "video/x-raw-rgb, width=%d, height=%d;"
-      "video/x-dv, systemstream=true, width=%d, height=%d",
-      max_width, max_height, max_width, max_height, max_width, max_height);
+  gst_caps_set_simple (caps, "width", G_TYPE_INT, gcc->priv->source_width,
+      "height", G_TYPE_INT, gcc->priv->source_height, "framerate",
+      GST_TYPE_FRACTION, gcc->priv->source_fps_n, gcc->priv->source_fps_d, NULL);
+  caps_str = gst_caps_to_string (caps);
   GST_INFO_OBJECT (gcc, "Source caps configured to: %s", caps_str);
-  rcaps = gst_caps_from_string (caps_str);
   g_free (caps_str);
-  return rcaps;
+  return caps;
 }
 
 static void
@@ -1074,7 +1066,7 @@ gst_camera_capturer_create_source (GstCameraCapturer *gcc,
   if (gst_caps_get_size (source_caps) != 0) {
     s = gst_caps_get_structure (source_caps, 0);
   }
-  if (s == NULL) { 
+  if (s == NULL) {
     gst_camera_capturer_fill_decodebin_source (gcc);
   } else if (gst_structure_has_name (s, "video/x-raw-yuv") ||
       gst_structure_has_name (s, "video/x-raw-rgb")) {
@@ -1085,7 +1077,7 @@ gst_camera_capturer_create_source (GstCameraCapturer *gcc,
     filter = gst_element_factory_make ("capsfilter", NULL);
     gst_bin_add (GST_BIN (bin), filter);
     gst_element_link (source, filter);
-    link_caps = gst_camera_capturer_find_highest_res (gcc, source_caps);
+    link_caps = gst_camera_capturer_source_caps (gcc);
     if (link_caps) {
       g_object_set (filter, "caps", link_caps, NULL);
       gst_caps_unref (link_caps);
@@ -1411,84 +1403,12 @@ gcc_get_video_stream_info (GstPad * pad, GstPad * peer, GstCameraCapturer * gcc)
   return FALSE;
 }
 
-/*****************************************************
- *
- *             Device Probe
- *
- * **************************************************/
-
-GList *
-gst_camera_capturer_enum_devices (const gchar * device_name)
-{
-  GstElement *device;
-  GstPropertyProbe *probe;
-  GValueArray *va;
-  gchar *prop_name;
-  GList *list = NULL;
-  guint i = 0;
-
-  device = gst_element_factory_make (device_name, "source");
-  if (!device || !GST_IS_PROPERTY_PROBE (device))
-    goto finish;
-  gst_element_set_state (device, GST_STATE_READY);
-  gst_element_get_state (device, NULL, NULL, 5 * GST_SECOND);
-  probe = GST_PROPERTY_PROBE (device);
-
-  if (!g_strcmp0 (device_name, "dv1394src"))
-    prop_name = "guid";
-  else if (!g_strcmp0 (device_name, "v4l2src") ||
-      !g_strcmp0 (device_name, "avfvideosrc"))
-    prop_name = "device";
-  else if (!g_strcmp0 (device_name, "filesrc"))
-    prop_name = "location";
-  else
-    prop_name = "device-name";
-
-  va = gst_property_probe_probe_and_get_values_name (probe, prop_name);
-  if (!va)
-    goto finish;
-
-  for (i = 0; i < va->n_values; ++i) {
-    GValue *v = g_value_array_get_nth (va, i);
-    GValue valstr = { 0, };
-
-    g_value_init (&valstr, G_TYPE_STRING);
-    if (!g_value_transform (v, &valstr))
-      continue;
-    list = g_list_append (list, g_value_dup_string (&valstr));
-    g_value_unset (&valstr);
-  }
-  g_value_array_free (va);
-
-finish:
-  {
-    if (device != NULL) {
-      gst_element_set_state (device, GST_STATE_NULL);
-      gst_object_unref (GST_OBJECT (device));
-    }
-    return list;
-  }
-}
-
-
 /*******************************************
  *
  *         Public methods
  *
  * ****************************************/
 
-GList *
-gst_camera_capturer_enum_video_devices (const gchar * device)
-{
-  return gst_camera_capturer_enum_devices (device);
-}
-
-GList *
-gst_camera_capturer_enum_audio_devices (const gchar * device)
-{
-  return gst_camera_capturer_enum_devices (device);
-}
-
 void
 gst_camera_capturer_run (GstCameraCapturer * gcc)
 {
@@ -1703,6 +1623,7 @@ void
 gst_camera_capturer_configure (GstCameraCapturer * gcc,
     const gchar * filename, CaptureSourceType source,
     const gchar * source_element, const gchar * device_id,
+    gint source_width, gint source_height, gint source_fps_n, gint source_fps_d,
     VideoEncoderType video_encoder, AudioEncoderType audio_encoder,
     VideoMuxerType muxer, guint video_bitrate, guint audio_bitrate,
     guint record_audio, guint output_width, guint output_height,
@@ -1721,6 +1642,10 @@ gst_camera_capturer_configure (GstCameraCapturer * gcc,
   gcc->priv->output_height = output_height;
   gcc->priv->output_width = output_width;
   gcc->priv->window_handle = window_handle;
+  gcc->priv->source_width = source_width;
+  gcc->priv->source_height = source_height;
+  gcc->priv->source_fps_n = source_fps_n;
+  gcc->priv->source_fps_d = source_fps_d;
 }
 
 GstCameraCapturer *
diff --git a/libcesarplayer/gst-camera-capturer.h b/libcesarplayer/gst-camera-capturer.h
index e617c13..91cc7ef 100644
--- a/libcesarplayer/gst-camera-capturer.h
+++ b/libcesarplayer/gst-camera-capturer.h
@@ -73,6 +73,10 @@ EXPORT void gst_camera_capturer_configure                (GstCameraCapturer *gcc
                                                           CaptureSourceType source,
                                                           const gchar *source_element,
                                                           const gchar *device_id,
+                                                          gint source_width,
+                                                          gint source_height,
+                                                          gint source_fps_n,
+                                                          gint source_fps_d,
                                                           VideoEncoderType video_encoder,
                                                           AudioEncoderType audio_encoder,
                                                           VideoMuxerType muxer,
diff --git a/libcesarplayer/lgm-device.c b/libcesarplayer/lgm-device.c
new file mode 100644
index 0000000..0582c26
--- /dev/null
+++ b/libcesarplayer/lgm-device.c
@@ -0,0 +1,329 @@
+/*
+ * Copyright (C) 2015  Andoni Morales Alastruey <ylatuya gmail com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "lgm-device.h"
+#include <gst/interfaces/propertyprobe.h>
+
+static LgmDeviceVideoFormat *
+lgm_device_video_format_new (gint width, gint height, gint fps_n, gint fps_d)
+{
+  LgmDeviceVideoFormat * format;
+
+  format = g_new0 (LgmDeviceVideoFormat, 1);
+  format->width = width;
+  format->height = height;
+  format->fps_n = fps_n;
+  format->fps_d = fps_d;
+
+  return format;
+}
+
+static void
+lgm_device_video_format_free (LgmDeviceVideoFormat *format)
+{
+  g_free (format);
+}
+
+static gint
+lgm_device_video_format_compare (LgmDeviceVideoFormat *f1,
+    LgmDeviceVideoFormat *f2)
+{
+  if (f1->height != f2->height) {
+    return f2->height - f1->height;
+  } else if ((f1->fps_n != f2->fps_n) || (f1->fps_d != f2->fps_d)) {
+    gfloat r1, r2;
+
+    r2 = (gfloat) f2->fps_n / f2->fps_d;
+    r1 = (gfloat) f1->fps_n / f1->fps_d;
+    return (gint) (r2 - r1);
+  } else if (f1->width != f2->width) {
+    return f2->width - f1->width;
+  } else {
+    return 0;
+  }
+}
+
+gchar *
+lgm_device_video_format_to_string (LgmDeviceVideoFormat *format)
+{
+  return g_strdup_printf ("%dx%d %d/%d", format->width, format->height,
+      format->fps_n, format->fps_d);
+}
+
+void
+lgm_device_video_format_get_info (LgmDeviceVideoFormat *format,
+    gint *width, gint *height, gint * fps_n, gint * fps_d)
+{
+  *width = format->width;
+  *height = format->height;
+  *fps_n = format->fps_n;
+  *fps_d = format->fps_d;
+}
+
+LgmDevice *
+lgm_device_new (const gchar *source_name, const gchar *device_name,
+    LgmDeviceType type)
+{
+  LgmDevice *device;
+
+  device = g_new0 (LgmDevice, 1);
+  device->source_name = g_strdup (source_name);
+  device->device_name = g_strdup (device_name);
+  device->type = type;
+  device->formats = NULL;
+
+  return device;
+}
+
+void
+lgm_device_free (LgmDevice *device)
+{
+  if (device->source_name != NULL) {
+    g_free (device->source_name);
+    device->source_name = NULL;
+  }
+  if (device->device_name != NULL) {
+    g_free (device->device_name);
+    device->device_name = NULL;
+  }
+  if (device->formats != NULL) {
+    g_list_free_full (device->formats,
+        (GDestroyNotify) lgm_device_video_format_free);
+    device->formats = NULL;
+  }
+  g_free (device);
+}
+
+GList *
+lgm_device_get_formats (LgmDevice *device)
+{
+  return device->formats;
+}
+
+gchar *
+lgm_device_get_source_name (LgmDevice *device)
+{
+  return g_strdup (device->source_name);
+}
+
+gchar *
+lgm_device_get_device_name (LgmDevice *device)
+{
+  return g_strdup (device->device_name);
+}
+
+static int
+lgm_device_fixate_int_value (const GValue *val)
+{
+  int ret;
+
+  if (G_VALUE_TYPE (val) == GST_TYPE_INT_RANGE) {
+    ret = gst_value_get_int_range_min (val);
+  } else if (G_VALUE_TYPE (val) == GST_TYPE_ARRAY) {
+    const GValue *kid = gst_value_array_get_value (val, 0);
+    ret = g_value_get_int (kid);
+  } else if (G_VALUE_TYPE (val) == GST_TYPE_LIST) {
+    const GValue *kid = gst_value_list_get_value (val, 0);
+    ret = g_value_get_int (kid);
+  } else {
+    ret = g_value_get_int (val);
+  }
+  return ret;
+}
+
+static void
+lgm_device_add_format (GHashTable *table, int width, int height,
+    const GValue *val)
+{
+  LgmDeviceVideoFormat * format;
+  gint fps_n, fps_d;
+  gchar *format_str;
+
+  fps_n = gst_value_get_fraction_numerator (val);
+  fps_d = gst_value_get_fraction_denominator (val);
+  format = lgm_device_video_format_new (width, height, fps_n, fps_d);
+  format_str = lgm_device_video_format_to_string (format);
+  if (!g_hash_table_contains(table, format_str)) {
+    g_hash_table_insert (table, format_str, format);
+    GST_DEBUG ("Adding format: %s\n", format_str);
+  } else {
+    g_free (format_str);
+    lgm_device_video_format_free (format);
+  }
+}
+
+static void
+lgm_device_parse_structure (GstStructure *s, GHashTable *table)
+{
+  gint width, height;
+  const GValue *val;
+  gchar *struct_str;
+
+  struct_str = gst_structure_to_string (s);
+  GST_DEBUG ("Parsing structure: %s\n", struct_str);
+  g_free (struct_str);
+
+  width = lgm_device_fixate_int_value (gst_structure_get_value (s, "width"));
+  height = lgm_device_fixate_int_value (gst_structure_get_value (s, "height"));
+
+  val = gst_structure_get_value (s, "framerate");
+  if (G_VALUE_TYPE (val) == GST_TYPE_FRACTION) {
+    lgm_device_add_format (table, width, height, val);
+  } else if (G_VALUE_TYPE (val) == GST_TYPE_FRACTION_RANGE) {
+    lgm_device_add_format (table, width, height,
+        gst_value_get_fraction_range_min (val));
+    lgm_device_add_format (table, width, height,
+        gst_value_get_fraction_range_max (val));
+  } else if (G_VALUE_TYPE (val) == GST_TYPE_ARRAY) {
+    guint n, len;
+
+    len = gst_value_array_get_size (val);
+    for (n = 0; n < len; n++) {
+      const GValue *kid = gst_value_array_get_value (val, n);
+      lgm_device_add_format (table, width, height, kid);
+    }
+  } else if (G_VALUE_TYPE (val) == GST_TYPE_LIST) {
+    guint n, len;
+
+    len = gst_value_list_get_size (val);
+    for (n = 0; n < len; n++) {
+      const GValue *kid = gst_value_list_get_value (val, n);
+      lgm_device_add_format (table, width, height, kid);
+    }
+  }
+}
+
+static void
+lgm_device_fill_formats (LgmDevice *device, gchar *prop_name)
+{
+  GstCaps *source_caps, *caps;
+  GstElement *source;
+  GstPad *pad;
+  GHashTable *table;
+  gint i;
+
+  source = gst_element_factory_make (device->source_name, NULL);
+  g_object_set (source, prop_name, device->device_name, NULL);
+  gst_element_set_state (source, GST_STATE_READY);
+  gst_element_get_state (source, NULL, NULL, 5 * GST_SECOND);
+  pad = gst_element_get_static_pad (source, "src");
+  source_caps = gst_pad_get_caps_reffed (pad);
+  caps = gst_caps_copy (source_caps);
+  gst_caps_unref (source_caps);
+
+  table = g_hash_table_new_full (g_str_hash, g_str_equal,
+      g_free, NULL);
+
+  GST_DEBUG ("Filling formats for source:%s device:%s", device->source_name,
+      device->device_name);
+  for (i=0; i < gst_caps_get_size (caps); i++) {
+    GstStructure *s;
+
+    s = gst_caps_get_structure (caps, i);
+    if (gst_structure_has_name (s, "video/x-raw-yuv") ||
+        gst_structure_has_name (s, "video/x-raw-rgb") ||
+        gst_structure_has_name (s, "video/x-dv")) {
+      lgm_device_parse_structure (s, table);
+    }
+  }
+  device->formats = g_hash_table_get_values (table);
+  device->formats = g_list_sort (device->formats,
+      (GCompareFunc) lgm_device_video_format_compare);
+  g_hash_table_unref (table);
+
+  gst_element_set_state (source, GST_STATE_NULL);
+  gst_element_get_state (source, NULL, NULL, 5 * GST_SECOND);
+  gst_object_unref (pad);
+  gst_caps_unref (caps);
+}
+
+GList *
+lgm_device_enum_devices (const gchar * source_name,
+    LgmDeviceType type)
+{
+  GstElement *source;
+  GstPropertyProbe *probe;
+  GValueArray *va;
+  gchar *prop_name;
+  GList *list = NULL;
+  guint i = 0;
+
+  source = gst_element_factory_make (source_name, "source");
+  if (!source || !GST_IS_PROPERTY_PROBE (source))
+    goto finish;
+  gst_element_set_state (source, GST_STATE_READY);
+  gst_element_get_state (source, NULL, NULL, 5 * GST_SECOND);
+  probe = GST_PROPERTY_PROBE (source);
+
+  if (!g_strcmp0 (source_name, "dv1394src"))
+    prop_name = "guid";
+  else if (!g_strcmp0 (source_name, "v4l2src") ||
+      !g_strcmp0 (source_name, "avfvideosrc"))
+    prop_name = "device";
+  else if (!g_strcmp0 (source_name, "filesrc"))
+    prop_name = "location";
+  else
+    prop_name = "device-name";
+
+  va = gst_property_probe_probe_and_get_values_name (probe, prop_name);
+  gst_element_set_state (source, GST_STATE_NULL);
+  gst_element_get_state (source, NULL, NULL, 5 * GST_SECOND);
+  gst_object_unref (source);
+
+  if (!va)
+    goto finish;
+
+
+  for (i = 0; i < va->n_values; ++i) {
+    GValue *v = g_value_array_get_nth (va, i);
+    GValue valstr = { 0, };
+    LgmDevice *device;
+    gchar *name;
+
+    g_value_init (&valstr, G_TYPE_STRING);
+    if (!g_value_transform (v, &valstr))
+      continue;
+
+    name = g_value_dup_string (&valstr);
+    device = lgm_device_new (source_name, name, type);
+    g_value_unset (&valstr);
+    g_free (name);
+
+    lgm_device_fill_formats (device, prop_name);
+    list = g_list_append (list, device);
+  }
+  g_value_array_free (va);
+
+finish:
+  {
+    return list;
+  }
+}
+
+GList *
+lgm_device_enum_video_devices (const gchar * device)
+{
+  return lgm_device_enum_devices (device, LGM_DEVICE_TYPE_VIDEO);
+}
+
+GList *
+lgm_device_enum_audio_devices (const gchar * device)
+{
+  return lgm_device_enum_devices (device, LGM_DEVICE_TYPE_AUDIO);
+}
diff --git a/libcesarplayer/lgm-device.h b/libcesarplayer/lgm-device.h
new file mode 100644
index 0000000..1e8ea02
--- /dev/null
+++ b/libcesarplayer/lgm-device.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2015  Andoni Morales Alastruey <ylatuya gmail com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef __LGM_DEVICE_H__
+#define __LGM_DEVICE_H__
+
+#include "lgm-utils.h"
+
+G_BEGIN_DECLS
+
+typedef struct _LgmDeviceVideoFormat LgmDeviceVideoFormat;
+
+typedef struct _LgmDevice LgmDevice;
+
+typedef enum
+{
+  LGM_DEVICE_TYPE_VIDEO,
+  LGM_DEVICE_TYPE_AUDIO,
+} LgmDeviceType;
+
+struct _LgmDeviceVideoFormat
+{
+  gint width;
+  gint height;
+  gint fps_n;
+  gint fps_d;
+};
+
+struct _LgmDevice
+{
+  gchar *source_name;
+  gchar *device_name;
+  LgmDeviceType type;
+  GList *formats;
+};
+
+
+EXPORT LgmDevice*  lgm_device_new                   (const gchar *source_name,
+                                                     const gchar *device_name,
+                                                     LgmDeviceType type);
+
+EXPORT void       lgm_device_free                   (LgmDevice *device);
+
+EXPORT GList *    lgm_device_get_formats            (LgmDevice *device);
+
+EXPORT gchar *    lgm_device_get_source_name        (LgmDevice *device);
+
+EXPORT gchar *    lgm_device_get_device_name        (LgmDevice *device);
+
+EXPORT void       lgm_device_video_format_get_info  (LgmDeviceVideoFormat *format,
+                                                    gint *width, gint *height,
+                                                    gint * fps_n, gint * fps_d);
+
+EXPORT GList *    lgm_device_enum_video_devices     (const gchar *source_name);
+
+EXPORT GList *    lgm_device_enum_audio_devices     (const gchar *source_name);
+
+G_END_DECLS
+#endif
diff --git a/libcesarplayer/liblongomatch.cproj b/libcesarplayer/liblongomatch.cproj
index d47d7d3..a32720e 100644
--- a/libcesarplayer/liblongomatch.cproj
+++ b/libcesarplayer/liblongomatch.cproj
@@ -62,7 +62,7 @@
     <None Include="gst-nle-source.h" />
     <None Include="lgm-gtk-glue.h" />
     <None Include="lgm-utils.h" />
-    <None Include="lgm-utils.m" />
+    <None Include="lgm-device.h" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="gst-camera-capturer.c" />
@@ -75,5 +75,7 @@
     <Compile Include="gst-nle-source.c" />
     <Compile Include="lgm-video-player.c" />
     <Compile Include="lgm-gtk-glue.c" />
+    <Compile Include="lgm-device.c" />
+    <Compile Include="lgm-utils.m" />
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/libcesarplayer/test-capturer.c b/libcesarplayer/test-capturer.c
index abc8057..c3f6d3b 100644
--- a/libcesarplayer/test-capturer.c
+++ b/libcesarplayer/test-capturer.c
@@ -19,7 +19,7 @@
 
 #include <gtk/gtk.h>
 #include "gst-camera-capturer.h"
-#include "lgm-utils.h"
+#include "lgm-device.h"
 
 static GtkWidget *recbutton, *stopbutton;
 static int sargc;
@@ -55,6 +55,7 @@ on_realized_cb (GtkWidget * video)
   gvc = gst_camera_capturer_new (&error);
   gst_camera_capturer_configure (gvc, sargv[1],
       (CaptureSourceType) atoi(sargv[4]), sargv[2], sargv[3],
+      0, 0, 0, 0,
       VIDEO_ENCODER_H264, AUDIO_ENCODER_AAC,
       VIDEO_MUXER_MP4, 1000, 100, TRUE, 320, 240, window);
   gst_camera_capturer_run (gvc);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]