[longomatch] Add 'VGA' and 'Portable' size formats to video editor
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [longomatch] Add 'VGA' and 'Portable' size formats to video editor
- Date: Thu, 17 Sep 2009 17:50:32 +0000 (UTC)
commit 4fcfb5d28b62681705ab2671e5c75fc13d47f53d
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Wed Sep 16 21:50:08 2009 +0200
Add 'VGA' and 'Portable' size formats to video editor
CesarPlayer/Editor/GstVideoSplitter.cs | 10 ++++-
CesarPlayer/Editor/VideoFormat.cs | 8 ++-
LongoMatch/Gui/Component/PlayListWidget.cs | 7 +--
LongoMatch/Gui/Dialog/VideoEditionProperties.cs | 51 +++++++++----------
...LongoMatch.Gui.Dialog.VideoEditionProperties.cs | 11 ++---
LongoMatch/gtk-gui/gui.stetic | 12 ++---
LongoMatch/gtk-gui/objects.xml | 20 ++++----
libcesarplayer/src/gst-video-editor.c | 4 +-
8 files changed, 60 insertions(+), 63 deletions(-)
---
diff --git a/CesarPlayer/Editor/GstVideoSplitter.cs b/CesarPlayer/Editor/GstVideoSplitter.cs
index e044b14..3bd8641 100644
--- a/CesarPlayer/Editor/GstVideoSplitter.cs
+++ b/CesarPlayer/Editor/GstVideoSplitter.cs
@@ -367,7 +367,15 @@ namespace LongoMatch.Video.Editor {
public VideoFormat VideoFormat{
set{
- if (value == VideoFormat.TV){
+ if (value == VideoFormat.PORTABLE){
+ Height = 240;
+ Width = 320;
+ }
+ else if (value == VideoFormat.VGA){
+ Height = 480 ;
+ Width = 640;
+ }
+ else if (value == VideoFormat.TV){
Height = 576;
Width = 720;
}
diff --git a/CesarPlayer/Editor/VideoFormat.cs b/CesarPlayer/Editor/VideoFormat.cs
index a7d2b73..687f099 100644
--- a/CesarPlayer/Editor/VideoFormat.cs
+++ b/CesarPlayer/Editor/VideoFormat.cs
@@ -24,8 +24,10 @@ namespace LongoMatch.Video.Editor
public enum VideoFormat
{
- TV,
- HD720p,
- HD1080p
+ PORTABLE=0,
+ VGA=1,
+ TV=2,
+ HD720p=3,
+ HD1080p=4
}
}
diff --git a/LongoMatch/Gui/Component/PlayListWidget.cs b/LongoMatch/Gui/Component/PlayListWidget.cs
index b46dc87..d72dc7d 100644
--- a/LongoMatch/Gui/Component/PlayListWidget.cs
+++ b/LongoMatch/Gui/Component/PlayListWidget.cs
@@ -281,13 +281,8 @@ namespace LongoMatch.Gui.Component
videoEditor.VideoCodec = vep.VideoCodec;
videoEditor.OutputFile = vep.Filename;
videoEditor.EnableTitle = vep.TitleOverlay;
- /*if (vep.VideoCodec== VideoCodec.MPEG2_VIDEO)
- videoEditor.EnableAudio = false;
- else*/
- videoEditor.EnableAudio = vep.EnableAudio;
+ videoEditor.EnableAudio = vep.EnableAudio;
videoEditor.VideoMuxer = vep.VideoMuxer;
- //FIXME 0.16 Not used anymore with the GNonlin editor
- videoEditor.TempDir = MainClass.TempVideosDir();
videoEditor.Start();
closebutton.Show();
newvideobutton.Hide();
diff --git a/LongoMatch/Gui/Dialog/VideoEditionProperties.cs b/LongoMatch/Gui/Dialog/VideoEditionProperties.cs
index b9992b3..1c703dd 100644
--- a/LongoMatch/Gui/Dialog/VideoEditionProperties.cs
+++ b/LongoMatch/Gui/Dialog/VideoEditionProperties.cs
@@ -35,15 +35,24 @@ namespace LongoMatch.Gui.Dialog
private VideoCodec vcodec;
private AudioCodec acodec;
private VideoMuxer muxer;
+
+ private const string MP4="MP4 (H.264+AAC)";
+ private const string AVI="AVI (Xvid+MP3)";
+ private const string OGG="OGG (Theora+Vorbis)";
+ private const string DVD="DVD (MPEG-2)";
+
#region Constructors
public VideoEditionProperties()
{
- this.Build();
- if (System.Environment.OSVersion.Platform == PlatformID.Win32NT){
- formatcombobox.RemoveText(1);
- formatcombobox.RemoveText(2);
- }
+ this.Build();
+ formatcombobox.AppendText(MP4);
+ formatcombobox.AppendText(AVI);
+ if (System.Environment.OSVersion.Platform != PlatformID.Win32NT){
+ formatcombobox.AppendText(OGG);
+ formatcombobox.AppendText(DVD);
+ }
+ formatcombobox.Active=0;
}
#endregion
@@ -85,11 +94,11 @@ namespace LongoMatch.Gui.Dialog
#region Private Methods
private string GetExtension(){
- if (formatcombobox.ActiveText == "Matroska (H.264+AAC)")
+ if (formatcombobox.ActiveText == MP4)
return "mkv";
- else if (formatcombobox.ActiveText == "OGG (Theora+Vorbis)")
+ else if (formatcombobox.ActiveText == OGG)
return "ogg";
- else if (formatcombobox.ActiveText == "Avi (Xvid+MP3)")
+ else if (formatcombobox.ActiveText == AVI)
return "avi";
else
return "mpg";
@@ -112,42 +121,31 @@ namespace LongoMatch.Gui.Dialog
vq = VideoQuality.Extra;
}
- if (sizecombobox.ActiveText == "TV (4:3 - 720x540)"){
- vf = VideoFormat.TV;
- }
- else if (sizecombobox.ActiveText == "HD 720p (16:9 - 1280x720)"){
- vf = VideoFormat.HD720p;
- }
- else if (sizecombobox.ActiveText == "Full HD 1080p (16:9 - 1920x1080)"){
- vf = VideoFormat.HD1080p;
- }
+ vf = (VideoFormat)sizecombobox.Active;
-
- if (formatcombobox.ActiveText == "Matroska (H.264+AAC)"){
+ if (formatcombobox.ActiveText == MP4){
vcodec = VideoCodec.H264;
acodec = AudioCodec.AAC;
muxer = VideoMuxer.MKV;
}
- else if (formatcombobox.ActiveText == "OGG (Theora+Vorbis)"){
+ else if (formatcombobox.ActiveText == OGG){
vcodec = VideoCodec.THEORA;
acodec = AudioCodec.VORBIS;
muxer = VideoMuxer.OGG;
}
- else if (formatcombobox.ActiveText == "Avi (Xvid+MP3)"){
+ else if (formatcombobox.ActiveText == AVI){
vcodec = VideoCodec.XVID;
acodec = AudioCodec.MP3;
muxer = VideoMuxer.AVI;
}
- else if (formatcombobox.ActiveText == "DVD (MPEG-2)"){
+ else if (formatcombobox.ActiveText == DVD){
vcodec = VideoCodec.MPEG2_VIDEO;
acodec = AudioCodec.MPEG2_AUDIO;
muxer = VideoMuxer.DVD;
- }
-
+ }
Hide();
}
-
protected virtual void OnOpenbuttonClicked (object sender, System.EventArgs e)
{
FileChooserDialog fChooser = new FileChooserDialog(Catalog.GetString("Save Video As ..."),
@@ -168,8 +166,7 @@ namespace LongoMatch.Gui.Dialog
fChooser.Filter = filter;
if (fChooser.Run() == (int)ResponseType.Accept){
fileentry.Text = fChooser.Filename;
- }
-
+ }
fChooser.Destroy();
}
}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.VideoEditionProperties.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.VideoEditionProperties.cs
index 6db3872..b448d46 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.VideoEditionProperties.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Dialog.VideoEditionProperties.cs
@@ -117,11 +117,13 @@ namespace LongoMatch.Gui.Dialog {
w5.Position = 0;
// Container child hbox4.Gtk.Box+BoxChild
this.sizecombobox = Gtk.ComboBox.NewText();
- this.sizecombobox.AppendText(Mono.Unix.Catalog.GetString("TV (4:3 - 720x540)"));
+ this.sizecombobox.AppendText(Mono.Unix.Catalog.GetString("Portable (4:3 - 320x240)"));
+ this.sizecombobox.AppendText(Mono.Unix.Catalog.GetString("VGA (4:3 - 640x480)"));
+ this.sizecombobox.AppendText(Mono.Unix.Catalog.GetString("TV (4:3 - 720x576)"));
this.sizecombobox.AppendText(Mono.Unix.Catalog.GetString("HD 720p (16:9 - 1280x720)"));
this.sizecombobox.AppendText(Mono.Unix.Catalog.GetString("Full HD 1080p (16:9 - 1920x1080)"));
this.sizecombobox.Name = "sizecombobox";
- this.sizecombobox.Active = 0;
+ this.sizecombobox.Active = 1;
this.hbox4.Add(this.sizecombobox);
Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.hbox4[this.sizecombobox]));
w6.Position = 1;
@@ -145,12 +147,7 @@ namespace LongoMatch.Gui.Dialog {
w8.Position = 0;
// Container child hbox5.Gtk.Box+BoxChild
this.formatcombobox = Gtk.ComboBox.NewText();
- this.formatcombobox.AppendText(Mono.Unix.Catalog.GetString("Matroska (H.264+AAC)"));
- this.formatcombobox.AppendText(Mono.Unix.Catalog.GetString("OGG (Theora+Vorbis)"));
- this.formatcombobox.AppendText(Mono.Unix.Catalog.GetString("Avi (Xvid+MP3)"));
- this.formatcombobox.AppendText(Mono.Unix.Catalog.GetString("DVD (MPEG-2)"));
this.formatcombobox.Name = "formatcombobox";
- this.formatcombobox.Active = 0;
this.hbox5.Add(this.formatcombobox);
Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.hbox5[this.formatcombobox]));
w9.Position = 1;
diff --git a/LongoMatch/gtk-gui/gui.stetic b/LongoMatch/gtk-gui/gui.stetic
index a2bff15..432e313 100644
--- a/LongoMatch/gtk-gui/gui.stetic
+++ b/LongoMatch/gtk-gui/gui.stetic
@@ -2541,10 +2541,12 @@ Extra</property>
<widget class="Gtk.ComboBox" id="sizecombobox">
<property name="MemberName" />
<property name="IsTextCombo">True</property>
- <property name="Items">TV (4:3 - 720x540)
+ <property name="Items">Portable (4:3 - 320x240)
+VGA (4:3 - 640x480)
+TV (4:3 - 720x576)
HD 720p (16:9 - 1280x720)
Full HD 1080p (16:9 - 1920x1080)</property>
- <property name="Active">0</property>
+ <property name="Active">1</property>
</widget>
<packing>
<property name="Position">1</property>
@@ -2579,11 +2581,7 @@ Full HD 1080p (16:9 - 1920x1080)</property>
<widget class="Gtk.ComboBox" id="formatcombobox">
<property name="MemberName" />
<property name="IsTextCombo">True</property>
- <property name="Items">Matroska (H.264+AAC)
-OGG (Theora+Vorbis)
-Avi (Xvid+MP3)
-DVD (MPEG-2)</property>
- <property name="Active">0</property>
+ <property name="Items" />
</widget>
<packing>
<property name="Position">1</property>
diff --git a/LongoMatch/gtk-gui/objects.xml b/LongoMatch/gtk-gui/objects.xml
index 7d1055e..a3cacea 100644
--- a/LongoMatch/gtk-gui/objects.xml
+++ b/LongoMatch/gtk-gui/objects.xml
@@ -103,16 +103,6 @@
</itemgroup>
</signals>
</object>
- <object type="LongoMatch.Gui.Component.PlayListWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
- <itemgroups />
- <signals>
- <itemgroup label="PlayListWidget Signals">
- <signal name="PlayListNodeSelected" />
- <signal name="ApplyCurrentRate" />
- <signal name="Progress" />
- </itemgroup>
- </signals>
- </object>
<object type="LongoMatch.Gui.Component.ProjectListWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
<itemgroups />
<signals>
@@ -230,4 +220,14 @@
</itemgroups>
<signals />
</object>
+ <object type="LongoMatch.Gui.Component.PlayListWidget" palette-category="LongoMatch" allow-children="false" base-type="Gtk.Bin">
+ <itemgroups />
+ <signals>
+ <itemgroup label="PlayListWidget Signals">
+ <signal name="PlayListNodeSelected" />
+ <signal name="ApplyCurrentRate" />
+ <signal name="Progress" />
+ </itemgroup>
+ </signals>
+ </object>
</objects>
\ No newline at end of file
diff --git a/libcesarplayer/src/gst-video-editor.c b/libcesarplayer/src/gst-video-editor.c
index 37164c4..e737b60 100644
--- a/libcesarplayer/src/gst-video-editor.c
+++ b/libcesarplayer/src/gst-video-editor.c
@@ -237,7 +237,7 @@ gst_video_editor_class_init (GstVideoEditorClass *klass)
G_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_WIDTH,
g_param_spec_int ("width", NULL,
- NULL, 340, 1920,720,
+ NULL, 320, 1920,720,
G_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_OUTPUT_FILE,
@@ -1079,7 +1079,7 @@ gst_video_editor_set_audio_encoder (GstVideoEditor *gve, gchar **err, GvsAudioCo
/*Create new encoder bin's src pad*/
srcpad = gst_element_get_static_pad(gve->priv->audioencoder,"src");
gst_pad_set_active (srcpad, TRUE);
- gst_element_add_pad (gve->priv->aencode_bin, gst_ghost_pad_new ("src", srcpad));
+ gst_element_add_pad (gve->priv->aencode_bin, gst_ghost_pad_new ("src", srcpad));
if (gve->priv->audio_enabled)
gst_element_link(gve->priv->aencode_bin, gve->priv->muxer);
gve_rewrite_headers(gve);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]