From 375fbeb0eb48c7b5a2ff28d50c05785b8b6b1a06 Mon Sep 17 00:00:00 2001 From: Krzysztof Moch Date: Fri, 3 Oct 2025 16:14:47 +0200 Subject: [PATCH] feat: bump nitro modules (#4720) --- bun.lock | 34 +- example/ios/Podfile.lock | 4 +- example/package.json | 2 +- ...> react-native-nitro-modules+0.29.8.patch} | 0 .../ReactNativeVideoDrm+autolinking.cmake | 11 +- .../android/ReactNativeVideoDrmOnLoad.cpp | 3 +- .../ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp | 4 +- .../ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp | 10 +- packages/drm-plugin/package.json | 6 +- .../ReactNativeVideo+autolinking.cmake | 11 +- .../android/ReactNativeVideoOnLoad.cpp | 9 +- .../ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp | 64 +-- .../ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp | 366 +++++++++++------- ...ybridVideoPlayerSourceFactorySpecSwift.hpp | 2 +- .../c++/HybridVideoPlayerSourceSpecSwift.hpp | 3 +- .../generated/ios/swift/BufferConfig.swift | 24 +- .../Func_void_std__optional_TextTrack_.swift | 8 +- .../ios/swift/HybridVideoPlayerSpec_cxx.swift | 21 +- .../HybridVideoViewViewManagerSpec_cxx.swift | 21 +- .../generated/ios/swift/NativeDrmParams.swift | 18 +- .../ios/swift/NativeVideoConfig.swift | 48 +-- .../generated/ios/swift/TextTrack.swift | 3 +- .../generated/ios/swift/TimedMetadata.swift | 26 +- packages/react-native-video/package.json | 6 +- 24 files changed, 388 insertions(+), 316 deletions(-) rename example/patches/{react-native-nitro-modules+0.28.0.patch => react-native-nitro-modules+0.29.8.patch} (100%) diff --git a/bun.lock b/bun.lock index aee69f67..5fc93fb3 100644 --- a/bun.lock +++ b/bun.lock @@ -57,7 +57,7 @@ "@twg/react-native-video-drm": "*", "react": "18.3.1", "react-native": "^0.77.0", - "react-native-nitro-modules": "^0.28.0", + "react-native-nitro-modules": "^0.29.0", "react-native-video": "*", }, "devDependencies": { @@ -88,12 +88,12 @@ "eslint": "^8.51.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-prettier": "^5.0.1", - "nitro-codegen": "^0.28.0", + "nitrogen": "^0.29.0", "prettier": "^3.0.3", "react": "18.3.1", "react-native": "^0.77.0", "react-native-builder-bob": "^0.40.13", - "react-native-nitro-modules": "^0.28.0", + "react-native-nitro-modules": "^0.29.0", "react-native-video": "*", "release-it": "^17.10.0", "typescript": "^5.8.3", @@ -116,12 +116,12 @@ "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", - "nitro-codegen": "^0.28.0", + "nitrogen": "^0.29.0", "prettier": "^3.0.3", "react": "18.3.1", "react-native": "^0.77.0", "react-native-builder-bob": "^0.40.0", - "react-native-nitro-modules": "^0.28.0", + "react-native-nitro-modules": "^0.29.0", "typescript": "^5.2.2", }, "peerDependencies": { @@ -662,6 +662,10 @@ "@inquirer/figures": ["@inquirer/figures@1.0.11", "", {}, "sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw=="], + "@isaacs/balanced-match": ["@isaacs/balanced-match@4.0.1", "", {}, "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ=="], + + "@isaacs/brace-expansion": ["@isaacs/brace-expansion@5.0.0", "", { "dependencies": { "@isaacs/balanced-match": "^4.0.1" } }, "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA=="], + "@isaacs/cliui": ["@isaacs/cliui@8.0.2", "", { "dependencies": { "string-width": "^5.1.2", "string-width-cjs": "npm:string-width@^4.2.0", "strip-ansi": "^7.0.1", "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", "wrap-ansi": "^8.1.0", "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" } }, "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA=="], "@isaacs/ttlcache": ["@isaacs/ttlcache@1.4.1", "", {}, "sha512-RQgQ4uQ+pLbqXfOmieB91ejmLwvSgv9nLx6sT6sD83s7umBypgg+OIBOBbEUiJXrfpnp9j0mRhYYdzp9uqq3lA=="], @@ -978,7 +982,7 @@ "@trysound/sax": ["@trysound/sax@0.2.0", "", {}, "sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA=="], - "@ts-morph/common": ["@ts-morph/common@0.26.1", "", { "dependencies": { "fast-glob": "^3.3.2", "minimatch": "^9.0.4", "path-browserify": "^1.0.1" } }, "sha512-Sn28TGl/4cFpcM+jwsH1wLncYq3FtN/BIpem+HOygfBWPT5pAeS5dB4VFVzV8FbnOKHpDLZmvAl4AjPEev5idA=="], + "@ts-morph/common": ["@ts-morph/common@0.28.0", "", { "dependencies": { "minimatch": "^10.0.1", "path-browserify": "^1.0.1", "tinyglobby": "^0.2.14" } }, "sha512-4w6X/oFmvXcwux6y6ExfM/xSqMHw20cYwFJH+BlYrtGa6nwY9qGq8GXnUs1sVYeF2o/KT3S8hAH6sKBI3VOkBg=="], "@tsconfig/node10": ["@tsconfig/node10@1.0.11", "", {}, "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw=="], @@ -1860,6 +1864,8 @@ "fb-watchman": ["fb-watchman@2.0.2", "", { "dependencies": { "bser": "2.1.1" } }, "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA=="], + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + "feed": ["feed@4.2.2", "", { "dependencies": { "xml-js": "^1.6.11" } }, "sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ=="], "figures": ["figures@3.2.0", "", { "dependencies": { "escape-string-regexp": "^1.0.5" } }, "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg=="], @@ -2708,7 +2714,7 @@ "new-github-release-url": ["new-github-release-url@2.0.0", "", { "dependencies": { "type-fest": "^2.5.1" } }, "sha512-NHDDGYudnvRutt/VhKFlX26IotXe1w0cmkDm6JGquh5bz/bDTw0LufSmH/GxTjEdpHEO+bVKFTwdrcGa/9XlKQ=="], - "nitro-codegen": ["nitro-codegen@0.28.0", "", { "dependencies": { "chalk": "^5.3.0", "react-native-nitro-modules": "^0.28.0", "ts-morph": "^25.0.0", "yargs": "^17.7.2", "zod": "^4.0.5" }, "bin": { "nitro-codegen": "lib/index.js" } }, "sha512-sFvLbQQXGKyy3Xer9Oz4J6+KXe4VeKGPzIy893tG65Dfn43rrez849ZG/o/Y3iD2M637ROZeCtGFqQM8mIIo6w=="], + "nitrogen": ["nitrogen@0.29.8", "", { "dependencies": { "chalk": "^5.3.0", "react-native-nitro-modules": "^0.29.8", "ts-morph": "^27.0.0", "yargs": "^17.7.2", "zod": "^4.0.5" }, "bin": { "nitrogen": "lib/index.js" } }, "sha512-ISqyNlqKb06APsSaPQSkbfekQwM7FuoBr3V4Ac9ktq13Vv5s6cg++efkfyEB1lGSBKtd/ceJox/2GWL/TI5Zhw=="], "no-case": ["no-case@3.0.4", "", { "dependencies": { "lower-case": "^2.0.2", "tslib": "^2.0.3" } }, "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg=="], @@ -3090,7 +3096,7 @@ "react-native-monorepo-config": ["react-native-monorepo-config@0.1.9", "", { "dependencies": { "escape-string-regexp": "^5.0.0", "fast-glob": "^3.3.3" } }, "sha512-GLFYMEEcbltxZw7oUbbh/p0oXqA52lSirXt7o/N1qD6CFTvku84OVL6teeQ1Ef92pq+bepq4x0Qz+d6lapVbuQ=="], - "react-native-nitro-modules": ["react-native-nitro-modules@0.28.0", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-SR5fpEOxuzqObowLzwrAU7Pv9Kq+AcxKBTCprMcsaiNlURhex2R8T8moSU/hpZO8Vuf3iomdkzEVEIO8udSZ/w=="], + "react-native-nitro-modules": ["react-native-nitro-modules@0.29.8", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-SyKIR+MmAZadqFEPwD+wiHoG5Lem3EMtAyzLOJ+mU0JB+1+vHxxLLhcV0THoXoxbMSbf5zWOQYVb+JPCEhNtXg=="], "react-native-video": ["react-native-video@workspace:packages/react-native-video"], @@ -3456,6 +3462,8 @@ "tiny-warning": ["tiny-warning@1.0.3", "", {}, "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="], + "tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="], + "tinypool": ["tinypool@1.1.1", "", {}, "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg=="], "tmp": ["tmp@0.0.33", "", { "dependencies": { "os-tmpdir": "~1.0.2" } }, "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw=="], @@ -3478,7 +3486,7 @@ "ts-api-utils": ["ts-api-utils@1.4.3", "", { "peerDependencies": { "typescript": ">=4.2.0" } }, "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw=="], - "ts-morph": ["ts-morph@25.0.1", "", { "dependencies": { "@ts-morph/common": "~0.26.0", "code-block-writer": "^13.0.3" } }, "sha512-QJEiTdnz1YjrB3JFhd626gX4rKHDLSjSVMvGGG4v7ONc3RBwa0Eei98G9AT9uNFDMtV54JyuXsFeC+OH0n6bXQ=="], + "ts-morph": ["ts-morph@27.0.0", "", { "dependencies": { "@ts-morph/common": "~0.28.0", "code-block-writer": "^13.0.3" } }, "sha512-xcqelpTR5PCuZMs54qp9DE3t7tPgA2v/P1/qdW4ke5b3Y5liTGTYj6a/twT35EQW/H5okRqp1UOqwNlgg0K0eQ=="], "ts-node": ["ts-node@10.9.2", "", { "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", "@tsconfig/node12": "^1.0.7", "@tsconfig/node14": "^1.0.0", "@tsconfig/node16": "^1.0.2", "acorn": "^8.4.1", "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "peerDependencies": { "@swc/core": ">=1.2.50", "@swc/wasm": ">=1.2.50", "@types/node": "*", "typescript": ">=2.7" }, "optionalPeers": ["@swc/core", "@swc/wasm"], "bin": { "ts-node": "dist/bin.js", "ts-script": "dist/bin-script-deprecated.js", "ts-node-cwd": "dist/bin-cwd.js", "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js" } }, "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ=="], @@ -3890,7 +3898,7 @@ "@svgr/plugin-svgo/cosmiconfig": ["cosmiconfig@8.3.6", "", { "dependencies": { "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0", "path-type": "^4.0.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA=="], - "@ts-morph/common/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], + "@ts-morph/common/minimatch": ["minimatch@10.0.3", "", { "dependencies": { "@isaacs/brace-expansion": "^5.0.0" } }, "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw=="], "@twg/react-native-video-drm/@release-it/conventional-changelog": ["@release-it/conventional-changelog@9.0.4", "", { "dependencies": { "concat-stream": "^2.0.0", "conventional-changelog": "^6.0.0", "conventional-recommended-bump": "^10.0.0", "git-semver-tags": "^8.0.0", "semver": "^7.6.3" }, "peerDependencies": { "release-it": "^17.0.0" } }, "sha512-eSZVATX2qiyxzpXdIVNczxTGR+uD4lG/ZEfDDYBJ8vKIj6fKp+eYicIS8Ff/eL3bA9XiQTmllKqxPRzmz9d45w=="], @@ -4346,7 +4354,7 @@ "new-github-release-url/type-fest": ["type-fest@2.19.0", "", {}, "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="], - "nitro-codegen/chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="], + "nitrogen/chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="], "normalize-package-data/hosted-git-info": ["hosted-git-info@4.1.0", "", { "dependencies": { "lru-cache": "^6.0.0" } }, "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA=="], @@ -4536,6 +4544,8 @@ "terser-webpack-plugin/jest-worker": ["jest-worker@27.5.1", "", { "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" } }, "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg=="], + "tinyglobby/picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="], + "to-vfile/vfile": ["vfile@4.2.1", "", { "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", "unist-util-stringify-position": "^2.0.0", "vfile-message": "^2.0.0" } }, "sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA=="], "ts-node/arg": ["arg@4.1.3", "", {}, "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA=="], @@ -4850,8 +4860,6 @@ "@svgr/plugin-svgo/cosmiconfig/path-type": ["path-type@4.0.0", "", {}, "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="], - "@ts-morph/common/minimatch/brace-expansion": ["brace-expansion@2.0.1", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA=="], - "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-changelog": ["conventional-changelog@6.0.0", "", { "dependencies": { "conventional-changelog-angular": "^8.0.0", "conventional-changelog-atom": "^5.0.0", "conventional-changelog-codemirror": "^5.0.0", "conventional-changelog-conventionalcommits": "^8.0.0", "conventional-changelog-core": "^8.0.0", "conventional-changelog-ember": "^5.0.0", "conventional-changelog-eslint": "^6.0.0", "conventional-changelog-express": "^5.0.0", "conventional-changelog-jquery": "^6.0.0", "conventional-changelog-jshint": "^5.0.0", "conventional-changelog-preset-loader": "^5.0.0" } }, "sha512-tuUH8H/19VjtD9Ig7l6TQRh+Z0Yt0NZ6w/cCkkyzUbGQTnUEmKfGtkC9gGfVgCfOL1Rzno5NgNF4KY8vR+Jo3w=="], "@twg/react-native-video-drm/@release-it/conventional-changelog/conventional-recommended-bump": ["conventional-recommended-bump@10.0.0", "", { "dependencies": { "@conventional-changelog/git-client": "^1.0.0", "conventional-changelog-preset-loader": "^5.0.0", "conventional-commits-filter": "^5.0.0", "conventional-commits-parser": "^6.0.0", "meow": "^13.0.0" }, "bin": { "conventional-recommended-bump": "dist/cli/index.js" } }, "sha512-RK/fUnc2btot0oEVtrj3p2doImDSs7iiz/bftFCDzels0Qs1mxLghp+DFHMaOC0qiCI6sWzlTDyBFSYuot6pRA=="], diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 290bcf84..8a602135 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -8,7 +8,7 @@ PODS: - hermes-engine (0.77.2): - hermes-engine/Pre-built (= 0.77.2) - hermes-engine/Pre-built (0.77.2) - - NitroModules (0.28.0): + - NitroModules (0.29.8): - DoubleConversion - glog - hermes-engine @@ -1844,7 +1844,7 @@ SPEC CHECKSUMS: fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd glog: eb93e2f488219332457c3c4eafd2738ddc7e80b8 hermes-engine: 8eb265241fa1d7095d3a40d51fd90f7dce68217c - NitroModules: 1e4150c3e3676e05209234a8a5e0e8886fc0311a + NitroModules: b4cd8f92604355343f12fc93772ff5a19571d41f RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82 RCTDeprecation: 85b72250b63cfb54f29ca96ceb108cb9ef3c2079 RCTRequired: 567cb8f5d42b990331bfd93faad1d8999b1c1736 diff --git a/example/package.json b/example/package.json index 33e7a20d..deaca9ff 100644 --- a/example/package.json +++ b/example/package.json @@ -13,7 +13,7 @@ "@react-native-community/slider": "^4.5.6", "react": "18.3.1", "react-native": "^0.77.0", - "react-native-nitro-modules": "^0.28.0", + "react-native-nitro-modules": "^0.29.0", "react-native-video": "*", "@twg/react-native-video-drm": "*" }, diff --git a/example/patches/react-native-nitro-modules+0.28.0.patch b/example/patches/react-native-nitro-modules+0.29.8.patch similarity index 100% rename from example/patches/react-native-nitro-modules+0.28.0.patch rename to example/patches/react-native-nitro-modules+0.29.8.patch diff --git a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake index bc625974..523755d1 100644 --- a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake +++ b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake @@ -13,6 +13,12 @@ # include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/ReactNativeVideoDrm+autolinking.cmake) # ``` +# Define a flag to check if we are building properly +add_definitions(-DBUILDING_REACTNATIVEVIDEODRM_WITH_GENERATED_CMAKE_PROJECT) + +# Enable Raw Props parsing in react-native (for Nitro Views) +add_definitions(-DRN_SERIALIZABLE_STATE) + # Add all headers that were generated by Nitrogen include_directories( "../nitrogen/generated/shared/c++" @@ -32,12 +38,9 @@ target_sources( ../nitrogen/generated/android/c++/JHybridPluginManagerSpec.cpp ) -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVEVIDEODRM_WITH_GENERATED_CMAKE_PROJECT) - # From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake # Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake - target_compile_definitions( +target_compile_definitions( ReactNativeVideoDrm PRIVATE -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 diff --git a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp index 7f1e9d26..af086b67 100644 --- a/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp +++ b/packages/drm-plugin/nitrogen/generated/android/ReactNativeVideoDrmOnLoad.cpp @@ -35,8 +35,7 @@ int initialize(JavaVM* vm) { []() -> std::shared_ptr { static DefaultConstructableObject object("com/margelo/nitro/videodrm/PluginManager"); auto instance = object.create(); - auto globalRef = jni::make_global(instance); - return globalRef->cthis()->shared(); + return instance->cthis()->shared(); } ); }); diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp index 51ee190a..e58e00ba 100644 --- a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.cpp @@ -14,11 +14,11 @@ namespace margelo::nitro::videodrm::bridge::swift { // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridPluginManagerSpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridPluginManagerSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideoDrm::HybridPluginManagerSpec_cxx swiftPart = ReactNativeVideoDrm::HybridPluginManagerSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridPluginManagerSpec_(std__shared_ptr_HybridPluginManagerSpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridPluginManagerSpec_(std__shared_ptr_HybridPluginManagerSpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { diff --git a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp index 8e9b436e..c8fefe6b 100644 --- a/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp +++ b/packages/drm-plugin/nitrogen/generated/ios/ReactNativeVideoDrm-Swift-Cxx-Bridge.hpp @@ -32,19 +32,19 @@ namespace margelo::nitro::videodrm::bridge::swift { * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridPluginManagerSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridPluginManagerSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridPluginManagerSpec_(std__shared_ptr_HybridPluginManagerSpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridPluginManagerSpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridPluginManagerSpec_(std__shared_ptr_HybridPluginManagerSpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridPluginManagerSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridPluginManagerSpec_ weakify_std__shared_ptr_HybridPluginManagerSpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridPluginManagerSpec_ weakify_std__shared_ptr_HybridPluginManagerSpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: Result using Result_void_ = Result; - inline Result_void_ create_Result_void_() { + inline Result_void_ create_Result_void_() noexcept { return Result::withValue(); } - inline Result_void_ create_Result_void_(const std::exception_ptr& error) { + inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { return Result::withError(error); } diff --git a/packages/drm-plugin/package.json b/packages/drm-plugin/package.json index c767fa50..afc60425 100644 --- a/packages/drm-plugin/package.json +++ b/packages/drm-plugin/package.json @@ -40,7 +40,7 @@ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", "prepare": "bun run build", "build": "bob build", - "specs": "nitro-codegen", + "specs": "nitrogen", "release": "release-it --only-version" }, "keywords": [ @@ -71,12 +71,12 @@ "eslint": "^8.51.0", "eslint-config-prettier": "9.0.0", "eslint-plugin-prettier": "^5.0.1", - "nitro-codegen": "^0.28.0", + "nitrogen": "^0.29.0", "prettier": "^3.0.3", "react": "18.3.1", "react-native": "^0.77.0", "react-native-builder-bob": "^0.40.13", - "react-native-nitro-modules": "^0.28.0", + "react-native-nitro-modules": "^0.29.0", "release-it": "^17.10.0", "typescript": "^5.8.3", "react-native-video": "*" diff --git a/packages/react-native-video/nitrogen/generated/android/ReactNativeVideo+autolinking.cmake b/packages/react-native-video/nitrogen/generated/android/ReactNativeVideo+autolinking.cmake index 5fe7a956..3065a295 100644 --- a/packages/react-native-video/nitrogen/generated/android/ReactNativeVideo+autolinking.cmake +++ b/packages/react-native-video/nitrogen/generated/android/ReactNativeVideo+autolinking.cmake @@ -13,6 +13,12 @@ # include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/ReactNativeVideo+autolinking.cmake) # ``` +# Define a flag to check if we are building properly +add_definitions(-DBUILDING_REACTNATIVEVIDEO_WITH_GENERATED_CMAKE_PROJECT) + +# Enable Raw Props parsing in react-native (for Nitro Views) +add_definitions(-DRN_SERIALIZABLE_STATE) + # Add all headers that were generated by Nitrogen include_directories( "../nitrogen/generated/shared/c++" @@ -44,12 +50,9 @@ target_sources( ../nitrogen/generated/android/c++/JHybridVideoViewViewManagerFactorySpec.cpp ) -# Define a flag to check if we are building properly -add_definitions(-DBUILDING_REACTNATIVEVIDEO_WITH_GENERATED_CMAKE_PROJECT) - # From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake # Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake - target_compile_definitions( +target_compile_definitions( ReactNativeVideo PRIVATE -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 diff --git a/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp b/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp index 239d6812..2938284f 100644 --- a/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp +++ b/packages/react-native-video/nitrogen/generated/android/ReactNativeVideoOnLoad.cpp @@ -75,8 +75,7 @@ int initialize(JavaVM* vm) { []() -> std::shared_ptr { static DefaultConstructableObject object("com/margelo/nitro/video/HybridVideoPlayerFactory"); auto instance = object.create(); - auto globalRef = jni::make_global(instance); - return globalRef->cthis()->shared(); + return instance->cthis()->shared(); } ); HybridObjectRegistry::registerHybridObjectConstructor( @@ -84,8 +83,7 @@ int initialize(JavaVM* vm) { []() -> std::shared_ptr { static DefaultConstructableObject object("com/margelo/nitro/video/HybridVideoPlayerSourceFactory"); auto instance = object.create(); - auto globalRef = jni::make_global(instance); - return globalRef->cthis()->shared(); + return instance->cthis()->shared(); } ); HybridObjectRegistry::registerHybridObjectConstructor( @@ -93,8 +91,7 @@ int initialize(JavaVM* vm) { []() -> std::shared_ptr { static DefaultConstructableObject object("com/margelo/nitro/video/HybridVideoViewViewManagerFactory"); auto instance = object.create(); - auto globalRef = jni::make_global(instance); - return globalRef->cthis()->shared(); + return instance->cthis()->shared(); } ); }); diff --git a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp index efb685af..aca622f9 100644 --- a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp +++ b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.cpp @@ -20,11 +20,11 @@ namespace margelo::nitro::video::bridge::swift { // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceSpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSourceSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceSpec_(std__shared_ptr_HybridVideoPlayerSourceSpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSourceSpec_(std__shared_ptr_HybridVideoPlayerSourceSpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -36,11 +36,11 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerEventEmitterSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -52,7 +52,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void create_Func_void(void* _Nonnull swiftClosureWrapper) { + Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)]() mutable -> void { swiftClosure.call(); @@ -60,7 +60,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper) { + Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void { swiftClosure.call(error); @@ -68,11 +68,11 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerSpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSpec_(std__shared_ptr_HybridVideoPlayerSpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSpec_(std__shared_ptr_HybridVideoPlayerSpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -84,11 +84,11 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerFactorySpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerFactorySpec_(std__shared_ptr_HybridVideoPlayerFactorySpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerFactorySpec_(std__shared_ptr_HybridVideoPlayerFactorySpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -100,7 +100,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper) { + Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_bool::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](bool hasAudioFocus) mutable -> void { swiftClosure.call(hasAudioFocus); @@ -108,7 +108,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_BandwidthData create_Func_void_BandwidthData(void* _Nonnull swiftClosureWrapper) { + Func_void_BandwidthData create_Func_void_BandwidthData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_BandwidthData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const BandwidthData& data) mutable -> void { swiftClosure.call(data); @@ -116,7 +116,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_onLoadData create_Func_void_onLoadData(void* _Nonnull swiftClosureWrapper) { + Func_void_onLoadData create_Func_void_onLoadData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onLoadData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onLoadData& data) mutable -> void { swiftClosure.call(data); @@ -124,7 +124,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_onLoadStartData create_Func_void_onLoadStartData(void* _Nonnull swiftClosureWrapper) { + Func_void_onLoadStartData create_Func_void_onLoadStartData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onLoadStartData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onLoadStartData& data) mutable -> void { swiftClosure.call(data); @@ -132,7 +132,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_onPlaybackStateChangeData create_Func_void_onPlaybackStateChangeData(void* _Nonnull swiftClosureWrapper) { + Func_void_onPlaybackStateChangeData create_Func_void_onPlaybackStateChangeData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onPlaybackStateChangeData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onPlaybackStateChangeData& data) mutable -> void { swiftClosure.call(data); @@ -140,7 +140,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_double create_Func_void_double(void* _Nonnull swiftClosureWrapper) { + Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_double::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](double rate) mutable -> void { swiftClosure.call(rate); @@ -148,7 +148,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_onProgressData create_Func_void_onProgressData(void* _Nonnull swiftClosureWrapper) { + Func_void_onProgressData create_Func_void_onProgressData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onProgressData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onProgressData& data) mutable -> void { swiftClosure.call(data); @@ -156,7 +156,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_TimedMetadata create_Func_void_TimedMetadata(void* _Nonnull swiftClosureWrapper) { + Func_void_TimedMetadata create_Func_void_TimedMetadata(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_TimedMetadata::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const TimedMetadata& metadata) mutable -> void { swiftClosure.call(metadata); @@ -164,7 +164,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function& /* texts */)> - Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* _Nonnull swiftClosureWrapper) { + Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__vector_std__string_::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::vector& texts) mutable -> void { swiftClosure.call(texts); @@ -172,7 +172,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function& /* track */)> - Func_void_std__optional_TextTrack_ create_Func_void_std__optional_TextTrack_(void* _Nonnull swiftClosureWrapper) { + Func_void_std__optional_TextTrack_ create_Func_void_std__optional_TextTrack_(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__optional_TextTrack_::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::optional& track) mutable -> void { swiftClosure.call(track); @@ -180,7 +180,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_onVolumeChangeData create_Func_void_onVolumeChangeData(void* _Nonnull swiftClosureWrapper) { + Func_void_onVolumeChangeData create_Func_void_onVolumeChangeData(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_onVolumeChangeData::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const onVolumeChangeData& data) mutable -> void { swiftClosure.call(data); @@ -188,7 +188,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_VideoPlayerStatus create_Func_void_VideoPlayerStatus(void* _Nonnull swiftClosureWrapper) { + Func_void_VideoPlayerStatus create_Func_void_VideoPlayerStatus(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_VideoPlayerStatus::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](VideoPlayerStatus status) mutable -> void { swiftClosure.call(static_cast(status)); @@ -196,7 +196,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper) { + Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__string::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::string& result) mutable -> void { swiftClosure.call(result); @@ -204,7 +204,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function>>>(const OnGetLicensePayload& /* payload */)> - Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(void* _Nonnull swiftClosureWrapper) { + Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const OnGetLicensePayload& payload) mutable -> std::shared_ptr>>> { auto __result = swiftClosure.call(payload); @@ -213,7 +213,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function>& /* result */)> - Func_void_std__shared_ptr_Promise_std__string__ create_Func_void_std__shared_ptr_Promise_std__string__(void* _Nonnull swiftClosureWrapper) { + Func_void_std__shared_ptr_Promise_std__string__ create_Func_void_std__shared_ptr_Promise_std__string__(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_std__shared_ptr_Promise_std__string__::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const std::shared_ptr>& result) mutable -> void { swiftClosure.call(result); @@ -221,7 +221,7 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::function - Func_void_VideoInformation create_Func_void_VideoInformation(void* _Nonnull swiftClosureWrapper) { + Func_void_VideoInformation create_Func_void_VideoInformation(void* NON_NULL swiftClosureWrapper) noexcept { auto swiftClosure = ReactNativeVideo::Func_void_VideoInformation::fromUnsafe(swiftClosureWrapper); return [swiftClosure = std::move(swiftClosure)](const VideoInformation& result) mutable -> void { swiftClosure.call(result); @@ -229,11 +229,11 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoPlayerSourceFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -245,11 +245,11 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerSpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerSpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx swiftPart = ReactNativeVideo::HybridVideoViewViewManagerSpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerSpec_(std__shared_ptr_HybridVideoViewViewManagerSpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridVideoViewViewManagerSpec_(std__shared_ptr_HybridVideoViewViewManagerSpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { @@ -261,11 +261,11 @@ namespace margelo::nitro::video::bridge::swift { } // pragma MARK: std::shared_ptr - std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(void* _Nonnull swiftUnsafePointer) { + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept { ReactNativeVideo::HybridVideoViewViewManagerFactorySpec_cxx swiftPart = ReactNativeVideo::HybridVideoViewViewManagerFactorySpec_cxx::fromUnsafe(swiftUnsafePointer); return std::make_shared(swiftPart); } - void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ cppType) { + void* NON_NULL get_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ cppType) noexcept { std::shared_ptr swiftWrapper = std::dynamic_pointer_cast(cppType); #ifdef NITRO_DEBUG if (swiftWrapper == nullptr) [[unlikely]] { diff --git a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp index 0dc8faaf..a68e82c1 100644 --- a/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/ReactNativeVideo-Swift-Cxx-Bridge.hpp @@ -107,6 +107,7 @@ namespace ReactNativeVideo { class HybridVideoViewViewManagerSpec_cxx; } #include "onPlaybackStateChangeData.hpp" #include "onProgressData.hpp" #include "onVolumeChangeData.hpp" +#include #include #include #include @@ -129,34 +130,34 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridVideoPlayerSourceSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceSpec_(std__shared_ptr_HybridVideoPlayerSourceSpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceSpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSourceSpec_(std__shared_ptr_HybridVideoPlayerSourceSpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridVideoPlayerSourceSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridVideoPlayerSourceSpec_ weakify_std__shared_ptr_HybridVideoPlayerSourceSpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridVideoPlayerSourceSpec_ weakify_std__shared_ptr_HybridVideoPlayerSourceSpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: std::shared_ptr /** * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(std__shared_ptr_HybridVideoPlayerEventEmitterSpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridVideoPlayerEventEmitterSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridVideoPlayerEventEmitterSpec_ weakify_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridVideoPlayerEventEmitterSpec_ weakify_std__shared_ptr_HybridVideoPlayerEventEmitterSpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: std::shared_ptr> /** * Specialized version of `std::shared_ptr>`. */ using std__shared_ptr_Promise_void__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_void__() { + inline std::shared_ptr> create_std__shared_ptr_Promise_void__() noexcept { return Promise::create(); } - inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) { + inline PromiseHolder wrap_std__shared_ptr_Promise_void__(std::shared_ptr> promise) noexcept { return PromiseHolder(std::move(promise)); } @@ -171,14 +172,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_Wrapper final { public: explicit Func_void_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call() const { + inline void call() const noexcept { _function->operator()(); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void create_Func_void(void* _Nonnull swiftClosureWrapper); - inline Func_void_Wrapper wrap_Func_void(Func_void value) { + Func_void create_Func_void(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_Wrapper wrap_Func_void(Func_void value) noexcept { return Func_void_Wrapper(std::move(value)); } @@ -193,14 +194,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_std__exception_ptr_Wrapper final { public: explicit Func_void_std__exception_ptr_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::exception_ptr error) const { + inline void call(std::exception_ptr error) const noexcept { _function->operator()(error); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* _Nonnull swiftClosureWrapper); - inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) { + Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept { return Func_void_std__exception_ptr_Wrapper(std::move(value)); } @@ -209,28 +210,41 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::optional>`. */ using std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__ = std::optional>; - inline std::optional> create_std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) { + inline std::optional> create_std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) noexcept { return std::optional>(value); } + inline bool has_value_std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::optional>& optional) noexcept { + return optional.has_value(); + } + inline std::shared_ptr get_std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::optional>& optional) noexcept { + return *optional; + } // pragma MARK: std::optional /** * Specialized version of `std::optional`. */ using std__optional_std__string_ = std::optional; - inline std::optional create_std__optional_std__string_(const std::string& value) { + inline std::optional create_std__optional_std__string_(const std::string& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_std__string_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline std::string get_std__optional_std__string_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::vector /** * Specialized version of `std::vector`. */ using std__vector_TextTrack_ = std::vector; - inline std::vector create_std__vector_TextTrack_(size_t size) { - std::vector vector; - vector.reserve(size); - return vector; + inline std::vector copy_std__vector_TextTrack_(const TextTrack* CONTIGUOUS_MEMORY NON_NULL data, size_t size) noexcept { + return margelo::nitro::FastVectorCopy(data, size); + } + inline const TextTrack* CONTIGUOUS_MEMORY NON_NULL get_data_std__vector_TextTrack_(const std::vector& vector) noexcept { + return vector.data(); } // pragma MARK: std::optional @@ -238,46 +252,52 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::optional`. */ using std__optional_TextTrack_ = std::optional; - inline std::optional create_std__optional_TextTrack_(const TextTrack& value) { + inline std::optional create_std__optional_TextTrack_(const TextTrack& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_TextTrack_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline TextTrack get_std__optional_TextTrack_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::shared_ptr /** * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridVideoPlayerSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSpec_(std__shared_ptr_HybridVideoPlayerSpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSpec_(std__shared_ptr_HybridVideoPlayerSpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridVideoPlayerSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridVideoPlayerSpec_ weakify_std__shared_ptr_HybridVideoPlayerSpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridVideoPlayerSpec_ weakify_std__shared_ptr_HybridVideoPlayerSpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: Result>> using Result_std__shared_ptr_Promise_void___ = Result>>; - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) { + inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::shared_ptr>& value) noexcept { return Result>>::withValue(value); } - inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) { + inline Result_std__shared_ptr_Promise_void___ create_Result_std__shared_ptr_Promise_void___(const std::exception_ptr& error) noexcept { return Result>>::withError(error); } // pragma MARK: Result> using Result_std__vector_TextTrack__ = Result>; - inline Result_std__vector_TextTrack__ create_Result_std__vector_TextTrack__(const std::vector& value) { + inline Result_std__vector_TextTrack__ create_Result_std__vector_TextTrack__(const std::vector& value) noexcept { return Result>::withValue(value); } - inline Result_std__vector_TextTrack__ create_Result_std__vector_TextTrack__(const std::exception_ptr& error) { + inline Result_std__vector_TextTrack__ create_Result_std__vector_TextTrack__(const std::exception_ptr& error) noexcept { return Result>::withError(error); } // pragma MARK: Result using Result_void_ = Result; - inline Result_void_ create_Result_void_() { + inline Result_void_ create_Result_void_() noexcept { return Result::withValue(); } - inline Result_void_ create_Result_void_(const std::exception_ptr& error) { + inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept { return Result::withError(error); } @@ -286,19 +306,19 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridVideoPlayerFactorySpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerFactorySpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerFactorySpec_(std__shared_ptr_HybridVideoPlayerFactorySpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerFactorySpec_(std__shared_ptr_HybridVideoPlayerFactorySpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridVideoPlayerFactorySpec_ = std::weak_ptr; - inline std__weak_ptr_HybridVideoPlayerFactorySpec_ weakify_std__shared_ptr_HybridVideoPlayerFactorySpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridVideoPlayerFactorySpec_ weakify_std__shared_ptr_HybridVideoPlayerFactorySpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: Result> using Result_std__shared_ptr_HybridVideoPlayerSpec__ = Result>; - inline Result_std__shared_ptr_HybridVideoPlayerSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSpec__(const std::shared_ptr& value) { + inline Result_std__shared_ptr_HybridVideoPlayerSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSpec__(const std::shared_ptr& value) noexcept { return Result>::withValue(value); } - inline Result_std__shared_ptr_HybridVideoPlayerSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSpec__(const std::exception_ptr& error) { + inline Result_std__shared_ptr_HybridVideoPlayerSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSpec__(const std::exception_ptr& error) noexcept { return Result>::withError(error); } @@ -313,14 +333,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_bool_Wrapper final { public: explicit Func_void_bool_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(bool hasAudioFocus) const { + inline void call(bool hasAudioFocus) const noexcept { _function->operator()(hasAudioFocus); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_bool create_Func_void_bool(void* _Nonnull swiftClosureWrapper); - inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) { + Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept { return Func_void_bool_Wrapper(std::move(value)); } @@ -329,9 +349,15 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::optional`. */ using std__optional_double_ = std::optional; - inline std::optional create_std__optional_double_(const double& value) { + inline std::optional create_std__optional_double_(const double& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_double_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline double get_std__optional_double_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::function /** @@ -344,14 +370,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_BandwidthData_Wrapper final { public: explicit Func_void_BandwidthData_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(BandwidthData data) const { + inline void call(BandwidthData data) const noexcept { _function->operator()(data); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_BandwidthData create_Func_void_BandwidthData(void* _Nonnull swiftClosureWrapper); - inline Func_void_BandwidthData_Wrapper wrap_Func_void_BandwidthData(Func_void_BandwidthData value) { + Func_void_BandwidthData create_Func_void_BandwidthData(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_BandwidthData_Wrapper wrap_Func_void_BandwidthData(Func_void_BandwidthData value) noexcept { return Func_void_BandwidthData_Wrapper(std::move(value)); } @@ -366,14 +392,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_onLoadData_Wrapper final { public: explicit Func_void_onLoadData_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(onLoadData data) const { + inline void call(onLoadData data) const noexcept { _function->operator()(data); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_onLoadData create_Func_void_onLoadData(void* _Nonnull swiftClosureWrapper); - inline Func_void_onLoadData_Wrapper wrap_Func_void_onLoadData(Func_void_onLoadData value) { + Func_void_onLoadData create_Func_void_onLoadData(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_onLoadData_Wrapper wrap_Func_void_onLoadData(Func_void_onLoadData value) noexcept { return Func_void_onLoadData_Wrapper(std::move(value)); } @@ -388,14 +414,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_onLoadStartData_Wrapper final { public: explicit Func_void_onLoadStartData_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(onLoadStartData data) const { + inline void call(onLoadStartData data) const noexcept { _function->operator()(data); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_onLoadStartData create_Func_void_onLoadStartData(void* _Nonnull swiftClosureWrapper); - inline Func_void_onLoadStartData_Wrapper wrap_Func_void_onLoadStartData(Func_void_onLoadStartData value) { + Func_void_onLoadStartData create_Func_void_onLoadStartData(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_onLoadStartData_Wrapper wrap_Func_void_onLoadStartData(Func_void_onLoadStartData value) noexcept { return Func_void_onLoadStartData_Wrapper(std::move(value)); } @@ -410,14 +436,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_onPlaybackStateChangeData_Wrapper final { public: explicit Func_void_onPlaybackStateChangeData_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(onPlaybackStateChangeData data) const { + inline void call(onPlaybackStateChangeData data) const noexcept { _function->operator()(data); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_onPlaybackStateChangeData create_Func_void_onPlaybackStateChangeData(void* _Nonnull swiftClosureWrapper); - inline Func_void_onPlaybackStateChangeData_Wrapper wrap_Func_void_onPlaybackStateChangeData(Func_void_onPlaybackStateChangeData value) { + Func_void_onPlaybackStateChangeData create_Func_void_onPlaybackStateChangeData(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_onPlaybackStateChangeData_Wrapper wrap_Func_void_onPlaybackStateChangeData(Func_void_onPlaybackStateChangeData value) noexcept { return Func_void_onPlaybackStateChangeData_Wrapper(std::move(value)); } @@ -432,14 +458,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_double_Wrapper final { public: explicit Func_void_double_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(double rate) const { + inline void call(double rate) const noexcept { _function->operator()(rate); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_double create_Func_void_double(void* _Nonnull swiftClosureWrapper); - inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) { + Func_void_double create_Func_void_double(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_double_Wrapper wrap_Func_void_double(Func_void_double value) noexcept { return Func_void_double_Wrapper(std::move(value)); } @@ -454,14 +480,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_onProgressData_Wrapper final { public: explicit Func_void_onProgressData_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(onProgressData data) const { + inline void call(onProgressData data) const noexcept { _function->operator()(data); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_onProgressData create_Func_void_onProgressData(void* _Nonnull swiftClosureWrapper); - inline Func_void_onProgressData_Wrapper wrap_Func_void_onProgressData(Func_void_onProgressData value) { + Func_void_onProgressData create_Func_void_onProgressData(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_onProgressData_Wrapper wrap_Func_void_onProgressData(Func_void_onProgressData value) noexcept { return Func_void_onProgressData_Wrapper(std::move(value)); } @@ -470,10 +496,11 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::vector`. */ using std__vector_TimedMetadataObject_ = std::vector; - inline std::vector create_std__vector_TimedMetadataObject_(size_t size) { - std::vector vector; - vector.reserve(size); - return vector; + inline std::vector copy_std__vector_TimedMetadataObject_(const TimedMetadataObject* CONTIGUOUS_MEMORY NON_NULL data, size_t size) noexcept { + return margelo::nitro::FastVectorCopy(data, size); + } + inline const TimedMetadataObject* CONTIGUOUS_MEMORY NON_NULL get_data_std__vector_TimedMetadataObject_(const std::vector& vector) noexcept { + return vector.data(); } // pragma MARK: std::function @@ -487,14 +514,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_TimedMetadata_Wrapper final { public: explicit Func_void_TimedMetadata_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(TimedMetadata metadata) const { + inline void call(TimedMetadata metadata) const noexcept { _function->operator()(metadata); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_TimedMetadata create_Func_void_TimedMetadata(void* _Nonnull swiftClosureWrapper); - inline Func_void_TimedMetadata_Wrapper wrap_Func_void_TimedMetadata(Func_void_TimedMetadata value) { + Func_void_TimedMetadata create_Func_void_TimedMetadata(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_TimedMetadata_Wrapper wrap_Func_void_TimedMetadata(Func_void_TimedMetadata value) noexcept { return Func_void_TimedMetadata_Wrapper(std::move(value)); } @@ -503,7 +530,7 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::vector`. */ using std__vector_std__string_ = std::vector; - inline std::vector create_std__vector_std__string_(size_t size) { + inline std::vector create_std__vector_std__string_(size_t size) noexcept { std::vector vector; vector.reserve(size); return vector; @@ -520,14 +547,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_std__vector_std__string__Wrapper final { public: explicit Func_void_std__vector_std__string__Wrapper(std::function& /* texts */)>&& func): _function(std::make_unique& /* texts */)>>(std::move(func))) {} - inline void call(std::vector texts) const { + inline void call(std::vector texts) const noexcept { _function->operator()(texts); } private: std::unique_ptr& /* texts */)>> _function; } SWIFT_NONCOPYABLE; - Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* _Nonnull swiftClosureWrapper); - inline Func_void_std__vector_std__string__Wrapper wrap_Func_void_std__vector_std__string_(Func_void_std__vector_std__string_ value) { + Func_void_std__vector_std__string_ create_Func_void_std__vector_std__string_(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_std__vector_std__string__Wrapper wrap_Func_void_std__vector_std__string_(Func_void_std__vector_std__string_ value) noexcept { return Func_void_std__vector_std__string__Wrapper(std::move(value)); } @@ -542,14 +569,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_std__optional_TextTrack__Wrapper final { public: explicit Func_void_std__optional_TextTrack__Wrapper(std::function& /* track */)>&& func): _function(std::make_unique& /* track */)>>(std::move(func))) {} - inline void call(std::optional track) const { + inline void call(std::optional track) const noexcept { _function->operator()(track); } private: std::unique_ptr& /* track */)>> _function; } SWIFT_NONCOPYABLE; - Func_void_std__optional_TextTrack_ create_Func_void_std__optional_TextTrack_(void* _Nonnull swiftClosureWrapper); - inline Func_void_std__optional_TextTrack__Wrapper wrap_Func_void_std__optional_TextTrack_(Func_void_std__optional_TextTrack_ value) { + Func_void_std__optional_TextTrack_ create_Func_void_std__optional_TextTrack_(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_std__optional_TextTrack__Wrapper wrap_Func_void_std__optional_TextTrack_(Func_void_std__optional_TextTrack_ value) noexcept { return Func_void_std__optional_TextTrack__Wrapper(std::move(value)); } @@ -564,14 +591,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_onVolumeChangeData_Wrapper final { public: explicit Func_void_onVolumeChangeData_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(onVolumeChangeData data) const { + inline void call(onVolumeChangeData data) const noexcept { _function->operator()(data); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_onVolumeChangeData create_Func_void_onVolumeChangeData(void* _Nonnull swiftClosureWrapper); - inline Func_void_onVolumeChangeData_Wrapper wrap_Func_void_onVolumeChangeData(Func_void_onVolumeChangeData value) { + Func_void_onVolumeChangeData create_Func_void_onVolumeChangeData(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_onVolumeChangeData_Wrapper wrap_Func_void_onVolumeChangeData(Func_void_onVolumeChangeData value) noexcept { return Func_void_onVolumeChangeData_Wrapper(std::move(value)); } @@ -586,14 +613,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_VideoPlayerStatus_Wrapper final { public: explicit Func_void_VideoPlayerStatus_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(int status) const { + inline void call(int status) const noexcept { _function->operator()(static_cast(status)); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_VideoPlayerStatus create_Func_void_VideoPlayerStatus(void* _Nonnull swiftClosureWrapper); - inline Func_void_VideoPlayerStatus_Wrapper wrap_Func_void_VideoPlayerStatus(Func_void_VideoPlayerStatus value) { + Func_void_VideoPlayerStatus create_Func_void_VideoPlayerStatus(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_VideoPlayerStatus_Wrapper wrap_Func_void_VideoPlayerStatus(Func_void_VideoPlayerStatus value) noexcept { return Func_void_VideoPlayerStatus_Wrapper(std::move(value)); } @@ -602,10 +629,11 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::vector`. */ using std__vector_NativeExternalSubtitle_ = std::vector; - inline std::vector create_std__vector_NativeExternalSubtitle_(size_t size) { - std::vector vector; - vector.reserve(size); - return vector; + inline std::vector copy_std__vector_NativeExternalSubtitle_(const NativeExternalSubtitle* CONTIGUOUS_MEMORY NON_NULL data, size_t size) noexcept { + return margelo::nitro::FastVectorCopy(data, size); + } + inline const NativeExternalSubtitle* CONTIGUOUS_MEMORY NON_NULL get_data_std__vector_NativeExternalSubtitle_(const std::vector& vector) noexcept { + return vector.data(); } // pragma MARK: std::optional> @@ -613,21 +641,27 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::optional>`. */ using std__optional_std__vector_NativeExternalSubtitle__ = std::optional>; - inline std::optional> create_std__optional_std__vector_NativeExternalSubtitle__(const std::vector& value) { + inline std::optional> create_std__optional_std__vector_NativeExternalSubtitle__(const std::vector& value) noexcept { return std::optional>(value); } + inline bool has_value_std__optional_std__vector_NativeExternalSubtitle__(const std::optional>& optional) noexcept { + return optional.has_value(); + } + inline std::vector get_std__optional_std__vector_NativeExternalSubtitle__(const std::optional>& optional) noexcept { + return *optional; + } // pragma MARK: std::unordered_map /** * Specialized version of `std::unordered_map`. */ using std__unordered_map_std__string__std__string_ = std::unordered_map; - inline std::unordered_map create_std__unordered_map_std__string__std__string_(size_t size) { + inline std::unordered_map create_std__unordered_map_std__string__std__string_(size_t size) noexcept { std::unordered_map map; map.reserve(size); return map; } - inline std::vector get_std__unordered_map_std__string__std__string__keys(const std__unordered_map_std__string__std__string_& map) { + inline std::vector get_std__unordered_map_std__string__std__string__keys(const std__unordered_map_std__string__std__string_& map) noexcept { std::vector keys; keys.reserve(map.size()); for (const auto& entry : map) { @@ -635,10 +669,10 @@ namespace margelo::nitro::video::bridge::swift { } return keys; } - inline std::string get_std__unordered_map_std__string__std__string__value(const std__unordered_map_std__string__std__string_& map, const std::string& key) { - return map.at(key); + inline std::string get_std__unordered_map_std__string__std__string__value(const std__unordered_map_std__string__std__string_& map, const std::string& key) noexcept { + return map.find(key)->second; } - inline void emplace_std__unordered_map_std__string__std__string_(std__unordered_map_std__string__std__string_& map, const std::string& key, const std::string& value) { + inline void emplace_std__unordered_map_std__string__std__string_(std__unordered_map_std__string__std__string_& map, const std::string& key, const std::string& value) noexcept { map.emplace(key, value); } @@ -647,28 +681,40 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::optional>`. */ using std__optional_std__unordered_map_std__string__std__string__ = std::optional>; - inline std::optional> create_std__optional_std__unordered_map_std__string__std__string__(const std::unordered_map& value) { + inline std::optional> create_std__optional_std__unordered_map_std__string__std__string__(const std::unordered_map& value) noexcept { return std::optional>(value); } + inline bool has_value_std__optional_std__unordered_map_std__string__std__string__(const std::optional>& optional) noexcept { + return optional.has_value(); + } + inline std::unordered_map get_std__optional_std__unordered_map_std__string__std__string__(const std::optional>& optional) noexcept { + return *optional; + } // pragma MARK: std::optional /** * Specialized version of `std::optional`. */ using std__optional_bool_ = std::optional; - inline std::optional create_std__optional_bool_(const bool& value) { + inline std::optional create_std__optional_bool_(const bool& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_bool_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline bool get_std__optional_bool_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::shared_ptr> /** * Specialized version of `std::shared_ptr>`. */ using std__shared_ptr_Promise_std__string__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_std__string__() { + inline std::shared_ptr> create_std__shared_ptr_Promise_std__string__() noexcept { return Promise::create(); } - inline PromiseHolder wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr> promise) { + inline PromiseHolder wrap_std__shared_ptr_Promise_std__string__(std::shared_ptr> promise) noexcept { return PromiseHolder(std::move(promise)); } @@ -683,14 +729,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_std__string_Wrapper final { public: explicit Func_void_std__string_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(std::string result) const { + inline void call(std::string result) const noexcept { _function->operator()(result); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_std__string create_Func_void_std__string(void* _Nonnull swiftClosureWrapper); - inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) { + Func_void_std__string create_Func_void_std__string(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_std__string_Wrapper wrap_Func_void_std__string(Func_void_std__string value) noexcept { return Func_void_std__string_Wrapper(std::move(value)); } @@ -705,15 +751,15 @@ namespace margelo::nitro::video::bridge::swift { class Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper final { public: explicit Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper(std::function>>>(const OnGetLicensePayload& /* payload */)>&& func): _function(std::make_unique>>>(const OnGetLicensePayload& /* payload */)>>(std::move(func))) {} - inline std::shared_ptr>>> call(OnGetLicensePayload payload) const { + inline std::shared_ptr>>> call(OnGetLicensePayload payload) const noexcept { auto __result = _function->operator()(payload); return __result; } private: std::unique_ptr>>>(const OnGetLicensePayload& /* payload */)>> _function; } SWIFT_NONCOPYABLE; - Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(void* _Nonnull swiftClosureWrapper); - inline Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper wrap_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload value) { + Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload create_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper wrap_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload value) noexcept { return Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload_Wrapper(std::move(value)); } @@ -722,10 +768,10 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::shared_ptr>>>`. */ using std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____ = std::shared_ptr>>>; - inline std::shared_ptr>>> create_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____() { + inline std::shared_ptr>>> create_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____() noexcept { return Promise>>::create(); } - inline PromiseHolder>> wrap_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____(std::shared_ptr>>> promise) { + inline PromiseHolder>> wrap_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string____(std::shared_ptr>>> promise) noexcept { return PromiseHolder>>(std::move(promise)); } @@ -740,14 +786,14 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_std__shared_ptr_Promise_std__string___Wrapper final { public: explicit Func_void_std__shared_ptr_Promise_std__string___Wrapper(std::function>& /* result */)>&& func): _function(std::make_unique>& /* result */)>>(std::move(func))) {} - inline void call(std::shared_ptr> result) const { + inline void call(std::shared_ptr> result) const noexcept { _function->operator()(result); } private: std::unique_ptr>& /* result */)>> _function; } SWIFT_NONCOPYABLE; - Func_void_std__shared_ptr_Promise_std__string__ create_Func_void_std__shared_ptr_Promise_std__string__(void* _Nonnull swiftClosureWrapper); - inline Func_void_std__shared_ptr_Promise_std__string___Wrapper wrap_Func_void_std__shared_ptr_Promise_std__string__(Func_void_std__shared_ptr_Promise_std__string__ value) { + Func_void_std__shared_ptr_Promise_std__string__ create_Func_void_std__shared_ptr_Promise_std__string__(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_std__shared_ptr_Promise_std__string___Wrapper wrap_Func_void_std__shared_ptr_Promise_std__string__(Func_void_std__shared_ptr_Promise_std__string__ value) noexcept { return Func_void_std__shared_ptr_Promise_std__string___Wrapper(std::move(value)); } @@ -756,55 +802,85 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::optional>>>(const OnGetLicensePayload& / * payload * /)>>`. */ using std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______ = std::optional>>>(const OnGetLicensePayload& /* payload */)>>; - inline std::optional>>>(const OnGetLicensePayload& /* payload */)>> create_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______(const std::function>>>(const OnGetLicensePayload& /* payload */)>& value) { + inline std::optional>>>(const OnGetLicensePayload& /* payload */)>> create_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______(const std::function>>>(const OnGetLicensePayload& /* payload */)>& value) noexcept { return std::optional>>>(const OnGetLicensePayload& /* payload */)>>(value); } + inline bool has_value_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______(const std::optional>>>(const OnGetLicensePayload& /* payload */)>>& optional) noexcept { + return optional.has_value(); + } + inline std::function>>>(const OnGetLicensePayload& /* payload */)> get_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______(const std::optional>>>(const OnGetLicensePayload& /* payload */)>>& optional) noexcept { + return *optional; + } // pragma MARK: std::optional /** * Specialized version of `std::optional`. */ using std__optional_NativeDrmParams_ = std::optional; - inline std::optional create_std__optional_NativeDrmParams_(const NativeDrmParams& value) { + inline std::optional create_std__optional_NativeDrmParams_(const NativeDrmParams& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_NativeDrmParams_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline NativeDrmParams get_std__optional_NativeDrmParams_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::optional /** * Specialized version of `std::optional`. */ using std__optional_LivePlaybackParams_ = std::optional; - inline std::optional create_std__optional_LivePlaybackParams_(const LivePlaybackParams& value) { + inline std::optional create_std__optional_LivePlaybackParams_(const LivePlaybackParams& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_LivePlaybackParams_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline LivePlaybackParams get_std__optional_LivePlaybackParams_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::optional /** * Specialized version of `std::optional`. */ using std__optional_Resolution_ = std::optional; - inline std::optional create_std__optional_Resolution_(const Resolution& value) { + inline std::optional create_std__optional_Resolution_(const Resolution& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_Resolution_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline Resolution get_std__optional_Resolution_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::optional /** * Specialized version of `std::optional`. */ using std__optional_BufferConfig_ = std::optional; - inline std::optional create_std__optional_BufferConfig_(const BufferConfig& value) { + inline std::optional create_std__optional_BufferConfig_(const BufferConfig& value) noexcept { return std::optional(value); } + inline bool has_value_std__optional_BufferConfig_(const std::optional& optional) noexcept { + return optional.has_value(); + } + inline BufferConfig get_std__optional_BufferConfig_(const std::optional& optional) noexcept { + return *optional; + } // pragma MARK: std::shared_ptr> /** * Specialized version of `std::shared_ptr>`. */ using std__shared_ptr_Promise_VideoInformation__ = std::shared_ptr>; - inline std::shared_ptr> create_std__shared_ptr_Promise_VideoInformation__() { + inline std::shared_ptr> create_std__shared_ptr_Promise_VideoInformation__() noexcept { return Promise::create(); } - inline PromiseHolder wrap_std__shared_ptr_Promise_VideoInformation__(std::shared_ptr> promise) { + inline PromiseHolder wrap_std__shared_ptr_Promise_VideoInformation__(std::shared_ptr> promise) noexcept { return PromiseHolder(std::move(promise)); } @@ -819,23 +895,23 @@ namespace margelo::nitro::video::bridge::swift { class Func_void_VideoInformation_Wrapper final { public: explicit Func_void_VideoInformation_Wrapper(std::function&& func): _function(std::make_unique>(std::move(func))) {} - inline void call(VideoInformation result) const { + inline void call(VideoInformation result) const noexcept { _function->operator()(result); } private: std::unique_ptr> _function; } SWIFT_NONCOPYABLE; - Func_void_VideoInformation create_Func_void_VideoInformation(void* _Nonnull swiftClosureWrapper); - inline Func_void_VideoInformation_Wrapper wrap_Func_void_VideoInformation(Func_void_VideoInformation value) { + Func_void_VideoInformation create_Func_void_VideoInformation(void* NON_NULL swiftClosureWrapper) noexcept; + inline Func_void_VideoInformation_Wrapper wrap_Func_void_VideoInformation(Func_void_VideoInformation value) noexcept { return Func_void_VideoInformation_Wrapper(std::move(value)); } // pragma MARK: Result>> using Result_std__shared_ptr_Promise_VideoInformation___ = Result>>; - inline Result_std__shared_ptr_Promise_VideoInformation___ create_Result_std__shared_ptr_Promise_VideoInformation___(const std::shared_ptr>& value) { + inline Result_std__shared_ptr_Promise_VideoInformation___ create_Result_std__shared_ptr_Promise_VideoInformation___(const std::shared_ptr>& value) noexcept { return Result>>::withValue(value); } - inline Result_std__shared_ptr_Promise_VideoInformation___ create_Result_std__shared_ptr_Promise_VideoInformation___(const std::exception_ptr& error) { + inline Result_std__shared_ptr_Promise_VideoInformation___ create_Result_std__shared_ptr_Promise_VideoInformation___(const std::exception_ptr& error) noexcept { return Result>>::withError(error); } @@ -844,19 +920,19 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(std__shared_ptr_HybridVideoPlayerSourceFactorySpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridVideoPlayerSourceFactorySpec_ = std::weak_ptr; - inline std__weak_ptr_HybridVideoPlayerSourceFactorySpec_ weakify_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridVideoPlayerSourceFactorySpec_ weakify_std__shared_ptr_HybridVideoPlayerSourceFactorySpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: Result> using Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ = Result>; - inline Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) { + inline Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::shared_ptr& value) noexcept { return Result>::withValue(value); } - inline Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::exception_ptr& error) { + inline Result_std__shared_ptr_HybridVideoPlayerSourceSpec__ create_Result_std__shared_ptr_HybridVideoPlayerSourceSpec__(const std::exception_ptr& error) noexcept { return Result>::withError(error); } @@ -865,55 +941,79 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::optional>`. */ using std__optional_std__shared_ptr_HybridVideoPlayerSpec__ = std::optional>; - inline std::optional> create_std__optional_std__shared_ptr_HybridVideoPlayerSpec__(const std::shared_ptr& value) { + inline std::optional> create_std__optional_std__shared_ptr_HybridVideoPlayerSpec__(const std::shared_ptr& value) noexcept { return std::optional>(value); } + inline bool has_value_std__optional_std__shared_ptr_HybridVideoPlayerSpec__(const std::optional>& optional) noexcept { + return optional.has_value(); + } + inline std::shared_ptr get_std__optional_std__shared_ptr_HybridVideoPlayerSpec__(const std::optional>& optional) noexcept { + return *optional; + } // pragma MARK: std::optional> /** * Specialized version of `std::optional>`. */ using std__optional_std__function_void_bool____isInPictureInPicture______ = std::optional>; - inline std::optional> create_std__optional_std__function_void_bool____isInPictureInPicture______(const std::function& value) { + inline std::optional> create_std__optional_std__function_void_bool____isInPictureInPicture______(const std::function& value) noexcept { return std::optional>(value); } + inline bool has_value_std__optional_std__function_void_bool____isInPictureInPicture______(const std::optional>& optional) noexcept { + return optional.has_value(); + } + inline std::function get_std__optional_std__function_void_bool____isInPictureInPicture______(const std::optional>& optional) noexcept { + return *optional; + } // pragma MARK: std::optional> /** * Specialized version of `std::optional>`. */ using std__optional_std__function_void_bool____fullscreen______ = std::optional>; - inline std::optional> create_std__optional_std__function_void_bool____fullscreen______(const std::function& value) { + inline std::optional> create_std__optional_std__function_void_bool____fullscreen______(const std::function& value) noexcept { return std::optional>(value); } + inline bool has_value_std__optional_std__function_void_bool____fullscreen______(const std::optional>& optional) noexcept { + return optional.has_value(); + } + inline std::function get_std__optional_std__function_void_bool____fullscreen______(const std::optional>& optional) noexcept { + return *optional; + } // pragma MARK: std::optional> /** * Specialized version of `std::optional>`. */ using std__optional_std__function_void____ = std::optional>; - inline std::optional> create_std__optional_std__function_void____(const std::function& value) { + inline std::optional> create_std__optional_std__function_void____(const std::function& value) noexcept { return std::optional>(value); } + inline bool has_value_std__optional_std__function_void____(const std::optional>& optional) noexcept { + return optional.has_value(); + } + inline std::function get_std__optional_std__function_void____(const std::optional>& optional) noexcept { + return *optional; + } // pragma MARK: std::shared_ptr /** * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridVideoViewViewManagerSpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerSpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerSpec_(std__shared_ptr_HybridVideoViewViewManagerSpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerSpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridVideoViewViewManagerSpec_(std__shared_ptr_HybridVideoViewViewManagerSpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridVideoViewViewManagerSpec_ = std::weak_ptr; - inline std__weak_ptr_HybridVideoViewViewManagerSpec_ weakify_std__shared_ptr_HybridVideoViewViewManagerSpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridVideoViewViewManagerSpec_ weakify_std__shared_ptr_HybridVideoViewViewManagerSpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: Result using Result_bool_ = Result; - inline Result_bool_ create_Result_bool_(bool value) { + inline Result_bool_ create_Result_bool_(bool value) noexcept { return Result::withValue(std::move(value)); } - inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) { + inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept { return Result::withError(error); } @@ -922,19 +1022,19 @@ namespace margelo::nitro::video::bridge::swift { * Specialized version of `std::shared_ptr`. */ using std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ = std::shared_ptr; - std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(void* _Nonnull swiftUnsafePointer); - void* _Nonnull get_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ cppType); + std::shared_ptr create_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(void* NON_NULL swiftUnsafePointer) noexcept; + void* NON_NULL get_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(std__shared_ptr_HybridVideoViewViewManagerFactorySpec_ cppType) noexcept; // pragma MARK: std::weak_ptr using std__weak_ptr_HybridVideoViewViewManagerFactorySpec_ = std::weak_ptr; - inline std__weak_ptr_HybridVideoViewViewManagerFactorySpec_ weakify_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(const std::shared_ptr& strong) { return strong; } + inline std__weak_ptr_HybridVideoViewViewManagerFactorySpec_ weakify_std__shared_ptr_HybridVideoViewViewManagerFactorySpec_(const std::shared_ptr& strong) noexcept { return strong; } // pragma MARK: Result> using Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ = Result>; - inline Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(const std::shared_ptr& value) { + inline Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(const std::shared_ptr& value) noexcept { return Result>::withValue(value); } - inline Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(const std::exception_ptr& error) { + inline Result_std__shared_ptr_HybridVideoViewViewManagerSpec__ create_Result_std__shared_ptr_HybridVideoViewViewManagerSpec__(const std::exception_ptr& error) noexcept { return Result>::withError(error); } diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp index daeda49c..c32eac83 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceFactorySpecSwift.hpp @@ -98,7 +98,7 @@ namespace margelo::nitro::video { return __value; } inline std::shared_ptr fromVideoConfig(const NativeVideoConfig& config) override { - auto __result = _swiftPart.fromVideoConfig(config); + auto __result = _swiftPart.fromVideoConfig(std::forward(config)); if (__result.hasError()) [[unlikely]] { std::rethrow_exception(__result.error()); } diff --git a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp index a5b77272..ec3bbf3c 100644 --- a/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp +++ b/packages/react-native-video/nitrogen/generated/ios/c++/HybridVideoPlayerSourceSpecSwift.hpp @@ -92,8 +92,7 @@ namespace margelo::nitro::video { return __result; } inline NativeVideoConfig getConfig() noexcept override { - auto __result = _swiftPart.getConfig(); - return __result; + return _swiftPart.getConfig(); } public: diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/BufferConfig.swift b/packages/react-native-video/nitrogen/generated/ios/swift/BufferConfig.swift index 348ad224..1c4dbaf6 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/BufferConfig.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/BufferConfig.swift @@ -91,13 +91,7 @@ public extension BufferConfig { var livePlayback: LivePlaybackParams? { @inline(__always) get { - return { () -> LivePlaybackParams? in - if let __unwrapped = self.__livePlayback.value { - return __unwrapped - } else { - return nil - } - }() + return self.__livePlayback.value } @inline(__always) set { @@ -233,13 +227,7 @@ public extension BufferConfig { var preferredMaximumResolution: Resolution? { @inline(__always) get { - return { () -> Resolution? in - if let __unwrapped = self.__preferredMaximumResolution.value { - return __unwrapped - } else { - return nil - } - }() + return self.__preferredMaximumResolution.value } @inline(__always) set { @@ -273,13 +261,7 @@ public extension BufferConfig { var preferredMaximumResolutionForExpensiveNetworks: Resolution? { @inline(__always) get { - return { () -> Resolution? in - if let __unwrapped = self.__preferredMaximumResolutionForExpensiveNetworks.value { - return __unwrapped - } else { - return nil - } - }() + return self.__preferredMaximumResolutionForExpensiveNetworks.value } @inline(__always) set { diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__optional_TextTrack_.swift b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__optional_TextTrack_.swift index 10883953..23208f7d 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__optional_TextTrack_.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/Func_void_std__optional_TextTrack_.swift @@ -23,13 +23,7 @@ public final class Func_void_std__optional_TextTrack_ { @inline(__always) public func call(track: bridge.std__optional_TextTrack_) -> Void { - self.closure({ () -> TextTrack? in - if let __unwrapped = track.value { - return __unwrapped - } else { - return nil - } - }()) + self.closure(track.value) } /** diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift index 5d1f9741..cf401a48 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoPlayerSpec_cxx.swift @@ -264,7 +264,8 @@ open class HybridVideoPlayerSpec_cxx { public final func replaceSourceAsync(source: bridge.std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__) -> bridge.Result_std__shared_ptr_Promise_void___ { do { let __result = try self.__implementation.replaceSourceAsync(source: { () -> (any HybridVideoPlayerSourceSpec)? in - if let __unwrapped = source.value { + if bridge.has_value_std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__(source) { + let __unwrapped = bridge.get_std__optional_std__shared_ptr_HybridVideoPlayerSourceSpec__(source) return { () -> HybridVideoPlayerSourceSpec in let __unsafePointer = bridge.get_std__shared_ptr_HybridVideoPlayerSourceSpec_(__unwrapped) let __instance = HybridVideoPlayerSourceSpec_cxx.fromUnsafe(__unsafePointer) @@ -293,13 +294,9 @@ open class HybridVideoPlayerSpec_cxx { public final func getAvailableTextTracks() -> bridge.Result_std__vector_TextTrack__ { do { let __result = try self.__implementation.getAvailableTextTracks() - let __resultCpp = { () -> bridge.std__vector_TextTrack_ in - var __vector = bridge.create_std__vector_TextTrack_(__result.count) - for __item in __result { - __vector.push_back(__item) - } - return __vector - }() + let __resultCpp = __result.withUnsafeBufferPointer { __pointer -> bridge.std__vector_TextTrack_ in + return bridge.copy_std__vector_TextTrack_(__pointer.baseAddress!, __result.count) + } return bridge.create_Result_std__vector_TextTrack__(__resultCpp) } catch (let __error) { let __exceptionPtr = __error.toCpp() @@ -310,13 +307,7 @@ open class HybridVideoPlayerSpec_cxx { @inline(__always) public final func selectTextTrack(textTrack: bridge.std__optional_TextTrack_) -> bridge.Result_void_ { do { - try self.__implementation.selectTextTrack(textTrack: { () -> TextTrack? in - if let __unwrapped = textTrack.value { - return __unwrapped - } else { - return nil - } - }()) + try self.__implementation.selectTextTrack(textTrack: textTrack.value) return bridge.create_Result_void_() } catch (let __error) { let __exceptionPtr = __error.toCpp() diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift index f8e05ba6..b6ef9f04 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/HybridVideoViewViewManagerSpec_cxx.swift @@ -123,7 +123,8 @@ open class HybridVideoViewViewManagerSpec_cxx { @inline(__always) set { self.__implementation.player = { () -> (any HybridVideoPlayerSpec)? in - if let __unwrapped = newValue.value { + if bridge.has_value_std__optional_std__shared_ptr_HybridVideoPlayerSpec__(newValue) { + let __unwrapped = bridge.get_std__optional_std__shared_ptr_HybridVideoPlayerSpec__(newValue) return { () -> HybridVideoPlayerSpec in let __unsafePointer = bridge.get_std__shared_ptr_HybridVideoPlayerSpec_(__unwrapped) let __instance = HybridVideoPlayerSpec_cxx.fromUnsafe(__unsafePointer) @@ -219,7 +220,8 @@ open class HybridVideoViewViewManagerSpec_cxx { @inline(__always) set { self.__implementation.onPictureInPictureChange = { () -> ((_ isInPictureInPicture: Bool) -> Void)? in - if let __unwrapped = newValue.value { + if bridge.has_value_std__optional_std__function_void_bool____isInPictureInPicture______(newValue) { + let __unwrapped = bridge.get_std__optional_std__function_void_bool____isInPictureInPicture______(newValue) return { () -> (Bool) -> Void in let __wrappedFunction = bridge.wrap_Func_void_bool(__unwrapped) return { (__isInPictureInPicture: Bool) -> Void in @@ -250,7 +252,8 @@ open class HybridVideoViewViewManagerSpec_cxx { @inline(__always) set { self.__implementation.onFullscreenChange = { () -> ((_ fullscreen: Bool) -> Void)? in - if let __unwrapped = newValue.value { + if bridge.has_value_std__optional_std__function_void_bool____fullscreen______(newValue) { + let __unwrapped = bridge.get_std__optional_std__function_void_bool____fullscreen______(newValue) return { () -> (Bool) -> Void in let __wrappedFunction = bridge.wrap_Func_void_bool(__unwrapped) return { (__fullscreen: Bool) -> Void in @@ -281,7 +284,8 @@ open class HybridVideoViewViewManagerSpec_cxx { @inline(__always) set { self.__implementation.willEnterFullscreen = { () -> (() -> Void)? in - if let __unwrapped = newValue.value { + if bridge.has_value_std__optional_std__function_void____(newValue) { + let __unwrapped = bridge.get_std__optional_std__function_void____(newValue) return { () -> () -> Void in let __wrappedFunction = bridge.wrap_Func_void(__unwrapped) return { () -> Void in @@ -312,7 +316,8 @@ open class HybridVideoViewViewManagerSpec_cxx { @inline(__always) set { self.__implementation.willExitFullscreen = { () -> (() -> Void)? in - if let __unwrapped = newValue.value { + if bridge.has_value_std__optional_std__function_void____(newValue) { + let __unwrapped = bridge.get_std__optional_std__function_void____(newValue) return { () -> () -> Void in let __wrappedFunction = bridge.wrap_Func_void(__unwrapped) return { () -> Void in @@ -343,7 +348,8 @@ open class HybridVideoViewViewManagerSpec_cxx { @inline(__always) set { self.__implementation.willEnterPictureInPicture = { () -> (() -> Void)? in - if let __unwrapped = newValue.value { + if bridge.has_value_std__optional_std__function_void____(newValue) { + let __unwrapped = bridge.get_std__optional_std__function_void____(newValue) return { () -> () -> Void in let __wrappedFunction = bridge.wrap_Func_void(__unwrapped) return { () -> Void in @@ -374,7 +380,8 @@ open class HybridVideoViewViewManagerSpec_cxx { @inline(__always) set { self.__implementation.willExitPictureInPicture = { () -> (() -> Void)? in - if let __unwrapped = newValue.value { + if bridge.has_value_std__optional_std__function_void____(newValue) { + let __unwrapped = bridge.get_std__optional_std__function_void____(newValue) return { () -> () -> Void in let __wrappedFunction = bridge.wrap_Func_void(__unwrapped) return { () -> Void in diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/NativeDrmParams.swift b/packages/react-native-video/nitrogen/generated/ios/swift/NativeDrmParams.swift index c1c1a8a4..ceaa4bb3 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/NativeDrmParams.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/NativeDrmParams.swift @@ -77,7 +77,8 @@ public extension NativeDrmParams { @inline(__always) get { return { () -> String? in - if let __unwrapped = self.__type.value { + if bridge.has_value_std__optional_std__string_(self.__type) { + let __unwrapped = bridge.get_std__optional_std__string_(self.__type) return String(__unwrapped) } else { return nil @@ -100,7 +101,8 @@ public extension NativeDrmParams { @inline(__always) get { return { () -> String? in - if let __unwrapped = self.__licenseUrl.value { + if bridge.has_value_std__optional_std__string_(self.__licenseUrl) { + let __unwrapped = bridge.get_std__optional_std__string_(self.__licenseUrl) return String(__unwrapped) } else { return nil @@ -123,7 +125,8 @@ public extension NativeDrmParams { @inline(__always) get { return { () -> String? in - if let __unwrapped = self.__certificateUrl.value { + if bridge.has_value_std__optional_std__string_(self.__certificateUrl) { + let __unwrapped = bridge.get_std__optional_std__string_(self.__certificateUrl) return String(__unwrapped) } else { return nil @@ -146,7 +149,8 @@ public extension NativeDrmParams { @inline(__always) get { return { () -> String? in - if let __unwrapped = self.__contentId.value { + if bridge.has_value_std__optional_std__string_(self.__contentId) { + let __unwrapped = bridge.get_std__optional_std__string_(self.__contentId) return String(__unwrapped) } else { return nil @@ -169,7 +173,8 @@ public extension NativeDrmParams { @inline(__always) get { return { () -> Dictionary? in - if let __unwrapped = self.__licenseHeaders.value { + if bridge.has_value_std__optional_std__unordered_map_std__string__std__string__(self.__licenseHeaders) { + let __unwrapped = bridge.get_std__optional_std__unordered_map_std__string__std__string__(self.__licenseHeaders) return { () -> Dictionary in var __dictionary = Dictionary(minimumCapacity: __unwrapped.size()) let __keys = bridge.get_std__unordered_map_std__string__std__string__keys(__unwrapped) @@ -223,7 +228,8 @@ public extension NativeDrmParams { @inline(__always) get { return { () -> ((_ payload: OnGetLicensePayload) -> Promise>)? in - if let __unwrapped = self.__getLicense.value { + if bridge.has_value_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______(self.__getLicense) { + let __unwrapped = bridge.get_std__optional_std__function_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____const_OnGetLicensePayload_____payload______(self.__getLicense) return { () -> (OnGetLicensePayload) -> Promise> in let __wrappedFunction = bridge.wrap_Func_std__shared_ptr_Promise_std__shared_ptr_Promise_std__string_____OnGetLicensePayload(__unwrapped) return { (__payload: OnGetLicensePayload) -> Promise> in diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift b/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift index 375b66cb..ea8f0a1a 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/NativeVideoConfig.swift @@ -21,13 +21,9 @@ public extension NativeVideoConfig { init(uri: String, externalSubtitles: [NativeExternalSubtitle]?, drm: NativeDrmParams?, headers: Dictionary?, bufferConfig: BufferConfig?, initializeOnCreation: Bool?) { self.init(std.string(uri), { () -> bridge.std__optional_std__vector_NativeExternalSubtitle__ in if let __unwrappedValue = externalSubtitles { - return bridge.create_std__optional_std__vector_NativeExternalSubtitle__({ () -> bridge.std__vector_NativeExternalSubtitle_ in - var __vector = bridge.create_std__vector_NativeExternalSubtitle_(__unwrappedValue.count) - for __item in __unwrappedValue { - __vector.push_back(__item) - } - return __vector - }()) + return bridge.create_std__optional_std__vector_NativeExternalSubtitle__(__unwrappedValue.withUnsafeBufferPointer { __pointer -> bridge.std__vector_NativeExternalSubtitle_ in + return bridge.copy_std__vector_NativeExternalSubtitle_(__pointer.baseAddress!, __unwrappedValue.count) + }) } else { return .init() } @@ -79,8 +75,13 @@ public extension NativeVideoConfig { @inline(__always) get { return { () -> [NativeExternalSubtitle]? in - if let __unwrapped = self.__externalSubtitles.value { - return __unwrapped.map({ __item in __item }) + if bridge.has_value_std__optional_std__vector_NativeExternalSubtitle__(self.__externalSubtitles) { + let __unwrapped = bridge.get_std__optional_std__vector_NativeExternalSubtitle__(self.__externalSubtitles) + return { () -> [NativeExternalSubtitle] in + let __data = bridge.get_data_std__vector_NativeExternalSubtitle_(__unwrapped) + let __size = __unwrapped.size() + return Array(UnsafeBufferPointer(start: __data, count: __size)) + }() } else { return nil } @@ -90,13 +91,9 @@ public extension NativeVideoConfig { set { self.__externalSubtitles = { () -> bridge.std__optional_std__vector_NativeExternalSubtitle__ in if let __unwrappedValue = newValue { - return bridge.create_std__optional_std__vector_NativeExternalSubtitle__({ () -> bridge.std__vector_NativeExternalSubtitle_ in - var __vector = bridge.create_std__vector_NativeExternalSubtitle_(__unwrappedValue.count) - for __item in __unwrappedValue { - __vector.push_back(__item) - } - return __vector - }()) + return bridge.create_std__optional_std__vector_NativeExternalSubtitle__(__unwrappedValue.withUnsafeBufferPointer { __pointer -> bridge.std__vector_NativeExternalSubtitle_ in + return bridge.copy_std__vector_NativeExternalSubtitle_(__pointer.baseAddress!, __unwrappedValue.count) + }) } else { return .init() } @@ -107,13 +104,7 @@ public extension NativeVideoConfig { var drm: NativeDrmParams? { @inline(__always) get { - return { () -> NativeDrmParams? in - if let __unwrapped = self.__drm.value { - return __unwrapped - } else { - return nil - } - }() + return self.__drm.value } @inline(__always) set { @@ -131,7 +122,8 @@ public extension NativeVideoConfig { @inline(__always) get { return { () -> Dictionary? in - if let __unwrapped = self.__headers.value { + if bridge.has_value_std__optional_std__unordered_map_std__string__std__string__(self.__headers) { + let __unwrapped = bridge.get_std__optional_std__unordered_map_std__string__std__string__(self.__headers) return { () -> Dictionary in var __dictionary = Dictionary(minimumCapacity: __unwrapped.size()) let __keys = bridge.get_std__unordered_map_std__string__std__string__keys(__unwrapped) @@ -167,13 +159,7 @@ public extension NativeVideoConfig { var bufferConfig: BufferConfig? { @inline(__always) get { - return { () -> BufferConfig? in - if let __unwrapped = self.__bufferConfig.value { - return __unwrapped - } else { - return nil - } - }() + return self.__bufferConfig.value } @inline(__always) set { diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/TextTrack.swift b/packages/react-native-video/nitrogen/generated/ios/swift/TextTrack.swift index e2f74bdf..f582412f 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/TextTrack.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/TextTrack.swift @@ -54,7 +54,8 @@ public extension TextTrack { @inline(__always) get { return { () -> String? in - if let __unwrapped = self.__language.value { + if bridge.has_value_std__optional_std__string_(self.__language) { + let __unwrapped = bridge.get_std__optional_std__string_(self.__language) return String(__unwrapped) } else { return nil diff --git a/packages/react-native-video/nitrogen/generated/ios/swift/TimedMetadata.swift b/packages/react-native-video/nitrogen/generated/ios/swift/TimedMetadata.swift index b0a231b7..14641c38 100644 --- a/packages/react-native-video/nitrogen/generated/ios/swift/TimedMetadata.swift +++ b/packages/react-native-video/nitrogen/generated/ios/swift/TimedMetadata.swift @@ -19,29 +19,25 @@ public extension TimedMetadata { * Create a new instance of `TimedMetadata`. */ init(metadata: [TimedMetadataObject]) { - self.init({ () -> bridge.std__vector_TimedMetadataObject_ in - var __vector = bridge.create_std__vector_TimedMetadataObject_(metadata.count) - for __item in metadata { - __vector.push_back(__item) - } - return __vector - }()) + self.init(metadata.withUnsafeBufferPointer { __pointer -> bridge.std__vector_TimedMetadataObject_ in + return bridge.copy_std__vector_TimedMetadataObject_(__pointer.baseAddress!, metadata.count) + }) } var metadata: [TimedMetadataObject] { @inline(__always) get { - return self.__metadata.map({ __item in __item }) + return { () -> [TimedMetadataObject] in + let __data = bridge.get_data_std__vector_TimedMetadataObject_(self.__metadata) + let __size = self.__metadata.size() + return Array(UnsafeBufferPointer(start: __data, count: __size)) + }() } @inline(__always) set { - self.__metadata = { () -> bridge.std__vector_TimedMetadataObject_ in - var __vector = bridge.create_std__vector_TimedMetadataObject_(newValue.count) - for __item in newValue { - __vector.push_back(__item) - } - return __vector - }() + self.__metadata = newValue.withUnsafeBufferPointer { __pointer -> bridge.std__vector_TimedMetadataObject_ in + return bridge.copy_std__vector_TimedMetadataObject_(__pointer.baseAddress!, newValue.count) + } } } } diff --git a/packages/react-native-video/package.json b/packages/react-native-video/package.json index 535ec2ec..e1a32d48 100644 --- a/packages/react-native-video/package.json +++ b/packages/react-native-video/package.json @@ -52,7 +52,7 @@ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib", "prepare": "bun run build", "build": "bob build", - "specs": "nitro-codegen", + "specs": "nitrogen", "release": "release-it --preRelease alpha --npm.tag=next" }, "keywords": [ @@ -80,13 +80,13 @@ "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", - "nitro-codegen": "^0.28.0", + "nitrogen": "^0.29.0", "prettier": "^3.0.3", "react": "18.3.1", "react-native": "^0.77.0", "@react-native/eslint-config": "^0.77.0", "react-native-builder-bob": "^0.40.0", - "react-native-nitro-modules": "^0.28.0", + "react-native-nitro-modules": "^0.29.0", "typescript": "^5.2.2" }, "peerDependencies": {