Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for screen-sharing using multi-stream VoIP (MSC3077) #1685

Merged
merged 72 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a4e853e
Add types for MSC3077
SimonBrandner May 6, 2021
631faa2
Send SDPStreamMetadata
SimonBrandner May 6, 2021
6a920fe
Get sdpStreamMetadata from invite
SimonBrandner May 7, 2021
4d4a6ed
Use somicolons instead
SimonBrandner May 7, 2021
23f5c2e
Add a separate method to push local feed
SimonBrandner May 7, 2021
cebdc44
Set remoteSDPStreamMetadata from answer
SimonBrandner May 7, 2021
25eb6de
Send SDPStreamMetadata in answer
SimonBrandner May 7, 2021
30f2263
Rework pushing of remote feeds for MSC3077
SimonBrandner May 7, 2021
50e0f63
Move adding tracks into pushLocalFeed()
SimonBrandner May 7, 2021
640d13a
Set remoteSDPStreamMetadata in onNegotiateReceived()
SimonBrandner May 7, 2021
b1ace49
Add methods useful for screensharing
SimonBrandner May 7, 2021
4d74b5c
Send SDPStreamMetadata in negotiation response
SimonBrandner May 7, 2021
8c8a68d
Add methods to delete feeds
SimonBrandner May 7, 2021
0e6b43a
Hook up methods to delete feeds
SimonBrandner May 7, 2021
a35559b
Add a method to start screensharing
SimonBrandner May 7, 2021
972aef7
Merge feed delete methods and add sender arrays
SimonBrandner May 8, 2021
377ca0c
Add getScreensharingStream()
SimonBrandner May 8, 2021
e9b802d
Use getScreensharingStream() in setScreensharingEnabled()
SimonBrandner May 8, 2021
cbc7481
Use getScreensharingStream()
SimonBrandner May 8, 2021
d250e73
Merge screenshare track into usermedia stream
SimonBrandner May 8, 2021
82c530d
Add setScreensharingEnabledWithoutMetadataSupport as a fallback()
SimonBrandner May 8, 2021
fc68bb3
Add ()!!!
SimonBrandner May 8, 2021
df28d87
Remove log line
SimonBrandner May 8, 2021
fa3b246
Add addToPeerConnection param
SimonBrandner May 8, 2021
d0707e1
Make shift-click work again
SimonBrandner May 8, 2021
7b333a3
Warn level
SimonBrandner May 8, 2021
1858062
Use opponentSupportsSDPStreamMetadata()
SimonBrandner May 8, 2021
c676449
Use for loop
SimonBrandner May 8, 2021
b67cd94
Jest: should map SDPStreamMetadata to feeds
SimonBrandner May 8, 2021
1e0d6b9
Jest: should fallback to replaceTrack() if the other side doesn't sup…
SimonBrandner May 8, 2021
27c1723
Add a log line to pushLocalFeed()
SimonBrandner May 8, 2021
16f5691
Simplifie and avoid repetation
SimonBrandner May 9, 2021
ff60bba
Remove import that was a mistake
SimonBrandner May 10, 2021
a13cf0e
Remove placeScreenSharingCall()
SimonBrandner May 10, 2021
f2c2153
If we can't get constraints don't error
SimonBrandner May 10, 2021
61e7d4f
Remove some leftovers from placeScreensharingCall()
SimonBrandner May 10, 2021
582aafa
Simpler naming
SimonBrandner May 10, 2021
2596c25
Add missing semicolon
SimonBrandner May 10, 2021
00a28e7
Move track.stop() to deleteFeedByStream()
SimonBrandner May 10, 2021
960c5da
Merge branch 'develop' into fix/12652/screen-share
SimonBrandner May 13, 2021
5a8e5a9
Log local SDPStreamMetadata
SimonBrandner May 13, 2021
44fc820
Make feed pushing methods more verbose
SimonBrandner May 13, 2021
5de189b
Improve logging in pushRemoteFeed()
SimonBrandner May 15, 2021
78ebf8f
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner May 19, 2021
c2da437
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner May 19, 2021
92e89ff
Add getRidOfRTXCodecs() method
SimonBrandner May 19, 2021
8797381
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner May 19, 2021
b1459a4
Also put getRidOfRTXCodecs() before createAnswer()
SimonBrandner May 20, 2021
a1a5d85
Stop tracks only if disabling screen-sharing
SimonBrandner May 20, 2021
87689ca
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner May 20, 2021
db4c6af
Fix an odd mistake
SimonBrandner May 20, 2021
4aa2c03
Merge branch 'develop' into fix/12652/screen-share
SimonBrandner May 27, 2021
43198b0
Disable RTX only for screen-sharing transceivers
SimonBrandner May 27, 2021
7532122
Simplifie code - don't be an idiot
SimonBrandner May 27, 2021
f461905
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner May 28, 2021
0a04897
Add missing space
SimonBrandner May 28, 2021
5724462
Delint
SimonBrandner May 28, 2021
d8fd121
Merge branch 'develop' into fix/12652/screen-share
SimonBrandner Jun 2, 2021
090c2c0
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jun 4, 2021
ef7595b
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jun 4, 2021
0e05f9f
Styling
SimonBrandner Jun 4, 2021
c1625e5
More styling :(
SimonBrandner Jun 4, 2021
ca37ae6
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jun 9, 2021
641c852
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 7, 2021
0318c65
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 8, 2021
1607ad2
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 16, 2021
019e93e
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 16, 2021
bee840c
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 20, 2021
80d7c88
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 20, 2021
ceafb1c
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 21, 2021
fcbbcc0
Always return true for voice calls
SimonBrandner Jul 22, 2021
019abc7
Merge remote-tracking branch 'upstream/develop' into fix/12652/screen…
SimonBrandner Jul 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions spec/unit/webrtc/call.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.

import { TestClient } from '../../TestClient';
import { MatrixCall, CallErrorCode, CallEvent } from '../../../src/webrtc/call';
import { SDPStreamMetadataKey, SDPStreamMetadataPurpose } from '../../../src/webrtc/callEventTypes';

const DUMMY_SDP = (
"v=0\r\n" +
Expand Down Expand Up @@ -298,4 +299,65 @@ describe('Call', function() {
// Hangup to stop timers
call.hangup(CallErrorCode.UserHangup, true);
});

it("should map SDPStreamMetadata to feeds", async () => {
const callPromise = call.placeVoiceCall();
await client.httpBackend.flush();
await callPromise;

call.getOpponentMember = () => {
return { userId: "@bob:bar.uk" };
};

await call.onAnswerReceived({
getContent: () => {
return {
version: 1,
call_id: call.callId,
party_id: 'party_id',
answer: {
sdp: DUMMY_SDP,
},
[SDPStreamMetadataKey]: {
"stream_id": {
purpose: SDPStreamMetadataPurpose.Usermedia,
},
},
};
},
});

call.pushRemoteFeed({ id: "stream_id" });
expect(call.getFeeds().find((feed) => {
return feed.stream.id === "stream_id";
})?.purpose).toBe(SDPStreamMetadataPurpose.Usermedia);
});

it("should fallback to replaceTrack() if the other side doesn't support SPDStreamMetadata", async () => {
const callPromise = call.placeVoiceCall();
await client.httpBackend.flush();
await callPromise;

call.getOpponentMember = () => {
return { userId: "@bob:bar.uk" };
};

await call.onAnswerReceived({
getContent: () => {
return {
version: 1,
call_id: call.callId,
party_id: 'party_id',
answer: {
sdp: DUMMY_SDP,
},
};
},
});

call.setScreensharingEnabledWithoutMetadataSupport = jest.fn();

call.setScreensharingEnabled(true);
expect(call.setScreensharingEnabledWithoutMetadataSupport).toHaveBeenCalled();
});
});
Loading