-
Notifications
You must be signed in to change notification settings - Fork 103
Add options for bounding and scaling the rendering canvas #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a14e9c1
to
581b867
Compare
To me |
I was thinking of possible confusion with the CSS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
581b867
to
1ddaff9
Compare
@dmitrylyzo: I don't think I changed any functionality jellyfin relies on during cleanup, but just to make sure could you take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the only thing left is a true noop (skipping multiplications) when scaleFactor
is 1.0
. But since this function is rarely used, noop doesn't make much sense.
Should we round the result (to pixels)?
JSO struggles on complex subtitles and higher resolutions, scaling the sub-canvas down if the canvas gets larger than a size deemed good enough can be used to somewhat work around this at the expense of introducing some blurriness. Scaling up is also possible but probably less useful. This was ported from jellyfin's fork and jellyfin-web uses this on at least some devices. However the option names were changed to better match their actual function. [Vasily <just.one.man@yandex.ru>] Original implementation together with a hard canvas height limit in jellyfin@345d701 jellyfin@bcf4b5f [Dmitry Lyzo <ashephard0@gmail.com>] Rebased for upstream; removed default hardHeightLimit and added docs [Oneric <oneric@oneric.stub>] Simplified scaling logic (identical results for positive values); fixed zero and negativity bugs in scaling logic; changed option names for clarity; split prescaling from hard height limit. Co-Authored-By: Dmitry Lyzo <ashephard0@gmail.com> Co-Authored-By: Oneric <oneric@oneric.stub>
JSO struggles with complex subtitles on HiDPI canvasses, so limiting the size can make sense if such subtitles are expected. This was ported from jellyfin's fork and jellyfin-web uses this on at least some devices. In the original implementation prescaleHeightLimit would override maxRenderHeight if it was larger. This undocumentend behaviour was dropped here as it seemed unintuitive and unhelpful. [Vasily <just.one.man@yandex.ru>] Original implementation together with prescaling in jellyfin@345d701 jellyfin@4c5f018 [Dmitry Lyzo] Rebased for upstream; seperated from the prescaling; removed default height limit and added docs [Oneric] Renamed hardHeightLimit to maxRenderHeight; split from prescaling. Co-Authored-By: Dmitry Lyzo <ashephard0@gmail.com>
|
I meant that all this math will be applied even with
|
Yeah, |
1ddaff9
to
5ebf13d
Compare
@dmitrylyzo @TheOneric are there any more JS PR's to merge which aren't already made? If not I could start work on v2 and have it finished by the end of the week. |
yes. |
sorry, i meant from the original pr Dimitry made, any chance you could abridge me what those are? |
Excluding this PR there is: Merged:
Created but not final or not reviewed::
Uncreated:
|
Here's what I think:
Additionally, ideas which aren't posted here:
requestVideoFrameCallback can potentially allow us to do frame-perfect painting of subtitles if renderahead is done with time, rather than memory. |
@ThaUnknown: this PR is about prescaling and bounding the canvas and not the right place for extended discussion of general ideas/feature requests for the future. |
Cleaned and simplified (keeping the same results for positive saling values) version of #119 backporting a jellyfin feature.
( @dmitrylyzo )
In particular I'd like to get some feedback on the name for the option added in the second commit: While I find
hardHeightLimit
to be an ok name, I was also consideringcanvasHeightLimit
,maxCanvasHeight
andmaxRenderingHeight
but I'm not sure if eg thecanvas
-names might cause confusion with the HTML-<canvas>
element.Another previously discussed topic was if I'd be better to bundle the
prescale
options into one object internally or also externally. I have no particular preference with regards to that.