Prechádzať zdrojové kódy

Move Skia back into it's own project

Bond_009 6 rokov pred
rodič
commit
ce11869a1a

+ 0 - 6
Emby.Drawing/Emby.Drawing.csproj

@@ -5,12 +5,6 @@
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
     <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <ItemGroup>
-    <PackageReference Include="SkiaSharp" Version="1.68.0" />
-    <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.0" />
-    <PackageReference Include="Jellyfin.SkiaSharp.NativeAssets.LinuxArm" Version="1.68.0" />
-  </ItemGroup>
-
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
     <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
     <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
     <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />

+ 24 - 0
Jellyfin.Drawing.Skia/Jellyfin.Drawing.Skia.csproj

@@ -0,0 +1,24 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Compile Include="..\SharedVersion.cs" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="SkiaSharp" Version="1.68.0" />
+    <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="1.68.0" />
+    <PackageReference Include="Jellyfin.SkiaSharp.NativeAssets.LinuxArm" Version="1.68.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
+    <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
+    <ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
+  </ItemGroup>
+
+</Project>

+ 1 - 1
Emby.Drawing/PercentPlayedDrawer.cs → Jellyfin.Drawing.Skia/PercentPlayedDrawer.cs

@@ -2,7 +2,7 @@ using System;
 using MediaBrowser.Model.Drawing;
 using MediaBrowser.Model.Drawing;
 using SkiaSharp;
 using SkiaSharp;
 
 
