[longomatch] Remove avconv remuxer and use the GStreamer one



commit 80fea4f60f5439168ba930f3f60dbbee3ee277dc
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Nov 22 11:48:39 2014 +0100

    Remove avconv remuxer and use the GStreamer one

 LongoMatch.GUI.Helpers/Misc.cs                     |   13 +--
 LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs     |    4 +-
 LongoMatch.GUI.Multimedia/MultimediaToolkit.cs     |   12 ++-
 LongoMatch.GUI/Makefile.am                         |    4 +-
 LongoMatch.Multimedia/LongoMatch.Multimedia.csproj |    1 -
 LongoMatch.Multimedia/Makefile.am                  |    1 -
 LongoMatch.Multimedia/Remuxer/MpegRemuxer.cs       |  103 --------------------
 LongoMatch.Multimedia/Utils/MultimediaFactory.cs   |   12 +--
 8 files changed, 20 insertions(+), 130 deletions(-)
---
diff --git a/LongoMatch.GUI.Helpers/Misc.cs b/LongoMatch.GUI.Helpers/Misc.cs
index 9cf01c5..970eed7 100644
--- a/LongoMatch.GUI.Helpers/Misc.cs
+++ b/LongoMatch.GUI.Helpers/Misc.cs
@@ -307,13 +307,12 @@ namespace LongoMatch.Gui.Helpers
                                if(mediaFile.HasVideo && mediaFile.Duration.MSeconds == 0)
                                        throw new Exception(Catalog.GetString("This file contains a video 
stream but its length is 0."));
                                if (multimedia.FileNeedsRemux (mediaFile)) {
-                                       string q = Catalog.GetString("The file you are trying to load is not 
properly supported. " +
-                                                                            "Would you like to convert it 
into a more suitable format?");
-                                       if (gui.QuestionMessage (q, Catalog.GetString ("Convert"), null)) {
-                                               string newFilename = multimedia.RemuxFile (mediaFile, parent);
-                                               if (newFilename != null)
-                                                       mediaFile = multimedia.DiscoverFile (newFilename);
-                                       }
+                                       string q = Catalog.GetString("This file needs to be converted into a 
more suitable format." +
+                                                                    "(this step only requires a few 
minutes)");
+                                       gui.InfoMessage (q, parent);
+                                       string newFilename = multimedia.RemuxFile (mediaFile, parent);
+                                       if (newFilename != null)
+                                               mediaFile = multimedia.DiscoverFile (newFilename);
                                }
                        }
                        catch(Exception ex) {
diff --git a/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs b/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs
index 143a235..e3f3dd6 100644
--- a/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs
+++ b/LongoMatch.GUI.Multimedia/Gui/Utils/Remuxer.cs
@@ -43,11 +43,9 @@ namespace LongoMatch.Video.Utils
                Window parent;
                
                public Remuxer (MediaFile inputFile, string outputFilepath = null,
-                               VideoMuxerType muxer = VideoMuxerType.Mp4)
+                               VideoMuxerType muxer = VideoMuxerType.Matroska)
                {
                        this.inputFile = inputFile;
-                       if (inputFile.Container == GStreamer.ASF)
-                               muxer = VideoMuxerType.Matroska;
                        this.muxer = muxer;
                        
                        if (outputFilepath != null) {
diff --git a/LongoMatch.GUI.Multimedia/MultimediaToolkit.cs b/LongoMatch.GUI.Multimedia/MultimediaToolkit.cs
index 17b400f..af1d421 100644
--- a/LongoMatch.GUI.Multimedia/MultimediaToolkit.cs
+++ b/LongoMatch.GUI.Multimedia/MultimediaToolkit.cs
@@ -20,8 +20,9 @@
 using LongoMatch.Video.Utils;
 using LongoMatch.Core.Interfaces.Multimedia;
 using LongoMatch.Core.Store;
-
-using Remuxer = LongoMatch.Video.Utils;
+using LongoMatch.Core.Common;
+using Mono.Unix;
+using System.IO;
 
 namespace LongoMatch.Video
 {
@@ -29,7 +30,12 @@ namespace LongoMatch.Video
        public class MultimediaToolkit:MultimediaFactory, IMultimediaToolkit
        {
                public string RemuxFile (MediaFile file, object window) {
-                       LongoMatch.Video.Utils.Remuxer remuxer = new LongoMatch.Video.Utils.Remuxer (file);
+                       string outputFile = Config.GUIToolkit.SaveFile (Catalog.GetString ("Output file"),
+                                                                       Path.ChangeExtension (file.FilePath, 
".mkv"),
+                                                                       Path.GetDirectoryName (file.FilePath),
+                                                                       "Matroska (.mkv)", new string[] { 
".mkv"});
+                       outputFile = Path.ChangeExtension (outputFile, ".mkv");
+                       Utils.Remuxer remuxer = new Utils.Remuxer (file, outputFile, VideoMuxerType.Matroska);
                        return remuxer.Remux (window as Gtk.Window);
                }
        }
diff --git a/LongoMatch.GUI/Makefile.am b/LongoMatch.GUI/Makefile.am
index c7c9a82..f951205 100644
--- a/LongoMatch.GUI/Makefile.am
+++ b/LongoMatch.GUI/Makefile.am
@@ -144,9 +144,7 @@ RESOURCES = gtk-gui/gui.stetic \
        $(top_srcdir)/images/tools/line-double-dot.svg \
        $(top_srcdir)/images/tools/line-dot.svg \
        $(top_srcdir)/images/tools/line-double-arrow.svg \
-       $(top_srcdir)/images/tools/line-arrow.svg \
-       $(top_srcdir)/data/images/longomatch-light-bg.svg \
-       $(top_srcdir)/data/images/longomatch-dark-bg.svg
+       $(top_srcdir)/images/tools/line-arrow.svg
 
 DLLCONFIG = LongoMatch.GUI.dll.config
 
diff --git a/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj 
b/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
index a6b3e7a..3560a63 100644
--- a/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
+++ b/LongoMatch.Multimedia/LongoMatch.Multimedia.csproj
@@ -47,7 +47,6 @@
     <Compile Include="Converter\GstVideoConverter.cs" />
     <Compile Include="Converter\ObjectManager.cs" />
     <Compile Include="Utils\Seeker.cs" />
-    <Compile Include="Remuxer\MpegRemuxer.cs" />
     <Compile Include="Utils\MultimediaFactory.cs" />
     <Compile Include="Player\GstPlayer.cs" />
     <Compile Include="Player\ObjectManager.cs" />
diff --git a/LongoMatch.Multimedia/Makefile.am b/LongoMatch.Multimedia/Makefile.am
index 5c1d00c..0f46226 100644
--- a/LongoMatch.Multimedia/Makefile.am
+++ b/LongoMatch.Multimedia/Makefile.am
@@ -17,7 +17,6 @@ SOURCES = Capturer/FakeCapturer.cs \
        Player/GstPlayer.cs \
        Player/ObjectManager.cs \
        Remuxer/GstRemuxer.cs \
-       Remuxer/MpegRemuxer.cs \
        Remuxer/ObjectManager.cs \
        Utils/GStreamer.cs \
        Utils/GstDiscoverer.cs \
diff --git a/LongoMatch.Multimedia/Utils/MultimediaFactory.cs 
b/LongoMatch.Multimedia/Utils/MultimediaFactory.cs
index f85c800..77bc1c5 100644
--- a/LongoMatch.Multimedia/Utils/MultimediaFactory.cs
+++ b/LongoMatch.Multimedia/Utils/MultimediaFactory.cs
@@ -91,15 +91,9 @@ namespace LongoMatch.Video
 
                public IRemuxer GetRemuxer (MediaFile inputFile, string outputFile, VideoMuxerType muxer)
                {
-                       if (inputFile.Container == GStreamer.MPEG1_PS ||
-                               inputFile.Container == GStreamer.MPEG2_PS ||
-                               inputFile.Container == GStreamer.MPEG2_TS) {
-                               return new MpegRemuxer (inputFile.FilePath, outputFile);
-                       } else {
-                               return GetDefaultElement<IRemuxer> (typeof(IRemuxer),
-                                                                   inputFile.FilePath,
-                                                                   outputFile, muxer);
-                       }
+                       return GetDefaultElement<IRemuxer> (typeof(IRemuxer),
+                                                           inputFile.FilePath,
+                                                           outputFile, muxer);
                }
 
                public MediaFile DiscoverFile (string file, bool takeScreenshot = true)


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