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
7d553e85
Commit
7d553e85
authored
May 17, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unittest edits
parent
5250a462
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
15 deletions
+9
-15
Channel.spec.js
tests/Channel.spec.js
+4
-1
ENCH264Group.spec.js
tests/ENCH264Group.spec.js
+2
-3
WW.spec.js
tests/WW.spec.js
+2
-10
paraEncodeSpec.spec.js
tests/paraEncodeSpec.spec.js
+1
-1
No files found.
tests/Channel.spec.js
View file @
7d553e85
...
@@ -316,7 +316,7 @@ describe("Channel Spec", () => {
...
@@ -316,7 +316,7 @@ describe("Channel Spec", () => {
},
10000
);
},
10000
);
f
it
(
"BLK-BASED Channel Case 1"
,
async
()
=>
{
it
(
"BLK-BASED Channel Case 1"
,
async
()
=>
{
const
blkSize
=
10
;
const
blkSize
=
10
;
let
chn
=
new
Channel
(
blkSize
*
2
);
let
chn
=
new
Channel
(
blkSize
*
2
);
chn
.
enableBlockMode
(
blkSize
);
chn
.
enableBlockMode
(
blkSize
);
...
@@ -329,4 +329,7 @@ describe("Channel Spec", () => {
...
@@ -329,4 +329,7 @@ describe("Channel Spec", () => {
expect
(
chn
.
dataSize
()).
toBe
(
blkSize
*
2
);
expect
(
chn
.
dataSize
()).
toBe
(
blkSize
*
2
);
});
});
it
(
"BLK-BASED Channel Case 2"
,
async
()
=>
{
});
});
});
tests/ENCH264Group.spec.js
View file @
7d553e85
...
@@ -9,7 +9,7 @@ describe("H264EncWWGroup Spec", () => {
...
@@ -9,7 +9,7 @@ describe("H264EncWWGroup Spec", () => {
await
sleep
(
1000
);
await
sleep
(
1000
);
expect
(
wg
.
numOfWorker
()).
toBe
(
2
);
expect
(
wg
.
numOfWorker
()).
toBe
(
2
);
});
}
,
10000
);
it
(
"Encode by H264EncWWGroup Spec"
,
async
()
=>
{
it
(
"Encode by H264EncWWGroup Spec"
,
async
()
=>
{
const
RGBAFrameSize
=
1920
*
1080
*
4
;
const
RGBAFrameSize
=
1920
*
1080
*
4
;
...
@@ -23,7 +23,7 @@ describe("H264EncWWGroup Spec", () => {
...
@@ -23,7 +23,7 @@ describe("H264EncWWGroup Spec", () => {
const
data
=
new
Uint8Array
([...
Array
(
RGBAFrameSize
).
keys
()]);
const
data
=
new
Uint8Array
([...
Array
(
RGBAFrameSize
).
keys
()]);
for
(
let
i
=
0
;
i
<
30
0
;
++
i
)
{
for
(
let
i
=
0
;
i
<
30
;
++
i
)
{
await
grp
.
dispatch
(
data
);
await
grp
.
dispatch
(
data
);
}
}
...
@@ -34,7 +34,6 @@ describe("H264EncWWGroup Spec", () => {
...
@@ -34,7 +34,6 @@ describe("H264EncWWGroup Spec", () => {
await
waitCond
(()
=>
grp
.
isDone
());
await
waitCond
(()
=>
grp
.
isDone
());
let
result
=
await
grp
.
getResult
();
let
result
=
await
grp
.
getResult
();
console
.
log
(
result
);
grp
.
terminate
();
grp
.
terminate
();
...
...
tests/WW.spec.js
View file @
7d553e85
...
@@ -145,9 +145,7 @@ describe("EncWW Specifications", () => {
...
@@ -145,9 +145,7 @@ describe("EncWW Specifications", () => {
// Send datas
// Send datas
for
(
let
i
=
0
;
i
<
30
;
++
i
)
{
for
(
let
i
=
0
;
i
<
30
;
++
i
)
{
while
(
chs
[
i
%
2
].
push
(
data
)
==
false
)
{
while
(
chs
[
i
%
2
].
push
(
data
)
==
false
)
{}
console
.
log
(
"sleep"
);
}
}
}
// Send eof
// Send eof
...
@@ -305,8 +303,6 @@ describe("EncWW Specifications", () => {
...
@@ -305,8 +303,6 @@ describe("EncWW Specifications", () => {
},
100
);
},
100
);
});
});
console
.
log
(
"Ready"
);
const
data
=
new
Uint8Array
([...
Array
(
RGBAFrameSize
).
keys
()]);
const
data
=
new
Uint8Array
([...
Array
(
RGBAFrameSize
).
keys
()]);
let
input_1
=
new
Channel
(
INPUT_SIZE
,
SharedArrayBuffer
,
mem1
);
let
input_1
=
new
Channel
(
INPUT_SIZE
,
SharedArrayBuffer
,
mem1
);
...
@@ -324,12 +320,10 @@ describe("EncWW Specifications", () => {
...
@@ -324,12 +320,10 @@ describe("EncWW Specifications", () => {
))
))
let
inputs
=
[
input_1
,
input_2
];
let
inputs
=
[
input_1
,
input_2
];
for
(
let
i
=
0
;
i
<
30
0
;
++
i
)
{
for
(
let
i
=
0
;
i
<
30
;
++
i
)
{
while
(
inputs
[
i
%
2
].
push
(
data
)
==
false
)
{
while
(
inputs
[
i
%
2
].
push
(
data
)
==
false
)
{
console
.
log
(
"Sleep"
);
await
sleep
(
100
);
await
sleep
(
100
);
}
}
console
.
log
(
"PUSH IN MAIN
\n
"
);
}
}
input_1
.
setPriv
(
PRIV_FLAGS
.
EOF
);
input_1
.
setPriv
(
PRIV_FLAGS
.
EOF
);
...
@@ -344,8 +338,6 @@ describe("EncWW Specifications", () => {
...
@@ -344,8 +338,6 @@ describe("EncWW Specifications", () => {
},
1000
);
},
1000
);
});
});
console
.
log
(
"ALL DONE"
);
let
done
=
false
;
let
done
=
false
;
mux
.
subscribe
(
msg
=>
{
mux
.
subscribe
(
msg
=>
{
done
=
true
;
done
=
true
;
...
...
tests/paraEncodeSpec.spec.js
View file @
7d553e85
...
@@ -18,7 +18,7 @@ const RGBAFrameSize = 1920*1080*4;
...
@@ -18,7 +18,7 @@ const RGBAFrameSize = 1920*1080*4;
describe
(
"ParaEncoder"
,
()
=>
{
describe
(
"ParaEncoder"
,
()
=>
{
it
(
"Encode With ParaEncoder"
,
async
()
=>
{
x
it
(
"Encode With ParaEncoder"
,
async
()
=>
{
const
data
=
new
Uint8Array
([...
Array
(
RGBAFrameSize
).
keys
()]);
const
data
=
new
Uint8Array
([...
Array
(
RGBAFrameSize
).
keys
()]);
let
st
=
new
Date
();
let
st
=
new
Date
();
...
...
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