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
7861d6d3
Commit
7861d6d3
authored
May 18, 2022
by
NzSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7d3bfeb8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
defs.js
resources/workers/defs.js
+13
-9
encGroup.js
src/encGroup.js
+0
-3
No files found.
resources/workers/defs.js
View file @
7861d6d3
...
@@ -352,6 +352,11 @@ class Channel {
...
@@ -352,6 +352,11 @@ class Channel {
let
rEnd
=
this
.
#
readPointerCache
;
let
rEnd
=
this
.
#
readPointerCache
;
this
.
#
writePointerCache
=
this
.
#
getWritePointer
();
this
.
#
writePointerCache
=
this
.
#
getWritePointer
();
let
rPos
=
this
.
#
readPointerCache
;
if
(
rPos
==
endPos
)
{
rPos
=
this
.
#
metaSize
;
}
if
(
this
.
dataSize
()
<
size
)
if
(
this
.
dataSize
()
<
size
)
return
new
Uint8Array
(
0
);
return
new
Uint8Array
(
0
);
...
@@ -364,25 +369,24 @@ class Channel {
...
@@ -364,25 +369,24 @@ class Channel {
let
rBlks
=
this
.
#
getRBlks
();
let
rBlks
=
this
.
#
getRBlks
();
buffer
=
new
Uint8Array
(
blksRequired
*
this
.
#
blockSize
);
buffer
=
new
Uint8Array
(
blksRequired
*
this
.
#
blockSize
);
if
(
this
.
#
readPointerCache
>=
this
.
#
writePointerCache
)
{
if
(
rPos
>=
this
.
#
writePointerCache
)
{
let
spaceBetweenEnd
=
endPos
-
this
.
#
readPointerCache
;
let
spaceBetweenEnd
=
endPos
-
rPos
;
let
blks
=
Math
.
floor
(
spaceBetweenEnd
/
this
.
#
blockSize
);
let
blks
=
Math
.
floor
(
spaceBetweenEnd
/
this
.
#
blockSize
);
if
(
blks
>=
blksRequired
)
{
if
(
blks
>=
blksRequired
)
{
rEnd
=
this
.
#
readPointerCache
+
(
blksRequired
*
this
.
#
blockSize
);
rEnd
=
rPos
+
(
blksRequired
*
this
.
#
blockSize
);
buffer
.
set
(
this
.
#
buffer
.
subarray
(
this
.
#
readPointerCache
,
rEnd
));
buffer
.
set
(
this
.
#
buffer
.
subarray
(
rPos
,
rEnd
));
}
else
{
}
else
{
// Read two times
// Read two times
rEnd
=
this
.
#
metaSize
+
(
blksRequired
-
blks
)
*
this
.
#
blockSize
;
rEnd
=
this
.
#
metaSize
+
(
blksRequired
-
blks
)
*
this
.
#
blockSize
;
buffer
.
set
(
this
.
#
buffer
.
subarray
(
buffer
.
set
(
this
.
#
buffer
.
subarray
(
this
.
#
readPointerCache
,
blks
*
this
.
#
blockSize
));
rPos
,
blks
*
this
.
#
blockSize
));
buffer
.
set
(
this
.
#
buffer
.
subarray
(
this
.
#
metaSize
,
rEnd
),
buffer
.
set
(
this
.
#
buffer
.
subarray
(
this
.
#
metaSize
,
rEnd
),
blks
*
this
.
#
blockSize
);
blks
*
this
.
#
blockSize
);
}
}
}
else
if
(
this
.
#
readPointerCache
<
this
.
#
writePointerCache
)
{
}
else
if
(
rPos
<
this
.
#
writePointerCache
)
{
rEnd
=
this
.
#
readPointerCache
+
(
blksRequired
*
this
.
#
blockSize
);
rEnd
=
rPos
+
(
blksRequired
*
this
.
#
blockSize
);
buffer
.
set
(
this
.
#
buffer
.
subarray
(
buffer
.
set
(
this
.
#
buffer
.
subarray
(
rPos
,
rEnd
));
this
.
#
readPointerCache
,
rEnd
));
}
}
this
.
#
setRBlks
((
rBlks
+
blksRequired
)
%
Math
.
pow
(
2
,
8
));
this
.
#
setRBlks
((
rBlks
+
blksRequired
)
%
Math
.
pow
(
2
,
8
));
...
...
src/encGroup.js
View file @
7861d6d3
...
@@ -84,9 +84,6 @@ export class H264EncWWGroup extends WWGroup {
...
@@ -84,9 +84,6 @@ export class H264EncWWGroup extends WWGroup {
if
(
'blocksize'
in
options
)
if
(
'blocksize'
in
options
)
this
.
#
blockSize
=
options
.
blocksize
;
this
.
#
blockSize
=
options
.
blocksize
;
console
.
log
(
options
);
console
.
log
(
"BlockSize is :"
+
this
.
#
blockSize
);
if
(
'width'
in
options
&&
'height'
in
options
&&
'fps'
in
options
)
{
if
(
'width'
in
options
&&
'height'
in
options
&&
'fps'
in
options
)
{
this
.
#
width
=
options
.
width
;
this
.
#
width
=
options
.
width
;
this
.
#
height
=
options
.
height
;
this
.
#
height
=
options
.
height
;
...
...
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