Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
c6ed27c1
Commit
c6ed27c1
authored
Jan 13, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More filter fixes.
parent
8120a307
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
static/galene.js
static/galene.js
+19
-6
No files found.
static/galene.js
View file @
c6ed27c1
...
@@ -878,16 +878,22 @@ Filter.prototype.draw = function() {
...
@@ -878,16 +878,22 @@ Filter.prototype.draw = function() {
this
.
timer
=
setInterval
(()
=>
this
.
draw
(),
1000
/
this
.
frameRate
);
this
.
timer
=
setInterval
(()
=>
this
.
draw
(),
1000
/
this
.
frameRate
);
}
}
}
}
this
.
count
++
;
let
ok
=
this
.
definition
.
f
.
call
(
this
,
this
.
video
,
let
ok
=
false
;
try
{
ok
=
this
.
definition
.
f
.
call
(
this
,
this
.
video
,
this
.
video
.
videoWidth
,
this
.
video
.
videoWidth
,
this
.
video
.
videoHeight
,
this
.
video
.
videoHeight
,
this
.
context
);
this
.
context
);
}
catch
(
e
)
{
console
.
error
(
e
);
}
if
(
ok
&&
!
this
.
fixedFramerate
)
{
if
(
ok
&&
!
this
.
fixedFramerate
)
{
/** @ts-ignore */
/** @ts-ignore */
this
.
captureStream
.
getTracks
()[
0
].
requestFrame
();
this
.
captureStream
.
getTracks
()[
0
].
requestFrame
();
}
}
this
.
count
++
;
};
};
Filter
.
prototype
.
stop
=
function
()
{
Filter
.
prototype
.
stop
=
function
()
{
...
@@ -905,6 +911,8 @@ Filter.prototype.stop = function() {
...
@@ -905,6 +911,8 @@ Filter.prototype.stop = function() {
function
setFilter
(
c
,
f
)
{
function
setFilter
(
c
,
f
)
{
if
(
!
f
)
{
if
(
!
f
)
{
let
filter
=
c
.
userdata
.
filter
;
let
filter
=
c
.
userdata
.
filter
;
if
(
!
filter
)
return
null
;
if
(
!
(
filter
instanceof
Filter
))
if
(
!
(
filter
instanceof
Filter
))
throw
new
Error
(
'
userdata.filter is not a filter
'
);
throw
new
Error
(
'
userdata.filter is not a filter
'
);
if
(
c
.
userdata
.
filter
)
{
if
(
c
.
userdata
.
filter
)
{
...
@@ -940,8 +948,10 @@ let filters = {
...
@@ -940,8 +948,10 @@ let filters = {
f
:
function
(
src
,
width
,
height
,
ctx
)
{
f
:
function
(
src
,
width
,
height
,
ctx
)
{
if
(
!
(
ctx
instanceof
CanvasRenderingContext2D
))
if
(
!
(
ctx
instanceof
CanvasRenderingContext2D
))
throw
new
Error
(
'
bad context type
'
);
throw
new
Error
(
'
bad context type
'
);
if
(
ctx
.
canvas
.
width
!==
width
||
ctx
.
canvas
.
height
!==
height
)
{
ctx
.
canvas
.
width
=
width
;
ctx
.
canvas
.
width
=
width
;
ctx
.
canvas
.
height
=
height
;
ctx
.
canvas
.
height
=
height
;
}
ctx
.
scale
(
-
1
,
1
);
ctx
.
scale
(
-
1
,
1
);
ctx
.
drawImage
(
src
,
-
width
,
0
);
ctx
.
drawImage
(
src
,
-
width
,
0
);
ctx
.
resetTransform
();
ctx
.
resetTransform
();
...
@@ -953,8 +963,10 @@ let filters = {
...
@@ -953,8 +963,10 @@ let filters = {
f
:
function
(
src
,
width
,
height
,
ctx
)
{
f
:
function
(
src
,
width
,
height
,
ctx
)
{
if
(
!
(
ctx
instanceof
CanvasRenderingContext2D
))
if
(
!
(
ctx
instanceof
CanvasRenderingContext2D
))
throw
new
Error
(
'
bad context type
'
);
throw
new
Error
(
'
bad context type
'
);
if
(
ctx
.
canvas
.
width
!==
width
||
ctx
.
canvas
.
height
!==
height
)
{
ctx
.
canvas
.
width
=
width
;
ctx
.
canvas
.
width
=
width
;
ctx
.
canvas
.
height
=
height
;
ctx
.
canvas
.
height
=
height
;
}
ctx
.
scale
(
1
,
-
1
);
ctx
.
scale
(
1
,
-
1
);
ctx
.
drawImage
(
src
,
0
,
-
height
);
ctx
.
drawImage
(
src
,
0
,
-
height
);
ctx
.
resetTransform
();
ctx
.
resetTransform
();
...
@@ -1178,6 +1190,7 @@ async function addFileMedia(file) {
...
@@ -1178,6 +1190,7 @@ async function addFileMedia(file) {
* @param {Stream} c
* @param {Stream} c
*/
*/
function
stopUpMedia
(
c
)
{
function
stopUpMedia
(
c
)
{
setFilter
(
c
,
null
);
if
(
!
c
.
stream
)
if
(
!
c
.
stream
)
return
;
return
;
c
.
stream
.
getTracks
().
forEach
(
t
=>
{
c
.
stream
.
getTracks
().
forEach
(
t
=>
{
...
...
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