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
3b9f2fe9
Commit
3b9f2fe9
authored
May 13, 2022
by
Linshizhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shorter loop sleep interval
parent
42a3c80a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
encWW.js
resources/workers/encWW.js
+9
-4
muxWW.js
resources/workers/muxWW.js
+1
-1
encGroup.js
src/encGroup.js
+1
-1
No files found.
resources/workers/encWW.js
View file @
3b9f2fe9
...
@@ -9,12 +9,14 @@ let wasmMem = null;
...
@@ -9,12 +9,14 @@ let wasmMem = null;
let
size
=
null
;
let
size
=
null
;
let
eof
=
false
;
let
eof
=
false
;
let
elapsed
=
0
;
// Number of bytes for each read
// Number of bytes for each read
// from channel
// from channel
const
RGBFrameSize
=
1920
*
1080
*
4
;
const
RGBFrameSize
=
1920
*
1080
*
4
;
let
READ_SIZE
=
RGBFrameSize
;
let
READ_SIZE
=
RGBFrameSize
;
const
SLEEP_INTERVAL
=
100
;
const
SLEEP_INTERVAL
=
100
;
const
SPIN_TIMEOUT
=
50
0
;
const
SPIN_TIMEOUT
=
3
0
;
const
ENC_BUF_SIZE
=
RGBFrameSize
*
10
const
ENC_BUF_SIZE
=
RGBFrameSize
*
10
let
encBuf
=
null
;
let
encBuf
=
null
;
...
@@ -171,7 +173,7 @@ async function EOFProcessing() {
...
@@ -171,7 +173,7 @@ async function EOFProcessing() {
break
;
break
;
}
}
sendToMuxerUntilSuccess
(
size_
,
50
0
);
sendToMuxerUntilSuccess
(
size_
,
3
0
);
}
}
// Notify muxer this stream is all transfered.
// Notify muxer this stream is all transfered.
...
@@ -195,7 +197,10 @@ async function RGBProcessing(frame) {
...
@@ -195,7 +197,10 @@ async function RGBProcessing(frame) {
size_
=
encoder
.
getValue
(
size
,
'i32'
);
size_
=
encoder
.
getValue
(
size
,
'i32'
);
et
=
new
Date
();
et
=
new
Date
();
console
.
log
(
"Encode with elapsed: "
+
(
et
-
st
));
let
timeDiff
=
(
et
-
st
)
/
1000
;
elapsed
+=
timeDiff
;
console
.
log
(
"Encode with elapsed: "
+
timeDiff
);
console
.
log
(
"Encode Total: "
+
elapsed
);
if
(
size_
==
0
)
if
(
size_
==
0
)
return
true
;
return
true
;
...
@@ -206,7 +211,7 @@ async function RGBProcessing(frame) {
...
@@ -206,7 +211,7 @@ async function RGBProcessing(frame) {
throw
new
Error
(
"Unknown error"
);
throw
new
Error
(
"Unknown error"
);
}
}
await
sendToMuxerUntilSuccess
(
size_
,
30
0
);
await
sendToMuxerUntilSuccess
(
size_
,
30
);
return
true
;
return
true
;
}
}
...
...
resources/workers/muxWW.js
View file @
3b9f2fe9
...
@@ -16,7 +16,7 @@ let done = false;
...
@@ -16,7 +16,7 @@ let done = false;
let
inExec
=
false
;
let
inExec
=
false
;
// Constants
// Constants
const
SLEEP_INTERVAL
=
10
0
;
const
SLEEP_INTERVAL
=
3
0
;
const
SPIN_TIMEOUT
=
100000
;
const
SPIN_TIMEOUT
=
100000
;
// WASM Objects
// WASM Objects
...
...
src/encGroup.js
View file @
3b9f2fe9
...
@@ -160,7 +160,7 @@ export class H264EncWWGroup extends WWGroup {
...
@@ -160,7 +160,7 @@ export class H264EncWWGroup extends WWGroup {
}
}
while
(
this
.
#
channels
[
this
.
#
curProcWW
].
push
(
rgbFrame
)
==
false
)
{
while
(
this
.
#
channels
[
this
.
#
curProcWW
].
push
(
rgbFrame
)
==
false
)
{
await
sleep
(
30
0
);
await
sleep
(
5
0
);
}
}
if
(
!
this
.
#
channels
[
this
.
#
curProcWW
].
isSetPriv
(
PRIV_FLAGS
.
EXECUTING
))
{
if
(
!
this
.
#
channels
[
this
.
#
curProcWW
].
isSetPriv
(
PRIV_FLAGS
.
EXECUTING
))
{
...
...
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