From fa7b37ed89c083dbe5c2cb86c84fccef70da05af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 19:29:59 +0000 Subject: [PATCH 1/6] build(deps-dev): bump @babel/traverse from 7.17.3 to 7.23.2 Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 403 ++++++++++++++++++++++++---------------------- 1 file changed, 210 insertions(+), 193 deletions(-) diff --git a/package-lock.json b/package-lock.json index ea6189c92..6827cf68d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,12 +44,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" @@ -95,14 +96,15 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" @@ -208,13 +210,10 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" - }, "engines": { "node": ">=6.9.0" } @@ -232,38 +231,25 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -388,21 +374,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -447,13 +442,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -461,9 +456,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.7.tgz", - "integrity": "sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1749,33 +1744,33 @@ } }, "node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1784,12 +1779,13 @@ } }, "node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1889,29 +1885,52 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@nodelib/fs.scandir": { @@ -2560,7 +2579,7 @@ "node_modules/chalk/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -2638,7 +2657,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/colorette": { @@ -2938,7 +2957,7 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -5421,15 +5440,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -5932,12 +5942,13 @@ } }, "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" } }, "@babel/compat-data": { @@ -5970,14 +5981,15 @@ } }, "@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "requires": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" } }, "@babel/helper-annotate-as-pure": { @@ -6053,13 +6065,10 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true }, "@babel/helper-explode-assignable-expression": { "version": "7.16.7", @@ -6071,32 +6080,22 @@ } }, "@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, "@babel/helper-member-expression-to-functions": { @@ -6191,18 +6190,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, + "@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -6235,20 +6240,20 @@ } }, "@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.7.tgz", - "integrity": "sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -7099,41 +7104,42 @@ } }, "@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, @@ -7200,26 +7206,43 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@nodelib/fs.scandir": { @@ -7661,7 +7684,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "supports-color": { @@ -7723,7 +7746,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "colorette": { @@ -7965,7 +7988,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true }, "eslint": { @@ -9774,12 +9797,6 @@ } } }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", From 94add9be9f8d2223ec3cd342ce695bc04abedf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 17 Oct 2023 21:59:20 +0200 Subject: [PATCH 2/6] ios,android: update WebRTC to M118 --- android/build.gradle | 2 +- package-lock.json | 4 ++-- package.json | 2 +- react-native-webrtc.podspec | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 803c19d87..337b397c2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,5 +25,5 @@ android { dependencies { implementation 'com.facebook.react:react-native:+' - api 'org.jitsi:webrtc:111.+' + api 'org.jitsi:webrtc:118.+' } diff --git a/package-lock.json b/package-lock.json index 6827cf68d..72551652b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-webrtc", - "version": "111.0.6", + "version": "118.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "react-native-webrtc", - "version": "111.0.6", + "version": "118.0.0", "license": "MIT", "dependencies": { "base64-js": "1.5.1", diff --git a/package.json b/package.json index f7ed17ccc..af586f8f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-webrtc", - "version": "111.0.6", + "version": "118.0.0", "repository": { "type": "git", "url": "git+https://github.com/react-native-webrtc/react-native-webrtc.git" diff --git a/react-native-webrtc.podspec b/react-native-webrtc.podspec index 83a7e3edc..79a266705 100644 --- a/react-native-webrtc.podspec +++ b/react-native-webrtc.podspec @@ -19,5 +19,5 @@ Pod::Spec.new do |s| s.libraries = 'c', 'sqlite3', 'stdc++' s.framework = 'AudioToolbox','AVFoundation', 'CoreAudio', 'CoreGraphics', 'CoreVideo', 'GLKit', 'VideoToolbox' s.dependency 'React-Core' - s.dependency 'JitsiWebRTC', '~> 111.0.0' + s.dependency 'JitsiWebRTC', '~> 118.0.0' end From 914c6363de2fbc7141a8b0bc35a5cff11d936e37 Mon Sep 17 00:00:00 2001 From: davidliu Date: Thu, 8 Jun 2023 01:09:36 +0900 Subject: [PATCH 3/6] ios,android: setCodecPreferences and getCapabilities --- .../com/oney/WebRTCModule/SerializeUtils.java | 39 ++++++- .../com/oney/WebRTCModule/WebRTCModule.java | 101 +++++++++++++++--- ios/RCTWebRTC/SerializeUtils.h | 3 + ios/RCTWebRTC/SerializeUtils.m | 49 +++++++-- ios/RCTWebRTC/WebRTCModule+Transceivers.m | 93 ++++++++++++++-- src/RTCRtpCapabilities.ts | 51 +-------- src/RTCRtpReceiver.ts | 12 +-- src/RTCRtpSender.ts | 12 +-- src/RTCRtpTransceiver.ts | 9 ++ 9 files changed, 261 insertions(+), 108 deletions(-) diff --git a/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java b/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java index 749a3a5ba..bf1ec2872 100644 --- a/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +++ b/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java @@ -170,11 +170,7 @@ public static ReadableMap serializeRtpParameters(RtpParameters params) { } // Serializing sdpFmptLine. if (!codec.parameters.isEmpty()) { - final String sdpFmptLineParams = codec.parameters.keySet() - .stream() - .map(key -> key + "=" + codec.parameters.get(key)) - .collect(Collectors.joining(";")); - codecMap.putString("sdpFmtpLine", sdpFmptLineParams); + codecMap.putString("sdpFmtpLine", serializeSdpParameters(codec.parameters)); } codecs.pushMap(codecMap); @@ -192,6 +188,39 @@ public static ReadableMap serializeRtpParameters(RtpParameters params) { return result; } + public static ReadableMap serializeRtpCapabilities(RtpCapabilities capabilities) { + WritableMap result = Arguments.createMap(); + WritableArray codecs = Arguments.createArray(); + + capabilities.codecs.forEach(codec -> codecs.pushMap(serializeRtpCapabilitiesCodec(codec))); + + result.putArray("codecs", codecs); + return result; + } + + public static ReadableMap serializeRtpCapabilitiesCodec(RtpCapabilities.CodecCapability codec) { + WritableMap codecMap = Arguments.createMap(); + codecMap.putInt("payloadType", codec.preferredPayloadType); + codecMap.putString("mimeType", codec.mimeType); + codecMap.putInt("clockRate", codec.clockRate); + if (codec.numChannels != null) { + codecMap.putInt("channels", codec.numChannels); + } + if (!codec.parameters.isEmpty()) { + codecMap.putString("sdpFmtpLine", serializeSdpParameters(codec.parameters)); + } + + return codecMap; + } + + // For serializing sdpFmptLine. + public static String serializeSdpParameters(Map parameters) { + return parameters.keySet() + .stream() + .map(key -> key + "=" + parameters.get(key)) + .collect(Collectors.joining(";")); + } + /** * Parsing APIs */ diff --git a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java index ca72005d1..3f9dd15a3 100644 --- a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +++ b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java @@ -1,6 +1,7 @@ package com.oney.WebRTCModule; import android.util.Log; +import android.util.Pair; import android.util.SparseArray; import androidx.annotation.NonNull; @@ -709,6 +710,68 @@ public void transceiverSetDirection(int id, String senderId, String direction, P }); } + @ReactMethod(isBlockingSynchronousMethod = true) + public void transceiverSetCodecPreferences(int id, String senderId, ReadableArray codecPreferences) { + ThreadUtils.runOnExecutor(() -> { + WritableMap identifier = Arguments.createMap(); + WritableMap params = Arguments.createMap(); + identifier.putInt("peerConnectionId", id); + identifier.putString("transceiverId", senderId); + try { + PeerConnectionObserver pco = mPeerConnectionObservers.get(id); + if (pco == null) { + Log.d(TAG, "transceiverSetDirection() peerConnectionObserver is null"); + return; + } + RtpTransceiver transceiver = pco.getTransceiver(senderId); + if (transceiver == null) { + Log.d(TAG, "transceiverSetDirection() transceiver is null"); + return; + } + + // Convert JSON codec capabilities to the actual objects. + RtpTransceiver.RtpTransceiverDirection direction = transceiver.getDirection(); + List, RtpCapabilities.CodecCapability>> availableCodecs = new ArrayList<>(); + + if (direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_RECV) + || direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_ONLY)) { + RtpCapabilities capabilities = mFactory.getRtpSenderCapabilities(transceiver.getMediaType()); + for (RtpCapabilities.CodecCapability codec : capabilities.codecs) { + Map codecDict = SerializeUtils.serializeRtpCapabilitiesCodec(codec).toHashMap(); + availableCodecs.add(new Pair<>(codecDict, codec)); + } + } + + if (direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_RECV) + || direction.equals(RtpTransceiver.RtpTransceiverDirection.RECV_ONLY)) { + RtpCapabilities capabilities = mFactory.getRtpReceiverCapabilities(transceiver.getMediaType()); + for (RtpCapabilities.CodecCapability codec : capabilities.codecs) { + Map codecDict = SerializeUtils.serializeRtpCapabilitiesCodec(codec).toHashMap(); + availableCodecs.add(new Pair<>(codecDict, codec)); + } + } + + // Codec preferences is order sensitive. + List codecsToSet = new ArrayList<>(); + + for (int i = 0; i < codecPreferences.size(); i++) { + Map codecPref = codecPreferences.getMap(i).toHashMap(); + for (Pair, RtpCapabilities.CodecCapability> pair : availableCodecs) { + Map availableCodecDict = pair.first; + if (codecPref.equals(availableCodecDict)) { + codecsToSet.add(pair.second); + break; + } + } + } + + transceiver.setCodecPreferences(codecsToSet); + } catch (Exception e) { + Log.d(TAG, "transceiverSetCodecPreferences(): " + e.getMessage()); + } + }); + } + @ReactMethod public void getDisplayMedia(Promise promise) { ThreadUtils.runOnExecutor(() -> getUserMediaImpl.getDisplayMedia(promise)); @@ -1129,18 +1192,21 @@ public void onSetFailure(String s) { } @ReactMethod(isBlockingSynchronousMethod = true) - public WritableMap receiverGetCapabilities() { + public WritableMap receiverGetCapabilities(String kind) { try { return (WritableMap) ThreadUtils .submitToExecutor((Callable) () -> { - VideoCodecInfo[] videoCodecInfos = mVideoDecoderFactory.getSupportedCodecs(); - WritableMap params = Arguments.createMap(); - WritableArray codecs = Arguments.createArray(); - for (VideoCodecInfo codecInfo : videoCodecInfos) { - codecs.pushMap(SerializeUtils.serializeVideoCodecInfo(codecInfo)); + MediaStreamTrack.MediaType mediaType; + if (kind.equals("audio")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO; + } else if (kind.equals("video")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO; + } else { + return Arguments.createMap(); } - params.putArray("codecs", codecs); - return params; + + RtpCapabilities capabilities = mFactory.getRtpReceiverCapabilities(mediaType); + return SerializeUtils.serializeRtpCapabilities(capabilities); }) .get(); } catch (ExecutionException | InterruptedException e) { @@ -1150,18 +1216,21 @@ public WritableMap receiverGetCapabilities() { } @ReactMethod(isBlockingSynchronousMethod = true) - public WritableMap senderGetCapabilities() { + public WritableMap senderGetCapabilities(String kind) { try { return (WritableMap) ThreadUtils .submitToExecutor((Callable) () -> { - VideoCodecInfo[] videoCodecInfos = mVideoEncoderFactory.getSupportedCodecs(); - WritableMap params = Arguments.createMap(); - WritableArray codecs = Arguments.createArray(); - for (VideoCodecInfo codecInfo : videoCodecInfos) { - codecs.pushMap(SerializeUtils.serializeVideoCodecInfo(codecInfo)); + MediaStreamTrack.MediaType mediaType; + if (kind.equals("audio")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO; + } else if (kind.equals("video")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO; + } else { + return Arguments.createMap(); } - params.putArray("codecs", codecs); - return params; + + RtpCapabilities capabilities = mFactory.getRtpSenderCapabilities(mediaType); + return SerializeUtils.serializeRtpCapabilities(capabilities); }) .get(); } catch (ExecutionException | InterruptedException e) { diff --git a/ios/RCTWebRTC/SerializeUtils.h b/ios/RCTWebRTC/SerializeUtils.h index 62e53948a..412618061 100644 --- a/ios/RCTWebRTC/SerializeUtils.h +++ b/ios/RCTWebRTC/SerializeUtils.h @@ -1,4 +1,5 @@ #import +#import #import #import #import @@ -13,6 +14,8 @@ receiver:(RTCRtpReceiver *_Nonnull)receiver; + (NSDictionary *_Nonnull)trackToJSONWithPeerConnectionId:(nonnull NSNumber *)id track:(RTCMediaStreamTrack *_Nonnull)track; ++ (NSDictionary *_Nonnull)capabilitiesToJSON:(RTCRtpCapabilities *_Nonnull)capabilities; ++ (NSDictionary *_Nonnull)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec; + (NSString *_Nonnull)serializeDirection:(RTCRtpTransceiverDirection)direction; + (RTCRtpTransceiverDirection)parseDirection:(NSString *_Nonnull)direction; + (RTCRtpTransceiverInit *_Nonnull)parseTransceiverOptions:(NSDictionary *_Nonnull)parameters; diff --git a/ios/RCTWebRTC/SerializeUtils.m b/ios/RCTWebRTC/SerializeUtils.m index 08e31148d..c4deef1b0 100644 --- a/ios/RCTWebRTC/SerializeUtils.m +++ b/ios/RCTWebRTC/SerializeUtils.m @@ -130,13 +130,7 @@ + (NSDictionary *)parametersToJSON:(RTCRtpParameters *)params { } if (codec.parameters.count) { - NSMutableArray *parts = [NSMutableArray arrayWithCapacity:codec.parameters.count]; - [codec.parameters - enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull value, BOOL *_Nonnull stop) { - [parts addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; - }]; - - codecDictionary[@"sdpFmtpLine"] = [parts componentsJoinedByString:@";"]; + codecDictionary[@"sdpFmtpLine"] = [self serializeSdpParameters:codec.parameters]; } [codecs addObject:codecDictionary]; @@ -176,6 +170,47 @@ + (NSDictionary *)trackToJSONWithPeerConnectionId:(NSNumber *)id track:(RTCMedia }; } ++ (NSDictionary *)capabilitiesToJSON:(RTCRtpCapabilities *)capabilities { + NSMutableArray *codecs = [NSMutableArray new]; + + for (RTCRtpCodecCapability *codec in capabilities.codecs) { + [codecs addObject:[self codecCapabilityToJSON:codec]]; + } + + return @{@"codecs" : codecs}; +} + ++ (NSDictionary *)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec { + NSMutableDictionary *codecDictionary = [NSMutableDictionary new]; + + codecDictionary[@"payloadType"] = codec.preferredPayloadType; + codecDictionary[@"mimeType"] = codec.mimeType; + codecDictionary[@"clockRate"] = codec.clockRate; + + if (codec.numChannels) { + codecDictionary[@"channels"] = codec.numChannels; + } + + if (codec.parameters.count) { + codecDictionary[@"sdpFmtpLine"] = [self serializeSdpParameters:codec.parameters]; + } + + return codecDictionary; +} + ++ (NSString *)serializeSdpParameters:(NSDictionary *)parameters { + if (parameters == nil || parameters.count == 0) { + return nil; + } + + NSMutableArray *parts = [NSMutableArray arrayWithCapacity:parameters.count]; + [parameters enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull value, BOOL *_Nonnull stop) { + [parts addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; + }]; + + return [parts componentsJoinedByString:@";"]; +} + + (NSString *)serializeDirection:(RTCRtpTransceiverDirection)direction { if (direction == RTCRtpTransceiverDirectionInactive) { return @"inactive"; diff --git a/ios/RCTWebRTC/WebRTCModule+Transceivers.m b/ios/RCTWebRTC/WebRTCModule+Transceivers.m index 3981d9b92..5b7c3ee53 100644 --- a/ios/RCTWebRTC/WebRTCModule+Transceivers.m +++ b/ios/RCTWebRTC/WebRTCModule+Transceivers.m @@ -3,6 +3,7 @@ #import #import +#import #import #import @@ -11,31 +12,37 @@ @implementation WebRTCModule (Transceivers) -RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(senderGetCapabilities) { +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(senderGetCapabilities : (NSString *)kind) { __block id params; dispatch_sync(self.workerQueue, ^{ - NSMutableArray *videoCodecs = [NSMutableArray new]; - for (RTCVideoCodecInfo *videoCodecInfo in [self.encoderFactory supportedCodecs]) { - [videoCodecs addObject:@{@"mimeType" : [NSString stringWithFormat:@"video/%@", videoCodecInfo.name]}]; + RTCRtpMediaType mediaType = RTCRtpMediaTypeUnsupported; + if ([kind isEqual:@"audio"]) { + mediaType = RTCRtpMediaTypeAudio; + } else if ([kind isEqual:@"video"]) { + mediaType = RTCRtpMediaTypeVideo; } - params = @{@"codecs" : videoCodecs}; + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:mediaType]; + params = [SerializeUtils capabilitiesToJSON:capabilities]; }); return params; } -RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(receiverGetCapabilities) { +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(receiverGetCapabilities : (NSString *)kind) { __block id params; dispatch_sync(self.workerQueue, ^{ - NSMutableArray *videoCodecs = [NSMutableArray new]; - for (RTCVideoCodecInfo *videoCodecInfo in [self.decoderFactory supportedCodecs]) { - [videoCodecs addObject:@{@"mimeType" : [NSString stringWithFormat:@"video/%@", videoCodecInfo.name]}]; + RTCRtpMediaType mediaType = RTCRtpMediaTypeUnsupported; + if ([kind isEqual:@"audio"]) { + mediaType = RTCRtpMediaTypeAudio; + } else if ([kind isEqual:@"video"]) { + mediaType = RTCRtpMediaTypeVideo; } - params = @{@"codecs" : videoCodecs}; + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:mediaType]; + params = [SerializeUtils capabilitiesToJSON:capabilities]; }); return params; @@ -178,6 +185,72 @@ @implementation WebRTCModule (Transceivers) resolve(@true); } +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(transceiverSetCodecPreferences + : (nonnull NSNumber *)objectID senderId + : (NSString *)senderId codecPreferences + : (NSArray *)codecPreferences) { + RTCPeerConnection *peerConnection = self.peerConnections[objectID]; + + if (peerConnection == nil) { + RCTLogWarn(@"PeerConnection %@ not found in transceiverSetCodecPreferences()", objectID); + return nil; + } + + RTCRtpTransceiver *transceiver = nil; + for (RTCRtpTransceiver *t in peerConnection.transceivers) { + if ([senderId isEqual:t.sender.senderId]) { + transceiver = t; + break; + } + } + + if (transceiver == nil) { + RCTLogWarn(@"senderSetParameters() transceiver is null"); + return nil; + } + + // Convert JSON codec capabilities to the actual objects. + RTCRtpTransceiverDirection direction = transceiver.direction; + NSMutableArray *availableCodecs = [NSMutableArray new]; + if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionSendOnly) { + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:transceiver.mediaType]; + for (RTCRtpCodecCapability *codec in capabilities.codecs) { + NSDictionary *codecDict = [SerializeUtils codecCapabilityToJSON:codec]; + [availableCodecs addObject:@{ + @"dict" : codecDict, + @"codec" : codec, + }]; + } + } + if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionRecvOnly) { + RTCRtpCapabilities *capabilities = + [self.peerConnectionFactory rtpReceiverCapabilitiesFor:transceiver.mediaType]; + for (RTCRtpCodecCapability *codec in capabilities.codecs) { + NSDictionary *codecDict = [SerializeUtils codecCapabilityToJSON:codec]; + [availableCodecs addObject:@{ + @"dict" : codecDict, + @"codec" : codec, + }]; + } + } + + // Codec preferences is order sensitive. + NSMutableArray *codecsToSet = [NSMutableArray new]; + + for (NSDictionary *codecDict in codecPreferences) { + for (NSDictionary *entry in availableCodecs) { + NSDictionary *availableCodecDict = [entry objectForKey:@"dict"]; + if ([codecDict isEqualToDictionary:availableCodecDict]) { + [codecsToSet addObject:[entry objectForKey:@"codec"]]; + break; + } + } + } + + transceiver.codecPreferences = codecsToSet; + return nil; +} + - (RTCRtpParameters *)updateParametersWithOptions:(NSDictionary *)options params:(RTCRtpParameters *)params { NSArray *encodingsArray = options[@"encodings"]; NSArray *encodings = params.encodings; diff --git a/src/RTCRtpCapabilities.ts b/src/RTCRtpCapabilities.ts index 7f422595c..1d0fbc7b7 100644 --- a/src/RTCRtpCapabilities.ts +++ b/src/RTCRtpCapabilities.ts @@ -1,12 +1,7 @@ -import { NativeModules } from 'react-native'; - import RTCRtpCodecCapability from './RTCRtpCodecCapability'; -const { WebRTCModule } = NativeModules; /** - * @brief represents codec capabilities for senders and receivers. Currently - * this only supports codec names and does not have other - * fields like clockRate and numChannels and such. + * @brief represents codec capabilities for senders and receivers. */ export default class RTCRtpCapabilities { _codecs: RTCRtpCodecCapability[] = []; @@ -19,47 +14,3 @@ export default class RTCRtpCapabilities { return this._codecs; } } - - -function getCapabilities(endpoint: 'sender' | 'receiver'): RTCRtpCapabilities | null { - switch (endpoint) { - case 'sender': { - const capabilities = WebRTCModule.senderGetCapabilities(); - - if (!capabilities) { - return null; - } - - return new RTCRtpCapabilities(capabilities.codecs); - } - - case 'receiver': { - const capabilities = WebRTCModule.receiverGetCapabilities(); - - if (!capabilities) { - return null; - } - - return new RTCRtpCapabilities(capabilities.codecs); - } - - default: - throw new TypeError('Invalid endpoint: ' + endpoint); - } -} - - -/** - * Hardcoded audio capabilities based on the WebRTC native documentation: - * https://webrtc.github.io/webrtc-org/faq/. The mime type is specified in - * https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2. - */ -export const DEFAULT_AUDIO_CAPABILITIES = new RTCRtpCapabilities([ - new RTCRtpCodecCapability({ mimeType: 'audio/G722' }), - new RTCRtpCodecCapability({ mimeType: 'audio/iLBC' }), -]); - -// Initialize capabilities on module import -export const senderCapabilities = getCapabilities('sender'); -export const receiverCapabilities = getCapabilities('receiver'); - diff --git a/src/RTCRtpReceiver.ts b/src/RTCRtpReceiver.ts index e63d36fb3..228fce008 100644 --- a/src/RTCRtpReceiver.ts +++ b/src/RTCRtpReceiver.ts @@ -1,7 +1,7 @@ import { NativeModules } from 'react-native'; import MediaStreamTrack from './MediaStreamTrack'; -import RTCRtpCapabilities, { DEFAULT_AUDIO_CAPABILITIES, receiverCapabilities } from './RTCRtpCapabilities'; +import RTCRtpCapabilities from './RTCRtpCapabilities'; import { RTCRtpParametersInit } from './RTCRtpParameters'; import RTCRtpReceiveParameters from './RTCRtpReceiveParameters'; @@ -29,15 +29,7 @@ export default class RTCRtpReceiver { } static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities { - if (kind === 'audio') { - return DEFAULT_AUDIO_CAPABILITIES; - } - - if (!receiverCapabilities) { - throw new Error('Receiver Capabilities is null'); - } - - return receiverCapabilities; + return WebRTCModule.receiverGetCapabilities(kind); } getStats() { diff --git a/src/RTCRtpSender.ts b/src/RTCRtpSender.ts index 7a53d6331..4366b32fd 100644 --- a/src/RTCRtpSender.ts +++ b/src/RTCRtpSender.ts @@ -1,7 +1,7 @@ import { NativeModules } from 'react-native'; import MediaStreamTrack from './MediaStreamTrack'; -import RTCRtpCapabilities, { senderCapabilities, DEFAULT_AUDIO_CAPABILITIES } from './RTCRtpCapabilities'; +import RTCRtpCapabilities from './RTCRtpCapabilities'; import RTCRtpSendParameters, { RTCRtpSendParametersInit } from './RTCRtpSendParameters'; const { WebRTCModule } = NativeModules; @@ -39,15 +39,7 @@ export default class RTCRtpSender { } static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities { - if (kind === 'audio') { - return DEFAULT_AUDIO_CAPABILITIES; - } - - if (!senderCapabilities) { - throw new Error('sender Capabilities are null'); - } - - return senderCapabilities; + return WebRTCModule.senderGetCapabilities(kind); } getParameters(): RTCRtpSendParameters { diff --git a/src/RTCRtpTransceiver.ts b/src/RTCRtpTransceiver.ts index ded126530..ad3d859f2 100644 --- a/src/RTCRtpTransceiver.ts +++ b/src/RTCRtpTransceiver.ts @@ -1,5 +1,6 @@ import { NativeModules } from 'react-native'; +import RTCRtpCodecCapability from './RTCRtpCodecCapability'; import RTCRtpReceiver from './RTCRtpReceiver'; import RTCRtpSender from './RTCRtpSender'; @@ -89,6 +90,14 @@ export default class RTCRtpTransceiver { .then(() => this._setStopped()); } + setCodecPreferences(codecs: RTCRtpCodecCapability[]) { + WebRTCModule.transceiverSetCodecPreferences( + this._peerConnectionId, + this.sender.id, + codecs + ); + } + _setStopped() { this._stopped = true; this._direction = 'stopped'; From eb2b0c482e934a6fc7aff571a6960ff57cee0841 Mon Sep 17 00:00:00 2001 From: Johnathon Weaver Date: Fri, 20 Oct 2023 10:58:44 +0800 Subject: [PATCH 4/6] ios build fix: missing type --- ios/RCTWebRTC/SerializeUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/RCTWebRTC/SerializeUtils.h b/ios/RCTWebRTC/SerializeUtils.h index 412618061..1b7f1367f 100644 --- a/ios/RCTWebRTC/SerializeUtils.h +++ b/ios/RCTWebRTC/SerializeUtils.h @@ -15,7 +15,7 @@ + (NSDictionary *_Nonnull)trackToJSONWithPeerConnectionId:(nonnull NSNumber *)id track:(RTCMediaStreamTrack *_Nonnull)track; + (NSDictionary *_Nonnull)capabilitiesToJSON:(RTCRtpCapabilities *_Nonnull)capabilities; -+ (NSDictionary *_Nonnull)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec; ++ (NSDictionary *_Nonnull)codecCapabilityToJSON:(RTCRtpCodecCapability *_Nonnull)codec; + (NSString *_Nonnull)serializeDirection:(RTCRtpTransceiverDirection)direction; + (RTCRtpTransceiverDirection)parseDirection:(NSString *_Nonnull)direction; + (RTCRtpTransceiverInit *_Nonnull)parseTransceiverOptions:(NSDictionary *_Nonnull)parameters; From 93bfe02101bac93490143130bf3bec545f281976 Mon Sep 17 00:00:00 2001 From: davidliu Date: Wed, 1 Nov 2023 15:21:25 +0900 Subject: [PATCH 5/6] ios: fix setCodecPreferences build error --- ios/RCTWebRTC/WebRTCModule+Transceivers.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/RCTWebRTC/WebRTCModule+Transceivers.m b/ios/RCTWebRTC/WebRTCModule+Transceivers.m index 5b7c3ee53..09a874e08 100644 --- a/ios/RCTWebRTC/WebRTCModule+Transceivers.m +++ b/ios/RCTWebRTC/WebRTCModule+Transceivers.m @@ -205,11 +205,11 @@ @implementation WebRTCModule (Transceivers) } if (transceiver == nil) { - RCTLogWarn(@"senderSetParameters() transceiver is null"); + RCTLogWarn(@"transceiverSetCodecPreferences() transceiver is null"); return nil; } - // Convert JSON codec capabilities to the actual objects. + // Get the available codecs RTCRtpTransceiverDirection direction = transceiver.direction; NSMutableArray *availableCodecs = [NSMutableArray new]; if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionSendOnly) { @@ -233,7 +233,8 @@ @implementation WebRTCModule (Transceivers) }]; } } - + + // Convert JSON codec capabilities to the actual objects. // Codec preferences is order sensitive. NSMutableArray *codecsToSet = [NSMutableArray new]; @@ -247,7 +248,7 @@ @implementation WebRTCModule (Transceivers) } } - transceiver.codecPreferences = codecsToSet; + [transceiver setCodecPreferences:codecsToSet]; return nil; } From 95984a3eb383788a29660956e033149ad5afab99 Mon Sep 17 00:00:00 2001 From: davidliu Date: Wed, 1 Nov 2023 15:37:34 +0900 Subject: [PATCH 6/6] ios: more setCodecPreferences fixes --- ios/RCTWebRTC/WebRTCModule+Transceivers.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios/RCTWebRTC/WebRTCModule+Transceivers.m b/ios/RCTWebRTC/WebRTCModule+Transceivers.m index 09a874e08..7b9ae2bd1 100644 --- a/ios/RCTWebRTC/WebRTCModule+Transceivers.m +++ b/ios/RCTWebRTC/WebRTCModule+Transceivers.m @@ -248,7 +248,12 @@ @implementation WebRTCModule (Transceivers) } } - [transceiver setCodecPreferences:codecsToSet]; + NSError *error; + [transceiver setCodecPreferences:codecsToSet error:&error]; + + if (error) { + RTCLogError(@"transceiverSetCodecPreferences() Could not set preferences: %@", error); + } return nil; }