-namespace Emby.Drawing
+namespace Jellyfin.Drawing.Skia
 {
 {
     public static class PercentPlayedDrawer
     public static class PercentPlayedDrawer
     {
     {

+ 1 - 1
Emby.Drawing/PlayedIndicatorDrawer.cs → Jellyfin.Drawing.Skia/PlayedIndicatorDrawer.cs

@@ -1,7 +1,7 @@
 using MediaBrowser.Model.Drawing;
 using MediaBrowser.Model.Drawing;
 using SkiaSharp;
 using SkiaSharp;
 
 
-namespace Emby.Drawing
+namespace Jellyfin.Drawing.Skia
 {
 {
     public static class PlayedIndicatorDrawer
     public static class PlayedIndicatorDrawer
     {
     {

+ 1 - 1
Emby.Drawing/SkiaEncoder.cs → Jellyfin.Drawing.Skia/SkiaEncoder.cs

@@ -12,7 +12,7 @@ using MediaBrowser.Model.IO;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Logging;
 using SkiaSharp;
 using SkiaSharp;
 
 
-namespace Emby.Drawing
+namespace Jellyfin.Drawing.Skia
 {
 {
     public class SkiaEncoder : IImageEncoder
     public class SkiaEncoder : IImageEncoder
     {
     {

+ 4 - 11
Emby.Drawing/StripCollageBuilder.cs → Jellyfin.Drawing.Skia/StripCollageBuilder.cs

@@ -5,7 +5,7 @@ using MediaBrowser.Common.Configuration;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Model.IO;
 using SkiaSharp;
 using SkiaSharp;
 
 
-namespace Emby.Drawing
+namespace Jellyfin.Drawing.Skia
 {
 {
     public class StripCollageBuilder
     public class StripCollageBuilder
     {
     {
@@ -43,21 +43,14 @@ namespace Emby.Drawing
             return SKEncodedImageFormat.Png;
             return SKEncodedImageFormat.Png;
         }
         }
 
 
-        public void BuildPosterCollage(string[] paths, string outputPath, int width, int height)
-        {
-            // @todo
-        }
-
         public void BuildSquareCollage(string[] paths, string outputPath, int width, int height)
         public void BuildSquareCollage(string[] paths, string outputPath, int width, int height)
         {
         {
             using (var bitmap = BuildSquareCollageBitmap(paths, width, height))
             using (var bitmap = BuildSquareCollageBitmap(paths, width, height))
+            using (var outputStream = new SKFileWStream(outputPath))
             {
             {
-                using (var outputStream = new SKFileWStream(outputPath))
+                using (var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels()))
                 {
                 {
-                    using (var pixmap = new SKPixmap(new SKImageInfo(width, height), bitmap.GetPixels()))
-                    {
-                        pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
-                    }
+                    pixmap.Encode(outputStream, GetEncodedFormat(outputPath), 90);
                 }
                 }
             }
             }
         }
         }

+ 1 - 1
Emby.Drawing/UnplayedCountIndicator.cs → Jellyfin.Drawing.Skia/UnplayedCountIndicator.cs

@@ -2,7 +2,7 @@ using System.Globalization;
 using MediaBrowser.Model.Drawing;
 using MediaBrowser.Model.Drawing;
 using SkiaSharp;
 using SkiaSharp;
 
 
-namespace Emby.Drawing
+namespace Jellyfin.Drawing.Skia
 {
 {
     public static class UnplayedCountIndicator
     public static class UnplayedCountIndicator
     {
     {

+ 1 - 0
Jellyfin.Server/Jellyfin.Server.csproj

@@ -49,6 +49,7 @@
     <ProjectReference Include="..\Emby.Drawing\Emby.Drawing.csproj" />
     <ProjectReference Include="..\Emby.Drawing\Emby.Drawing.csproj" />
     <ProjectReference Include="..\Emby.IsoMounting\IsoMounter\IsoMounter.csproj" />
     <ProjectReference Include="..\Emby.IsoMounting\IsoMounter\IsoMounter.csproj" />
     <ProjectReference Include="..\Emby.Server.Implementations\Emby.Server.Implementations.csproj" />
     <ProjectReference Include="..\Emby.Server.Implementations\Emby.Server.Implementations.csproj" />
+    <ProjectReference Include="..\Jellyfin.Drawing.Skia\Jellyfin.Drawing.Skia.csproj" />
   </ItemGroup>
   </ItemGroup>
 
 
 </Project>
 </Project>

+ 1 - 0
Jellyfin.Server/Program.cs

@@ -13,6 +13,7 @@ using Emby.Server.Implementations;
 using Emby.Server.Implementations.EnvironmentInfo;
 using Emby.Server.Implementations.EnvironmentInfo;
 using Emby.Server.Implementations.IO;
 using Emby.Server.Implementations.IO;
 using Emby.Server.Implementations.Networking;
 using Emby.Server.Implementations.Networking;
+using Jellyfin.Drawing.Skia;
 using MediaBrowser.Common.Configuration;
 using MediaBrowser.Common.Configuration;
 using MediaBrowser.Controller.Drawing;
 using MediaBrowser.Controller.Drawing;
 using MediaBrowser.Model.Globalization;
 using MediaBrowser.Model.Globalization;

+ 7 - 1
MediaBrowser.sln

@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
+Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
 # Visual Studio 15
 VisualStudioVersion = 15.0.26730.3
 VisualStudioVersion = 15.0.26730.3
 MinimumVisualStudioVersion = 10.0.40219.1
 MinimumVisualStudioVersion = 10.0.40219.1
@@ -56,6 +56,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		SharedVersion.cs = SharedVersion.cs
 		SharedVersion.cs = SharedVersion.cs
 	EndProjectSection
 	EndProjectSection
 EndProject
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Drawing.Skia", "Jellyfin.Drawing.Skia\Jellyfin.Drawing.Skia.csproj", "{154872D9-6C12-4007-96E3-8F70A58386CE}"
+EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
@@ -158,6 +160,10 @@ Global
 		{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.Build.0 = Release|Any CPU
 		{07E39F42-A2C6-4B32-AF8C-725F957A73FF}.Release|Any CPU.Build.0 = Release|Any CPU
+		{154872D9-6C12-4007-96E3-8F70A58386CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{154872D9-6C12-4007-96E3-8F70A58386CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{154872D9-6C12-4007-96E3-8F70A58386CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{154872D9-6C12-4007-96E3-8F70A58386CE}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE