Reworking the way the c++ transcoder is imported.

This commit is contained in:
Zoe Roux
2019-09-04 23:02:00 +02:00
parent 606915e66a
commit 3096249eef
59 changed files with 314 additions and 4159 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
namespace Kyoo.InternalAPI.Transcoder
namespace Kyoo.InternalAPI
{
public interface ITranscoder
{
void GetVideo(string Path);
}
}
@@ -1,7 +0,0 @@
namespace Kyoo.InternalAPI.Transcoder
{
interface ITranscoderAPI
{
int Init();
}
}
+10 -5
View File
@@ -1,16 +1,21 @@
using AdvancedDLSupport;
using Kyoo.InternalAPI.TranscoderLink;
using Microsoft.Extensions.Configuration;
using System.Diagnostics;
namespace Kyoo.InternalAPI.Transcoder
namespace Kyoo.InternalAPI
{
public class Transcoder : ITranscoder
{
private readonly ITranscoderAPI api;
public Transcoder(IConfiguration config)
{
string transcoderPath = config.GetValue<string>("plugins");
api = NativeLibraryBuilder.Default.ActivateInterface<ITranscoderAPI>(transcoderPath);
Debug.WriteLine("&Transcoder DLL Path: " + transcoderPath);
Debug.WriteLine("&Api INIT: " + TranscoderAPI.Init());
}
public void GetVideo(string path)
{
Debug.WriteLine("&Getting video...");
}
}
}
@@ -0,0 +1,10 @@
using System.Runtime.InteropServices;
namespace Kyoo.InternalAPI.TranscoderLink
{
public class TranscoderAPI
{
[DllImport(@"C:\Projects\Kyoo\Debug\Kyoo.Transcoder.dll", CallingConvention = CallingConvention.Cdecl)]
public extern static int Init();
}
}