Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
ParaEncode
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ParaEncode
Commits
0bf24f43
Commit
0bf24f43
authored
Apr 26, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use classic Web worker.
parent
58e2992e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
433 additions
and
30 deletions
+433
-30
WW.js
src/WW.js
+1
-2
encGroup.js
src/encGroup.js
+1
-1
encWW.js
src/workers/encWW.js
+428
-20
WWGroup.spec.js
tests/WWGroup.spec.js
+2
-3
webpack.tdd.conf.js
webpack.tdd.conf.js
+1
-4
No files found.
src/WW.js
View file @
0bf24f43
...
@@ -18,8 +18,7 @@ export class WW extends Observable {
...
@@ -18,8 +18,7 @@ export class WW extends Observable {
this
.
#
ident
=
name
;
this
.
#
ident
=
name
;
this
.
#
ww
=
new
Worker
(
this
.
#
ww
=
new
Worker
(
new
URL
(
path
,
import
.
meta
.
url
),
new
URL
(
path
,
import
.
meta
.
url
)
{
type
:
'module'
}
);
);
}
}
...
...
src/encGroup.js
View file @
0bf24f43
import
{
assert
}
from
'./utils.js'
;
import
{
assert
,
sleep
}
from
'./utils.js'
;
import
{
WWGroup
}
from
'./WWGroup.js'
;
import
{
WWGroup
}
from
'./WWGroup.js'
;
import
{
WW
}
from
'./WW.js'
;
import
{
WW
}
from
'./WW.js'
;
import
{
Channel
}
from
'./channel.js'
;
import
{
Channel
}
from
'./channel.js'
;
...
...
src/workers/encWW.js
View file @
0bf24f43
This diff is collapsed.
Click to expand it.
tests/WWGroup.spec.js
View file @
0bf24f43
import
{
sleep
}
from
'../src/utils.js'
;
import
{
sleep
}
from
'../src/utils.js'
;
import
{
H264EncWWGroup
}
from
'../src/encGroup.js'
;
import
{
H264EncWWGroup
}
from
'../src/encGroup.js'
;
import
{
Obervable
,
Observable
}
from
'rxjs'
;
import
{
Obervable
,
Observable
}
from
'rxjs'
;
...
@@ -189,12 +188,12 @@ describe("Channel Spec", () => {
...
@@ -189,12 +188,12 @@ describe("Channel Spec", () => {
describe
(
"H264EncWWGroup Spec"
,
()
=>
{
describe
(
"H264EncWWGroup Spec"
,
()
=>
{
it
(
"Instantiation"
,
async
()
=>
{
it
(
"Instantiation"
,
async
()
=>
{
let
wg
=
new
H264EncWWGroup
(
"h264enc"
,
{
numOfWW
:
3
});
let
wg
=
new
H264EncWWGroup
(
"h264enc"
,
{
numOfWW
:
2
});
await
wg
.
start
();
await
wg
.
start
();
await
sleep
(
1000
);
await
sleep
(
1000
);
expect
(
wg
.
numOfWorker
()).
toBe
(
3
);
expect
(
wg
.
numOfWorker
()).
toBe
(
2
);
});
});
...
...
webpack.tdd.conf.js
View file @
0bf24f43
...
@@ -2,7 +2,7 @@ const path = require('path');
...
@@ -2,7 +2,7 @@ const path = require('path');
const
webpack
=
require
(
"webpack"
);
const
webpack
=
require
(
"webpack"
);
module
.
exports
=
{
module
.
exports
=
{
entry
:
'./
tests/
specs.js'
,
entry
:
'./specs.js'
,
mode
:
'development'
,
mode
:
'development'
,
output
:
{
output
:
{
filename
:
'spec_bundle.js'
,
filename
:
'spec_bundle.js'
,
...
@@ -16,9 +16,6 @@ module.exports = {
...
@@ -16,9 +16,6 @@ module.exports = {
exclude
:
/node_modules/
,
exclude
:
/node_modules/
,
use
:
[
'babel-loader'
]
use
:
[
'babel-loader'
]
},
},
{
}
]
]
},
},
plugins
:
[
plugins
:
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment