189 lines
38 KiB
JavaScript
189 lines
38 KiB
JavaScript
|
/******/ (function(modules) { // webpackBootstrap
|
||
|
/******/ // The module cache
|
||
|
/******/ var installedModules = {};
|
||
|
/******/
|
||
|
/******/ // The require function
|
||
|
/******/ function __webpack_require__(moduleId) {
|
||
|
/******/
|
||
|
/******/ // Check if module is in cache
|
||
|
/******/ if(installedModules[moduleId]) {
|
||
|
/******/ return installedModules[moduleId].exports;
|
||
|
/******/ }
|
||
|
/******/ // Create a new module (and put it into the cache)
|
||
|
/******/ var module = installedModules[moduleId] = {
|
||
|
/******/ i: moduleId,
|
||
|
/******/ l: false,
|
||
|
/******/ exports: {}
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Execute the module function
|
||
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
/******/
|
||
|
/******/ // Flag the module as loaded
|
||
|
/******/ module.l = true;
|
||
|
/******/
|
||
|
/******/ // Return the exports of the module
|
||
|
/******/ return module.exports;
|
||
|
/******/ }
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // expose the modules object (__webpack_modules__)
|
||
|
/******/ __webpack_require__.m = modules;
|
||
|
/******/
|
||
|
/******/ // expose the module cache
|
||
|
/******/ __webpack_require__.c = installedModules;
|
||
|
/******/
|
||
|
/******/ // define getter function for harmony exports
|
||
|
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||
|
/******/ if(!__webpack_require__.o(exports, name)) {
|
||
|
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
||
|
/******/ }
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // define __esModule on exports
|
||
|
/******/ __webpack_require__.r = function(exports) {
|
||
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
||
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
||
|
/******/ }
|
||
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // create a fake namespace object
|
||
|
/******/ // mode & 1: value is a module id, require it
|
||
|
/******/ // mode & 2: merge all properties of value into the ns
|
||
|
/******/ // mode & 4: return value when already ns object
|
||
|
/******/ // mode & 8|1: behave like require
|
||
|
/******/ __webpack_require__.t = function(value, mode) {
|
||
|
/******/ if(mode & 1) value = __webpack_require__(value);
|
||
|
/******/ if(mode & 8) return value;
|
||
|
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
||
|
/******/ var ns = Object.create(null);
|
||
|
/******/ __webpack_require__.r(ns);
|
||
|
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
||
|
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
||
|
/******/ return ns;
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||
|
/******/ __webpack_require__.n = function(module) {
|
||
|
/******/ var getter = module && module.__esModule ?
|
||
|
/******/ function getDefault() { return module['default']; } :
|
||
|
/******/ function getModuleExports() { return module; };
|
||
|
/******/ __webpack_require__.d(getter, 'a', getter);
|
||
|
/******/ return getter;
|
||
|
/******/ };
|
||
|
/******/
|
||
|
/******/ // Object.prototype.hasOwnProperty.call
|
||
|
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||
|
/******/
|
||
|
/******/ // __webpack_public_path__
|
||
|
/******/ __webpack_require__.p = "";
|
||
|
/******/
|
||
|
/******/
|
||
|
/******/ // Load entry module and return exports
|
||
|
/******/ return __webpack_require__(__webpack_require__.s = "./src/worker-script/browser/index.js");
|
||
|
/******/ })
|
||
|
/************************************************************************/
|
||
|
/******/ ({
|
||
|
|
||
|
/***/ "./node_modules/regenerator-runtime/runtime.js":
|
||
|
/*!*****************************************************!*\
|
||
|
!*** ./node_modules/regenerator-runtime/runtime.js ***!
|
||
|
\*****************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"thro
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./node_modules/webpack/buildin/global.js":
|
||
|
/*!***********************************!*\
|
||
|
!*** (webpack)/buildin/global.js ***!
|
||
|
\***********************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n\n\n//# sourceURL=webpack:///(webpack)/buildin/global.js?");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/utils/getTransferables.js":
|
||
|
/*!***************************************!*\
|
||
|
!*** ./src/utils/getTransferables.js ***!
|
||
|
\***************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
eval("module.exports = function (packet) {\n var transferables = [];\n\n var check = function check(b) {\n if (b instanceof Uint8Array) {\n transferables.push(b.buffer);\n } else if (b instanceof ArrayBuffer) {\n transferables.push(b);\n }\n };\n\n var _packet$payload = packet.payload,\n args = _packet$payload.args,\n data = _packet$payload.data;\n check(data);\n\n if (Array.isArray(args)) {\n args.forEach(function (arg) {\n return check(arg);\n });\n }\n\n return transferables;\n};\n\n//# sourceURL=webpack:///./src/utils/getTransferables.js?");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/worker-script/browser/getCore.js":
|
||
|
/*!**********************************************!*\
|
||
|
!*** ./src/worker-script/browser/getCore.js ***!
|
||
|
\**********************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
eval("/* WEBPACK VAR INJECTION */(function(global) {module.exports = function (corePath) {\n if (typeof global.Module === 'undefined') {\n global.importScripts(corePath);\n }\n\n return global.Module;\n};\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/worker-script/browser/getCore.js?");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/worker-script/browser/index.js":
|
||
|
/*!********************************************!*\
|
||
|
!*** ./src/worker-script/browser/index.js ***!
|
||
|
\********************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
eval("/* WEBPACK VAR INJECTION */(function(global) {var worker = __webpack_require__(/*! ../ */ \"./src/worker-script/index.js\");\n\nvar getCore = __webpack_require__(/*! ./getCore */ \"./src/worker-script/browser/getCore.js\");\n\nglobal.addEventListener('message', function (_ref) {\n var data = _ref.data;\n worker.dispatchHandlers(data, postMessage);\n});\nworker.setAdapter({\n getCore: getCore\n});\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/worker-script/browser/index.js?");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/worker-script/constants/defaultArgs.js":
|
||
|
/*!****************************************************!*\
|
||
|
!*** ./src/worker-script/constants/defaultArgs.js ***!
|
||
|
\****************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
eval("module.exports = ['./ffmpeg', // args[0] is always binary path\n'-nostdin' // Disable interaction mode\n];\n\n//# sourceURL=webpack:///./src/worker-script/constants/defaultArgs.js?");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/worker-script/index.js":
|
||
|
/*!************************************!*\
|
||
|
!*** ./src/worker-script/index.js ***!
|
||
|
\************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
eval("var _this = this;\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\n__webpack_require__(/*! regenerator-runtime/runtime */ \"./node_modules/regenerator-runtime/runtime.js\");\n\nvar defaultArgs = __webpack_require__(/*! ./constants/defaultArgs */ \"./src/worker-script/constants/defaultArgs.js\");\n\nvar strList2ptr = __webpack_require__(/*! ./utils/strList2ptr */ \"./src/worker-script/utils/strList2ptr.js\");\n\nvar getTransferables = __webpack_require__(/*! ../utils/getTransferables */ \"./src/utils/getTransferables.js\");\n\nvar action = 'unknown';\nvar Module = null;\nvar adapter = null;\nvar ffmpeg = null;\n\nvar load = function load(_ref, res) {\n var workerId = _ref.workerId,\n corePath = _ref.payload.options.corePath;\n\n if (Module == null) {\n var Core = adapter.getCore(corePath);\n Core().then(\n /*#__PURE__*/\n function () {\n var _ref2 = _asyncToGenerator(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee(_Module) {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n Module = _Module;\n Module.setLogger(function (message, type) {\n res.progress({\n workerId: workerId,\n action: action,\n type: type,\n message: message\n });\n });\n ffmpeg = Module.cwrap('ffmpeg', 'number', ['number', 'number']);\n res.resolve({\n message: 'Loaded ffmpeg-core'\n });\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x) {\n return _ref2.apply(this, arguments);\n };\n }());\n } else {\n res.resolve({\n message: 'Loaded ffmpeg-core'\n });\n }\n};\n\nvar FS = function FS(_ref3, res) {\n var _Module$FS;\n\n var _ref3$payload = _ref3.payload,\n method = _ref3$payload.method,\n args = _ref3$payload.args;\n res.resolve({\n message: \"Complete \".concat(method),\n data: (_Module$FS = Module.FS)[method].apply(_Module$FS, _toConsumableArray(args))\n });\n};\n\nvar run = function run(_ref4, res) {\n var _args = _ref4.payload.args;\n var args = [].concat(_toConsumableArray(defaultArgs), _toConsumableArray(_args.trim().split(' '))).filter(function (s) {\n return s.length !== 0;\n });\n console.log('ARGS', args);\n ffmpeg(args.length, strList2ptr(Module, args));\n res.resolve({\n message: \"Complete \".concat(args.join(' '))\n });\n};\n\nexports.dispatchHandlers = function (packet, send) {\n var workerId = packet.workerId,\n jobId = packet.jobId,\n act = packet.action;\n\n var res = function res
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/worker-script/utils/str2ptr.js":
|
||
|
/*!********************************************!*\
|
||
|
!*** ./src/worker-script/utils/str2ptr.js ***!
|
||
|
\********************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports) {
|
||
|
|
||
|
eval("module.exports = function (Module, s) {\n var ptr = Module._malloc((s.length + 1) * Uint8Array.BYTES_PER_ELEMENT);\n\n for (var i = 0; i < s.length; i += 1) {\n Module.setValue(ptr + i, s.charCodeAt(i), 'i8');\n }\n\n Module.setValue(ptr + s.length, 0, 'i8');\n return ptr;\n};\n\n//# sourceURL=webpack:///./src/worker-script/utils/str2ptr.js?");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ "./src/worker-script/utils/strList2ptr.js":
|
||
|
/*!************************************************!*\
|
||
|
!*** ./src/worker-script/utils/strList2ptr.js ***!
|
||
|
\************************************************/
|
||
|
/*! no static exports found */
|
||
|
/***/ (function(module, exports, __webpack_require__) {
|
||
|
|
||
|
eval("var str2ptr = __webpack_require__(/*! ./str2ptr */ \"./src/worker-script/utils/str2ptr.js\");\n\nmodule.exports = function (Module, strList) {\n var listPtr = Module._malloc(strList.length * Uint32Array.BYTES_PER_ELEMENT);\n\n strList.forEach(function (s, idx) {\n var strPtr = str2ptr(Module, s);\n Module.setValue(listPtr + 4 * idx, strPtr, 'i32');\n });\n return listPtr;\n};\n\n//# sourceURL=webpack:///./src/worker-script/utils/strList2ptr.js?");
|
||
|
|
||
|
/***/ })
|
||
|
|
||
|
/******/ });
|