Moved the getFrame methode to acinerella (native)
This commit is contained in:
1 parent
be3d27adfb
commit
674a987e2a
1 file changed
+3
-25
@@ -401,36 +401,14 @@ namespace Vocaluxe.Lib.Video.Acinerella
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport(_AcDll, EntryPoint = "ac_read_package", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
[DllImport(_AcDll, EntryPoint = "ac_get_frame", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Auto)]
|
||||||
private static extern IntPtr _ac_read_package(IntPtr pAcInstance);
|
private static extern Int32 _ac_get_frame(IntPtr pAcInstance, IntPtr pAcDecoder);
|
||||||
|
|
||||||
public static bool AcGetFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
public static bool AcGetFrame(IntPtr pAcInstance, IntPtr pAcDecoder)
|
||||||
{
|
{
|
||||||
if (pAcDecoder == IntPtr.Zero)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (_GetLockToken(pAcDecoder))
|
lock (_GetLockToken(pAcDecoder))
|
||||||
{
|
{
|
||||||
do
|
return _ac_get_frame(pAcInstance, pAcDecoder) != 0;
|
||||||
{
|
|
||||||
var pckt = _ac_read_package(pAcInstance);
|
|
||||||
if (pckt == IntPtr.Zero)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The packet is for the video stream, try to decode it
|
|
||||||
if (_ac_decode_package(pckt, pAcDecoder) != 0)
|
|
||||||
{
|
|
||||||
ac_free_package(pckt);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ac_free_package(pckt);
|
|
||||||
|
|
||||||
} while (true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user