SHA256
Reduce Memory Copy When Frame Capture Success
This commit is contained in:
1 parent
036216c006
commit
6bd4a8975e
3 files changed
+32
-11
No files matched your search
+1
-11
@@ -463,17 +463,7 @@ namespace ADOFAIRenderer.Core
|
||||
}
|
||||
else if (frame.NativePointer != IntPtr.Zero && frame.Length > 0)
|
||||
{
|
||||
var buffer = FFmpegProcess.RentRawBytes(frame.Length);
|
||||
unsafe
|
||||
{
|
||||
fixed (byte* destPtr = buffer)
|
||||
{
|
||||
Buffer.MemoryCopy((void*)frame.NativePointer, destPtr, buffer.Length, frame.Length);
|
||||
}
|
||||
}
|
||||
|
||||
videoFFmpeg.SendDataFromBuffer(buffer, frame.Length);
|
||||
ArrayPool<byte>.Shared.Return(buffer);
|
||||
videoFFmpeg.SendDataFromNativeBuffer(frame.NativePointer, frame.Length);
|
||||
|
||||
if (frame.ReadbackState != null)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user