@@ -63,15 +63,15 @@ protected override Task OnInitializeAsync(VideoCharacteristics characteristics,
6363 $ "FlashCap: Couldn't set video format: UniqueID={ this . uniqueID } ") ;
6464 }
6565
66- this . bitmapHeader = NativeMethods . AllocateMemory ( new IntPtr ( Marshal . SizeOf < BITMAPINFOHEADER > ( ) ) ) ;
66+ this . bitmapHeader = NativeMethods . AllocateMemory ( new IntPtr ( MarshalEx . SizeOf < BITMAPINFOHEADER > ( ) ) ) ;
6767
6868 try
6969 {
7070 unsafe
7171 {
7272 var pBih = ( BITMAPINFOHEADER * ) this . bitmapHeader . ToPointer ( ) ;
7373
74- pBih ->biSize = sizeof ( NativeMethods . BITMAPINFOHEADER ) ;
74+ pBih ->biSize = MarshalEx . SizeOf < BITMAPINFOHEADER > ( ) ;
7575 pBih ->biCompression = compression ;
7676 pBih ->biPlanes = 1 ;
7777 pBih ->biBitCount = bitCount ;
@@ -135,19 +135,19 @@ format.FormatDescription.Dimensions is var dimensions &&
135135 throw new Exception ( "Can't add video output" ) ;
136136 }
137137
138- return Task . CompletedTask ;
138+ return TaskCompat . CompletedTask ;
139139 }
140140
141141 protected override Task OnStartAsync ( CancellationToken ct )
142142 {
143143 this . session ? . StartRunning ( ) ;
144- return Task . CompletedTask ;
144+ return TaskCompat . CompletedTask ;
145145 }
146146
147147 protected override Task OnStopAsync ( CancellationToken ct )
148148 {
149149 this . session ? . StopRunning ( ) ;
150- return Task . CompletedTask ;
150+ return TaskCompat . CompletedTask ;
151151 }
152152
153153 protected override void OnCapture ( IntPtr pData , int size , long timestampMicroseconds , long frameIndex , PixelBuffer buffer )
@@ -201,8 +201,6 @@ public void CaptureOutputCallback(IntPtr self, IntPtr _cmd, IntPtr output, IntPt
201201 CVPixelBufferUnlockBaseAddress ( pixelBuffer , PixelBufferLockFlags . ReadOnly ) ;
202202 }
203203 }
204-
205204 }
206-
207205 }
208206}
0 commit comments