Skip to content

Commit

Permalink
Merge commit 'b7fa16501bbfbedd073e8969c760d474fca07042' into feature/mp4
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyoshiaki committed Nov 12, 2023
2 parents 05fa539 + b7fa165 commit 3d3c4bd
Show file tree
Hide file tree
Showing 27 changed files with 849 additions and 505 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"parse",
"pranswer",
"prflx",
"protoo",
"psfb",
"raddr",
"reconfig",
Expand Down
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
473 changes: 290 additions & 183 deletions e2e/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@types/node": "^18.6.3",
"@types/protoo-client": "^4.0.1",
"@types/protoo-server": "^4.0.2",
"axios": "^0.27.2",
"axios": "^1.6.0",
"babel-preset-env": "^1.7.0",
"express": "^4.17.3",
"jasmine-core": "^4.3.0",
Expand Down
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
158 changes: 73 additions & 85 deletions examples/package-lock.json

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

2 changes: 1 addition & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/socket.io-client": "^3.0.0",
"@types/uuid": "^8.3.1",
"@types/ws": "^7.4.5",
"axios": "^0.21.2",
"axios": "^1.6.0",
"benchmark": "^2.1.4",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
Expand Down
Loading

0 comments on commit 3d3c4bd

Please sign in to comment.