Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Nov 9, 2023
2 parents 0f85c86 + 5f160ec commit 316f2c8
Show file tree
Hide file tree
Showing 19 changed files with 704 additions and 387 deletions.
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"parse",
"pranswer",
"prflx",
"protoo",
"psfb",
"raddr",
"reconfig",
Expand Down Expand Up @@ -69,8 +70,10 @@
"xffffffffn"
],
"liveServer.settings.port": 5501,
"liveServer.settings.ignoreFiles": ["**"],
"liveServer.settings.ignoreFiles": [
"**"
],
"typescript.tsdk": "node_modules/typescript/lib",
"python.formatting.provider": "black",
"commentTranslate.source": "intellsmi.deepl-translate-deepl"
}
}
4 changes: 2 additions & 2 deletions e2e/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = function (config) {
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
customLaunchers: {
chrome_headless_with_fake_device: {
base: "ChromeCanaryHeadless",
base: "ChromeHeadless",
flags: [
"--use-fake-device-for-media-stream",
"--use-fake-ui-for-media-stream",
Expand All @@ -53,7 +53,7 @@ module.exports = function (config) {
],
},
chrome_with_fake_device: {
base: "ChromeCanary",
base: "Chrome",
flags: [
"--use-fake-device-for-media-stream",
"--use-fake-ui-for-media-stream",
Expand Down
386 changes: 238 additions & 148 deletions e2e/package-lock.json

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions e2e/server/handler/mediachannel/addTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,28 @@ import {
MediaStreamTrack,
RtpPacket,
randomPort,
MediaStreamTrackFactory,
} from "../../";
import { peerConfig } from "../../fixture";

export class mediachannel_addTrack_answer {
pc!: RTCPeerConnection;
process!: ChildProcess;
udp = createSocket("udp4");
private disposer = () => {};

async exec(type: string, payload: any, accept: AcceptFn) {
switch (type) {
case "init":
{
const port = await randomPort();
this.udp.bind(port);
const [track, port, disposer] =
await MediaStreamTrackFactory.rtpSource({ kind: "video" });
this.disposer = disposer;

this.pc = new RTCPeerConnection(await peerConfig);
const track = new MediaStreamTrack({ kind: "video" });
this.pc.addTrack(track);
await this.pc.setLocalDescription(await this.pc.createOffer());
accept(this.pc.localDescription);

this.udp.on("message", (data) => {
const rtp = RtpPacket.deSerialize(data);
track.writeRtp(rtp);
});

const args = [
`videotestsrc`,
"video/x-raw,width=640,height=480,format=I420",
Expand All @@ -56,7 +52,7 @@ export class mediachannel_addTrack_answer {
break;
case "done":
{
this.udp.close();
this.disposer();
this.pc.close();
try {
this.process.kill("SIGINT");
Expand Down
1 change: 0 additions & 1 deletion examples/mediachannel/sendonly/offer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ server.on("connection", async (socket) => {
"rtpvp8pay",
`udpsink host=127.0.0.1 port=${port}`,
].join(" ! ");

spawn("gst-launch-1.0", args.split(" "));
udp.on("message", (data) => {
const rtp = RtpPacket.deSerialize(data);
Expand Down
51 changes: 27 additions & 24 deletions examples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 316f2c8

Please sign in to comment.