Skip to content

Commit c3338c0

Browse files
Update raw-media-access-windows.md
1 parent 849b622 commit c3338c0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

articles/communication-services/quickstarts/voice-video-calling/includes/raw-media/raw-media-access-windows.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,25 @@ The following is an overview of the steps required to create a screen share vide
227227
```
228228

229229
2. Capture the frames from the screen using Windows API's
230+
231+
```csharp
232+
MemoryBuffer memoryBuffer = // Fill it with the content you got from the Windows API's
233+
```
234+
235+
3. Send the video frames in the following way
236+
237+
```csharp
238+
private async Task GenerateVideoFrame(MemoryBuffer memoryBuffer)
239+
{
240+
try
241+
{
242+
var softwareBasedVideoFrameSender = videoFrameSender as SoftwareBasedVideoFrameSender;
243+
VideoFormat videoFormat = softwareBasedVideoFrameSender.VideoFormat;
244+
245+
await softwareBasedVideoFrameSender.SendFrameAsync(memoryBuffer, videoFrameSender.TimestampInTicks);
246+
int delayBetweenFrames = (int)(1000.0 / softwareBasedVideoFrameSender.VideoFormat.FramesPerSecond);
247+
await Task.Delay(delayBetweenFrames);
248+
}
249+
catch (Exception) { }
250+
}
251+
```

0 commit comments

Comments
 (0)