protected override bool StartDispatchCore() { //CreateBitmapPool(); if (_capturePtr == IntPtr.Zero) { int bitmapBytesCount = Width * Height * PixelFormat.GetBytes(); _prepareCaptureBytesCount = bitmapBytesCount + MicrosoftBitmapExtensions.FileHeaderTotalBytes + MicrosoftBitmapExtensions.InfoHeaderTotalBytes; _capturePtr = Marshal.AllocHGlobal(_prepareCaptureBytesCount); unsafe { var tempPtr = ((byte *)_capturePtr.ToPointer()) + +MicrosoftBitmapExtensions.FileHeaderTotalBytes + MicrosoftBitmapExtensions.InfoHeaderTotalBytes; _bitmapPtr = new IntPtr(tempPtr); } //_bitmapPtr = _capturePtr + +BitmapExtensions.FileHeaderTotalBytes + // BitmapExtensions.InfoHeaderTotalBytes; } //X64 //RealHandle = HikvisionSDK.NET_DVR_RealPlay_V40(UserId, ref _clientInfo, _realDataSnapCallBack, // UserPtr, 0); //X86 _realHandle = OfficalAPI.NET_DVR_RealPlay_V40(_userId, ref _previewInfo, _realDataCallBack, _userPtr); if (_realHandle == InvalidRealHandle) { WarnDvrSdkFailWithReason("NET_DVR_RealPlay_V40"); return(false); } this.InfoSuccess("NET_DVR_RealPlay_V40"); OfficalAPI.NET_DVR_SetPlayerBufNumber(_realHandle, 3); return(_captureLooper.Start()); }