Skip to content

Commit aa74a57

Browse files
authored
Merge pull request #225398 from ShawnJackson/get-started-raw-media-access
[AQ] edit pass: get-started-raw-media-access
2 parents b3805d7 + c8fee29 commit aa74a57

File tree

6 files changed

+409
-372
lines changed

6 files changed

+409
-372
lines changed

articles/communication-services/includes/public-preview-include-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ ms.custom: private_preview
88
---
99
> [!IMPORTANT]
1010
> Functionality described in this document is currently in public preview.
11-
> This preview version is provided without a service-level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
11+
> This preview version is provided without a service-level agreement, and we don't recommend it for production workloads. Certain features might not be supported or might have constrained capabilities.
1212
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).

articles/communication-services/quickstarts/voice-video-calling/get-started-raw-media-access.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Quickstart - Add RAW media access to your app
2+
title: Quickstart - Add raw media access to your app
33
titleSuffix: An Azure Communication Services quickstart
4-
description: In this quickstart, you'll learn how to add raw media access calling capabilities to your app using Azure Communication Services.
4+
description: In this quickstart, you'll learn how to add raw media access calling capabilities to your app by using Azure Communication Services.
55
author: sharifrahaman
66

77
ms.author: srahaman
@@ -13,7 +13,7 @@ zone_pivot_groups: acs-plat-web-ios-android-windows
1313
ms.custom: mode-other
1414
---
1515

16-
# QuickStart: Add raw media access to your app
16+
# Quickstart: Add raw media access to your app
1717

1818
::: zone pivot="platform-windows"
1919
[!INCLUDE [Raw media with Windows](./includes/raw-media/raw-media-access-windows.md)]
@@ -31,11 +31,11 @@ ms.custom: mode-other
3131
[!INCLUDE [Raw media with JavaScript](./includes/raw-media/raw-media-access-javascript.md)]
3232
::: zone-end
3333

34-
3534
## Next steps
35+
3636
For more information, see the following articles:
3737

