public void Read(Packet packet, InputSetup setup) { var loop = setup.NoneResetingOptions.LoopbackOptions; SizeInt32 configSize = loop != null ? new SizeInt32 { Width = loop.Width, Height = loop.Height } : new SizeInt32 { Width = 0, Height = 0 }; _capture.Read(configSize, (b, bitPerPixel, width, height, sourceWidth, dxRes) => { if (dxRes == null) { return(packet.InitFromBuffer(b, bitPerPixel, width, height, sourceWidth, Core.GetCurrentTime(), true)); } else { packet.InitFromDirectX(dxRes, Core.GetCurrentTime()); return(true); } }); }