mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-05-27 09:32:35 -04:00
Reworking the way the c++ transcoder is imported.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user