-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ARC-237] Add Muxer that complements Seek Head and Cues information (#47
- Loading branch information
1 parent
dfacabe
commit 28a632e
Showing
5 changed files
with
560 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Devolutions.Cadeau | ||
{ | ||
public class XmfMuxer | ||
{ | ||
private IntPtr muxerHandle; | ||
|
||
private static class ffi | ||
{ | ||
[DllImport("xmf", EntryPoint = "XmfWebMMuxer_New")] | ||
public static extern IntPtr New(); | ||
|
||
[DllImport("xmf", EntryPoint = "XmfWebMMuxer_Remux")] | ||
public static extern int Remux(IntPtr muxer, [MarshalAs(UnmanagedType.LPStr)] string inputPath, [MarshalAs(UnmanagedType.LPStr)] string outputPath); | ||
|
||
[DllImport("xmf", EntryPoint = "XmfWebMMuxer_Free")] | ||
public static extern void Free(IntPtr muxer); | ||
} | ||
|
||
public IntPtr Handle => muxerHandle; | ||
|
||
public XmfMuxer() | ||
{ | ||
muxerHandle = ffi.New(); | ||
} | ||
|
||
~XmfMuxer() | ||
{ | ||
ffi.Free(muxerHandle); | ||
} | ||
|
||
public int Remux(string inputPath, string outputPath) | ||
{ | ||
return ffi.Remux(muxerHandle, inputPath, outputPath); | ||
} | ||
|
||
public void Cleanup() | ||
{ | ||
ffi.Free(muxerHandle); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.