git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorvasary.daniel <TFS\vasary.daniel>
Thu, 12 Nov 2020 14:43:11 +0000 (14:43 +0000)
committervasary.daniel <TFS\vasary.daniel>
Thu, 12 Nov 2020 14:43:11 +0000 (14:43 +0000)
client/Maestro/MaestroForm.Source.cs
client/Maestro/Properties/AssemblyInfo.cs
client/Maestro/RestoreMedia.cs
client/MaestroShared/Properties/AssemblyInfo.cs
client/MaestroShared/Targets/FTPTargetProcessor.cs
client/MaestroShared/Targets/UNCTargetProcessor.cs
server/-dependencies/libs/libhumblevideo-0.dll [new file with mode: 0644]
server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java

index e51b6464348097e70133094d12a09befe1f88a2e..dbce69ab1fe4552ac440a34858d7b86a970e1c67 100644 (file)
@@ -8,6 +8,7 @@ using MaestroShared.Metadata;
 using MaestroShared.Resources;\r
 using MaestroShared.Target;\r
 using MaestroShared.Targets;\r
+using Newtonsoft.Json;\r
 using System;\r
 using System.Collections.Generic;\r
 using System.Diagnostics;\r
@@ -124,9 +125,13 @@ namespace Maestro {
             doc.Load(discMeta);\r
 \r
             string itemHouseId = null;\r
+            string discName = null;\r
             try {\r
                 XmlNode node = doc.DocumentElement.GetElementsByTagName("UserDiscId")[0];\r
                 itemHouseId = node.Attributes["value"].Value;\r
+                node = doc.DocumentElement.GetElementsByTagName("MainTitle")[0];\r
+                discName = node.Attributes["usAscii"].Value;\r
+\r
             } catch {\r
                 logger.Info("discmeta.xml doesn't contains UserDiscId, skipping auto process");\r
                 return;\r
@@ -134,11 +139,11 @@ namespace Maestro {
 \r
 \r
             if (MsgBox.YesNoQuestion("Új betöltendő tartalmat deketáltam. Indulhat az automatikus betöltés?"))\r
-                BeginInvoke(new Action(() => AutoProcess(files, target, itemHouseId)));\r
+                BeginInvoke(new Action(() => AutoProcess(files, target, itemHouseId, discName)));\r
             \r
         }\r
 \r
-        private void AutoProcess(string[] files, Target target, string itemHouseId) {\r
+        private void AutoProcess(string[] files, Target target, string itemHouseId, string discName) {\r
 \r
             long count = files.Count() / 2;\r
             logger.Info($"Auto processing {count} items");\r
@@ -157,12 +162,15 @@ namespace Maestro {
                 string proxy = file.Replace("\\Clip\\", "\\Sub\\");\r
                 proxy = proxy.Substring(0, proxy.LastIndexOf(".")) + "S01" + proxy.Substring(proxy.LastIndexOf("."));\r
 \r
+\r
                 FileInfo proxyFi = new FileInfo(proxy);\r
                 if (!proxyFi.Exists) {\r
                     logger.Info($"Proxy {proxy} not exists, skipping {file}");\r
                     continue;\r
                 }\r
 \r
+                logger.Info($"Using proxy {proxy}");\r
+\r
                 TargetProcessorParameter processorParameter = null;\r
                 try {\r
                     //mxf metadata + duration\r
@@ -172,6 +180,13 @@ namespace Maestro {
                     metadata.mediaHouseId = metadata.mediaTitle;\r
                     metadata.mediaTitle = sourceItem.FileInfo.Name;\r
                     processorParameter = CreateProcessorParameter(target, sourceItem, metadata, DateTime.Now, null);\r
+\r
+\r
+                    var serializedTargetConfig = JsonConvert.SerializeObject(processorParameter.TargetConfig);\r
+                    Target targetConfig = JsonConvert.DeserializeObject<Target>(serializedTargetConfig);\r
+                    targetConfig.OutputFormat = discName + "-" + targetConfig.OutputFormat;\r
+\r
+                    processorParameter.TargetConfig = targetConfig;\r
                     processorParameter.ProxyPath = proxy;\r
                 } catch (Exception e) {\r
                     logger.Error(e.Message);\r
index 0d9faa6ee04ad220eb4921255c109252db51781c..8e656c191f2b761608be203a2b3f8ae5ef4708a9 100644 (file)
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers\r
 // by using the '*' as shown below:\r
 // [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("2.1.1.0")]\r
-[assembly: AssemblyFileVersion("2.1.1.0")]\r
+[assembly: AssemblyVersion("2.1.1.1")]\r
+[assembly: AssemblyFileVersion("2.1.1.1")]\r
index 45591277054148ed07aa92cbfb27d8c725006e49..18115a13be55af0ffa09ec701fd73b717af59751 100644 (file)
@@ -54,7 +54,7 @@ namespace Maestro {
                 { "mediaCubeMedia", selectedMetadata.RedefineMedia.Serialize() }\r
             };\r
             logger.Info("Submitting {0}", data.ToString());\r
-            api.SubmitJob(mediaCubeMetadata.JobTemplate, data);\r
+            api.SubmitJob(mediaCubeMetadata.JobTemplate, "Visszatöltés", data);\r
         }\r
 \r
         private void RestoreMedia_FormClosing(object sender, FormClosingEventArgs e) {\r
index 44a99e1f9d54912d5a7f9d08bff173cb6c444fb7..6846506aa2f38e6df3ccb304a58ceb700ff58cd0 100644 (file)
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 // You can specify all the values or you can default the Build and Revision Numbers\r
 // by using the '*' as shown below:\r
 // [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("2.1.0.6")]\r
-[assembly: AssemblyFileVersion("2.1.0.6")]\r
+[assembly: AssemblyVersion("2.1.0.7")]\r
+[assembly: AssemblyFileVersion("2.1.0.7")]\r
index a535c95d13368c7142c819d9eb65e7a99ec2b71b..b26e493bef81f7fd2c6028550ef0da0fa5761b84 100644 (file)
@@ -109,6 +109,9 @@ namespace MaestroShared.Targets {
             }\r
         }\r
 \r
+        protected override void UploadProxy() {\r
+            throw new Exception("Proxy upload not supported in FTPTargetProcessor!");\r
+        }\r
         protected override void UploadContent(string outputPath, byte[] content) {\r
             using (Stream ostream = targetFTP.OpenWrite(outputPath, FtpDataType.Binary, false)) {\r
                 try {\r
index 4e866041fc0955dd24db44500427ed80663f6573..459383bfc2d99665d1e7cc12b523c868e0cbfc79 100644 (file)
@@ -43,6 +43,7 @@ namespace MaestroShared.Targets {
         protected FileInfo inputFile;\r
         protected string workingDir;\r
         private string sourcePath;\r
+        private int CurrentFileVersion = 0;\r
 \r
         public WorkflowAction workFlowAction { get; set; }\r
 \r
@@ -455,7 +456,15 @@ namespace MaestroShared.Targets {
         protected virtual void UploadProxy() {\r
             int pbCancel = 0;\r
             string outputPath = Path.GetDirectoryName(Output);\r
-            string outputFile = Path.GetFileName(Parameters.ProxyPath);\r
+\r
+            string nameWithoutExtension = GetDynamicText(Parameters.TargetConfig.OutputFormat);\r
+            string extension = Path.GetExtension(Parameters.ProxyPath);\r
+\r
+            if (CurrentFileVersion > 0)\r
+                nameWithoutExtension += "-" + CurrentFileVersion;\r
+\r
+            string outputFile = nameWithoutExtension + "S01" + extension;\r
+            outputFile = outputFile.ToUpper();\r
 \r
             string targetFilePath = Path.Combine(outputPath, STATUS_FOLDER, outputFile);\r
             EnsureDirectoryExistence(Path.GetDirectoryName(targetFilePath));\r
@@ -478,10 +487,12 @@ namespace MaestroShared.Targets {
         }\r
 \r
         private bool doCopy(ref int pbCancel, string sourceFilePath, string targetFilePath) {\r
-            return Win32File.CopyFileEx(Input, targetFilePath, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE);\r
+            logger.Info($"doCopy {sourceFilePath} -> {targetFilePath}");\r
+            return Win32File.CopyFileEx(sourceFilePath, targetFilePath, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE);\r
         }\r
 \r
         private bool doAlternateCopy(string sourceFilePath, string targetFilePath) {\r
+            logger.Info($"doAlternateCopy {sourceFilePath} -> {targetFilePath}");\r
             CustomFileCopier copier = new CustomFileCopier(sourceFilePath, targetFilePath);\r
             copier.OnProgressChanged += Copier_OnProgressChanged;\r
             copier.Copy();\r
@@ -527,12 +538,12 @@ namespace MaestroShared.Targets {
             extension = extension.ToUpper();\r
             string result = string.Format(FILENAME, nameWithoutExtension, extension);\r
             if (!Parameters.TargetConfig.DisableFileVersioning) {\r
-                int version = 1;\r
+                logger.Info($"File versioning is enabled");\r
                 while (FileExists(GetOutputFilePath(workingDir, result))) {\r
-                    string versioned = string.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension);\r
+                    CurrentFileVersion++;\r
+                    string versioned = string.Format(VERSIONED_FILENAME, nameWithoutExtension, CurrentFileVersion, extension);\r
                     logger.Debug(ALREADY_EXISTS, result, versioned);\r
                     result = versioned;\r
-                    version++;\r
                 }\r
             }\r
             logger.Trace(Strings.EXIT);\r
diff --git a/server/-dependencies/libs/libhumblevideo-0.dll b/server/-dependencies/libs/libhumblevideo-0.dll
new file mode 100644 (file)
index 0000000..c47fb08
Binary files /dev/null and b/server/-dependencies/libs/libhumblevideo-0.dll differ
index 46e05f4bec1499718abe8e39eb0fd172311edbd9..2baef98525e5adb2e6c54277efc7e89d4702b3b3 100644 (file)
@@ -19,6 +19,8 @@ public class MediaInfo {
        private String colorSpace;\r
        private int audioStreams;\r
        private int videoStreams;\r
+       private int height;\r
+       private int width;\r
 \r
        public MediaInfo(Path filePath) {\r
                this.filePath = filePath;\r
@@ -40,10 +42,18 @@ public class MediaInfo {
                return frames;\r
        }\r
 \r
+       public int getHeight() {\r
+               return height;\r
+       }\r
+\r
        public int getVideoStreams() {\r
                return videoStreams;\r
        }\r
 \r
+       public int getWidth() {\r
+               return width;\r
+       }\r
+\r
        public void process() throws InterruptedException, IOException {\r
                Demuxer demuxer = null;\r
                try {\r
@@ -67,6 +77,10 @@ public class MediaInfo {
                                                if (frames == 0)\r
                                                        frames = stream.getDuration();\r
                                                colorSpace = decoder.getPixelFormat().toString();\r
+\r
+                                               height = decoder.getHeight();\r
+                                               width = decoder.getWidth();\r
+\r
                                        }\r
                                        if (decoder.getCodecType() == MediaDescriptor.Type.MEDIA_AUDIO) {\r
                                                audioStreams++;\r