38-
- Check out our [calling hero sample](../../samples/calling-hero-sample.md)
39-
- Get started with the [UI Library](https://aka.ms/acsstorybook)
40-
- Learn about [Calling SDK capabilities](./getting-started-with-calling.md?pivots=platform-web)
41-
- Learn more about [how calling works](../../concepts/voice-video-calling/about-call-types.md)
38+
- Check out the [calling hero sample](../../samples/calling-hero-sample.md).
39+
- Get started with the [UI Library](https://aka.ms/acsstorybook).
40+
- Learn about [Calling SDK capabilities](./getting-started-with-calling.md?pivots=platform-web).
41+
- Learn more about [how calling works](../../concepts/voice-video-calling/about-call-types.md).

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

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: Quickstart - Add RAW media access to your app (Android)
2+
title: Quickstart - Add raw media access to your app (Android)
33
titleSuffix: An Azure Communication Services quickstart
4-
description: In this quickstart, you'll learn how to add raw media access calling capabilities to your app using Azure Communication Services.
4+
description: In this quickstart, you'll learn how to add raw media access calling capabilities to your app by using Azure Communication Services.
55
author: yassirbisteni
66

77
ms.author: yassirb
@@ -12,26 +12,23 @@ ms.subservice: calling
1212
ms.custom: mode-other
1313
---
1414

15-
## Raw video
16-
1715
[!INCLUDE [Public Preview](../../../../includes/public-preview-include-document.md)]
1816

19-
In this quickstart, you'll learn how to implement raw media access using the Azure Communication Services Calling SDK for Android.
20-
21-
The Azure Communication Services Calling SDK offers APIs allowing apps to generate their own video frames to send to remote participants.
17+
In this quickstart, you'll learn how to implement raw media access by using the Azure Communication Services Calling SDK for Android.
2218

23-
This quick start builds upon [QuickStart: Add 1:1 video calling to your app](../../get-started-with-video-calling.md?pivots=platform-android) for Android.
19+
The Azure Communication Services Calling SDK offers APIs that allow apps to generate their own video frames to send to remote participants in a call.
2420

21+
This quickstart builds on [Quickstart: Add 1:1 video calling to your app](../../get-started-with-video-calling.md?pivots=platform-android) for Android.
2522

26-
## Virtual video stream overview
23+
## Overview of virtual video streams
2724

28-
Since the app will be generating the video frames, the app must inform the Azure Communication Services Calling SDK about the video formats the app is capable of generating. This is required to allow the Azure Communication Services Calling SDK to pick the best video format configuration given the network conditions at any giving time.
25+
Because the app will generate the video frames, the app must inform the Azure Communication Services Calling SDK about the video formats that the app can generate. This information allows the Azure Communication Services Calling SDK to pick the best video format configuration for the network conditions at that time.
2926

30-
The app must register a delegate to get notified about when it should start or stop producing video frames. The delegate event will inform the app which video format is more appropriate for the current network conditions.
27+
The app must register a delegate to get notified about when it should start or stop producing video frames. The delegate event will inform the app which video format is most appropriate for the current network conditions.
3128

3229
### Supported video resolutions
3330

34-
| Aspect Ratio | Resolution | Maximum FPS |
31+
| Aspect ratio | Resolution | Maximum FPS |
3532
| :--: | :-: | :-: |
3633
| 16x9 | 1080p | 30 |
3734
| 16x9 | 720p | 30 |
@@ -46,9 +43,11 @@ The app must register a delegate to get notified about when it should start or s
4643
| 4x3 | QVGA (320x240) | 15 |
4744
| 4x3 | 212x160 | 15 |
4845

49-
The following is an overview of the steps required to create a virtual video stream.
46+
### Steps to create a virtual video stream
47+
48+
1. Create an array of `VideoFormat` with the video formats that the app supports. It's fine to have only one video format supported, but at least one of the provided video formats must be of the `VideoFrameKind::VideoSoftware` type.
5049

51-
1. Create an array of `VideoFormat` with the video formats supported by the app. It is fine to have only one video format supported, but at least one of the provided video formats must be of the `VideoFrameKind::VideoSoftware` type. When multiple formats are provided, the order of the format in the list doesn't influence or prioritize which one will be used. The selected format is based on external factors like network bandwidth.
50+
When multiple formats are provided, the order of the format in the list doesn't influence or prioritize which one will be used. The criteria for format selection are based on external factors like network bandwidth.
5251

5352
```java
5453
ArrayList<VideoFormat> videoFormats = new ArrayList<VideoFormat>();
@@ -64,14 +63,14 @@ The following is an overview of the steps required to create a virtual video str
6463
videoFormats.add(format);
6564
```
6665

67-
2. Create `RawOutgoingVideoStreamOptions` and set `VideoFormats` with the previously created object.
66+
2. Create `RawOutgoingVideoStreamOptions`, and set `VideoFormats` with the previously created object.
6867

6968
```java
7069
RawOutgoingVideoStreamOptions rawOutgoingVideoStreamOptions = new RawOutgoingVideoStreamOptions();
7170
rawOutgoingVideoStreamOptions.setVideoFormats(videoFormats);
7271
```
7372

74-
3. Subscribe to `RawOutgoingVideoStreamOptions::addOnOutgoingVideoStreamStateChangedListener` delegate. This delegate will inform the state of the current stream, it's important that you don't send frames if the state is no equal to `OutgoingVideoStreamState.STARTED`.
73+
3. Subscribe to the `RawOutgoingVideoStreamOptions::addOnOutgoingVideoStreamStateChangedListener` delegate. This delegate will inform the state of the current stream. Don't send frames if the state is not equal to `OutgoingVideoStreamState.STARTED`.
7574
7675
```java
7776
private OutgoingVideoStreamState outgoingVideoStreamState;
@@ -82,7 +81,9 @@ The following is an overview of the steps required to create a virtual video str
8281
});
8382
```
8483
85-
4. Make sure the `RawOutgoingVideoStreamOptions::addOnVideoFrameSenderChangedListener` delegate is defined. This delegate will inform its listener about events requiring the app to start or stop producing video frames. In this quick start, `mediaFrameSender` is used as trigger to let the app know when it's time to start generating frames. Feel free to use any mechanism in your app as a trigger.
84+
4. Make sure the `RawOutgoingVideoStreamOptions::addOnVideoFrameSenderChangedListener` delegate is defined. This delegate will inform its listener about events that require the app to start or stop producing video frames.
85+
86+
This quickstart uses `mediaFrameSender` as a trigger to let the app know when it's time to start generating frames. Feel free to use any mechanism in your app as a trigger.
8687

8788
```java
8889
private VideoFrameSender mediaFrameSender;
@@ -93,16 +94,21 @@ The following is an overview of the steps required to create a virtual video str
9394
});
9495
```
9596

96-
5. Create an instance of `VirtualRawOutgoingVideoStream` using the `RawOutgoingVideoStreamOptions` we created previously
97+
5. Create an instance of `VirtualRawOutgoingVideoStream` by using the `RawOutgoingVideoStreamOptions` instance that you created previously.
9798

9899
```java
99100
private VirtualRawOutgoingVideoStream virtualRawOutgoingVideoStream;
100101

101102
virtualRawOutgoingVideoStream = new VirtualRawOutgoingVideoStream(rawOutgoingVideoStreamOptions);
102103
```
103104

104-
7. Once outgoingVideoStreamState is equal to `OutgoingVideoStreamState.STARTED` create and instance of `FrameGenerator` class this will start a non-UI thread and will send frames, call `FrameGenerator.SetVideoFrameSender` each time we get an updated `VideoFrameSender` on the previous delegate, cast the `VideoFrameSender` to the appropriate type defined by the `VideoFrameKind` property of `VideoFormat`. For example, cast it to `SoftwareBasedVideoFrameSender` and then call the `send` method according to the number of planes defined by the VideoFormat.
105-
After that, create the ByteBuffer backing the video frame if needed. Then, update the content of the video frame. Finally, send the video frame to other participants with the `sendFrame` API.
105+
6. After `outgoingVideoStreamState` is equal to `OutgoingVideoStreamState.STARTED`, create an instance of the `FrameGenerator` class.
106+
107+
This step starts a non-UI thread and sends frames. It will call `FrameGenerator.SetVideoFrameSender` each time you get an updated `VideoFrameSender` instance on the previous delegate. It will also cast `VideoFrameSender` to the appropriate type defined by the `VideoFrameKind` property of `VideoFormat`.
108+
109+
For example, cast `VideoFrameSender` to `SoftwareBasedVideoFrameSender`. Then, call the `send` method according to the number of planes that `VideoFormat` defines.
110+
111+
After that, create the byte buffer that backs the video frame if needed. Then, update the content of the video frame. Finally, send the video frame to other participants by using the `sendFrame` API.
106112

107113
```java
108114
public class FrameGenerator implements VideoFrameSenderChangedListener {
@@ -214,36 +220,38 @@ After that, create the ByteBuffer backing the video frame if needed. Then, updat
214220
}
215221
```
216222

217-
## Screen share video stream overview
223+
## Overview of screen share video streams
218224

219-
Repeat steps `1 to 4` from the previous VirtualRawOutgoingVideoStream tutorial.
225+
Repeat steps 1 to 4 from the previous [Steps to create a virtual video stream](#steps-to-create-a-virtual-video-stream) procedure.
220226

221-
Since the Android system generates the frames, you must implement your own foreground service to capture the frames and send them through using our Azure Communication Services Calling API
227+
Because the Android system generates the frames, you must implement your own foreground service to capture the frames and send them by using the Azure Communication Services Calling API.
222228

223229
### Supported video resolutions
224230

225-
| Aspect Ratio | Resolution | Maximum FPS |
231+
| Aspect ratio | Resolution | Maximum FPS |
226232
| :--: | :-: | :-: |
227233
| Anything | Anything | 30 |
228234

229-
The following is an overview of the steps required to create a screen share video stream.
235+
### Steps to create a screen share video stream
230236

231-
1. Add this permission to your `Manifest.xml` file inside your Android project
237+
1. Add this permission to your *Manifest.xml* file inside your Android project.
232238

233239
```xml
234240
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
235241
```
236242

237-
2. Create an instance of `ScreenShareRawOutgoingVideoStream` using the `RawOutgoingVideoStreamOptions` we created previously
243+
2. Create an instance of `ScreenShareRawOutgoingVideoStream` by using the `RawOutgoingVideoStreamOptions` instance that you created previously.
238244

239245
```java
240246
private ScreenShareRawOutgoingVideoStream screenShareRawOutgoingVideoStream;
241247

242248
screenShareRawOutgoingVideoStream = new ScreenShareRawOutgoingVideoStream(rawOutgoingVideoStreamOptions);
243249
```
244250

245-
3. Request needed permissions for screen capture on Android, once this method is called Android will call automatically `onActivityResult` containing the request code we've sent and the result of the operation, expect `Activity.RESULT_OK` if the permission has been provided by the user if so attach the screenShareRawOutgoingVideoStream to the call and start your own foreground service to capture the frames.
246-
251+
3. Request needed permissions for screen capture on Android. After this method is called, Android will automatically call `onActivityResult`, which contains the request code that you sent and the result of the operation.
252+
253+
Expect `Activity.RESULT_OK` if the user has provided the permission. If so, attach `screenShareRawOutgoingVideoStream` to the call and start your own foreground service to capture the frames.
254+
247255
```java
248256
public void GetScreenSharePermissions() {
249257

@@ -277,7 +285,7 @@ The following is an overview of the steps required to create a screen share vide
277285
}
278286
```
279287

280-
4. Once you receive a frame on your foreground service send it through using the `VideoFrameSender` provided
288+
4. After you receive a frame on your foreground service, send it by using the provided `VideoFrameSender` information.
281289

282290
````java
283291
public void onImageAvailable(ImageReader reader) {

0 commit comments

Comments
 (0)