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
Should the VideoDisplayConfiguration width & height be in CSS or device pixels #133
Comments
If the main use case is, as @mwatson2 says, to determine which resolution variant to choose based on device pixels, then this working group is the wrong place to specify that. CSS has made a choice about how they represent the device pixel ratio, and I don’t want to be in the business of undermining their specification choices. If content providers feel that the device pixel ratio is not precise enough, they should file an issue against CSS. So, is there another use case here? Is there an example of a device which cannot display video at all resolutions it advertises decode support for? |
Agreed. In addition, we also want to expose the device's physical resolution so that, for instance, users with pixel-doubled 4K displays are able to receive 4K video content. Using the pixel-doubled 4K display example, window.screen.height would return 1080 (CSS pixels). Sites like Netflix can derive the physical resolution using window.devicePixelRatio. However, I am under the impression that (window.screen.height)*(window.devicePixelRatio) does not always equate to the device's physical pixel due to window.devicePixelRatio's definition varying from platform to platform. Is my understanding correct? |
The TV platforms being discussed have two physical pixel resolutions (one for graphics, one for video). On Chromecast today, window.screen.height is 720, device pixel ratio is 1.5 (1080 physical pixels height for graphics), and 4K video may be supported (so existing CSS facilities don't provide a way to query this, we currently provide a Chromecast-specific API to detect whether 4K is supported or not). |
A CSS pixel is defined as a unit of physical length, so the size of the graphics and video planes in CSS pixels will always be the same, even where they support different resolutions. The CSS definition of CSS pixels was originally based on a comfortable pixel size for laptop / desktop viewing distances. As far as I know, there has been no separate definition of CSS pixel for TVs so I imagine that browser implementors in the TV space have made their own choices based on reverse engineering the appearance of web pages, defaulting to physical pixels or some other approach. @jernoble If it is necessary to follow CSS's approach exactly, then what is needed is a separate |
I think I understand, but let me restate my understanding so y'all can tell me why I'm wrong: For devices that use a single plane for both graphics and video, the existing CSS facilities are sufficient. But for devices with a separate plane for non-video rendered web content and another plane for video content, the existing CSS facilities may give a false-negative signal about support for particular video resolutions.
|
It's not just Chromecast. There are TV sets with an HD panel, HD graphics but which can decode and down-sample UHD. The ability for what is otherwise an HD TVs to decode and downsample UHD video may even become a legal requirement in some countries. |
@jpiesing, Hang on, that seems to be the inverse of the use case listed earlier. @mwatson2's use case was to discover the physical pixels available to the display in order to choose a variant which most closely matched that physical resolution. What I understand your use case to be is the ability of the UA (the TV) to down-sample the decoded video to from the original resolution to the resolution of the display. If a UA couldn't do that downscaling, I'd argue it shouldn't advertise support for decoding it in the first place, or that's the consensus we came to in #118 earlier with a similar issue (see @chcunningham's comment in that thread). |
i thought i could simply calculate device pixels by multiplying screen.height (and width) by devicePixelRatio. however, i discovered this was not a reliable way to determine device pixels since zoom level affects devicePixelRatio and screen.height (and width) differently on the major browsers. |
@gregwfreedman I'm not sure what you mean by "zoom level", but regardless that doesn't seem to be a problem we should solve in this spec. It's either something to be taken on by CSS or it's an implementation issue in UAs. |
@jernoble I agree it's a different use-case but it's another example of video pixels and graphics pixels being different. |
@jpiesing It is another example, but one that can be addressed through an entirely different mechanism. @gregwfreedman and @mwatson2 specifically want to know the device's physical pixel dimensions so as to decide which variant to send the client; but knowing the device's physical pixel dimensions does not address your use case (whether the device is capable of downsampling UHD media to a HD display resolution). And contrariwise, the solution to your use case (knowing that a device is capable of downsampling UHD to HD) does nothing to help achieve theirs. I also wonder how a |
I think I have some clarity on this from Chrome Cast folks (can't say how well this describes smartTVs). Here's how it works on the HD cast device
@lhalliwell - sound right? |
This was discussed in today's telecon, minutes are here: https://www.w3.org/2019/10/02-mediawg-minutes.html Resolution was:
|
It participates in CSS and layout, although there are some restrictions (see notes below). chcunningham's description above is accurate enough.
That's right. The video plane lies 'beneath' the graphics plane, so in graphics buffer, This whole setup is obviously a bit yucky and not fully featured, i.e. there are things expressible on the web that are impossible to display this way (examples: rotating video at arbitrary angles, applying transparency to video with other content visible beneath, using a video as a WebGL texture). |
Thanks @lhalliwell. @jpiesing - can you say if this is more or less the same behavior on smartTVs? |
Thanks for chiming in on this issue here and on the call. While we discuss, I have removed |
@vi-dot-cpp More or less yes. |
During the call we discussed using device pixel ratio. I'm still in favor of that. Here's a link to a discussion of the tradeoffs in this comment on a separate issue. |
I'll close this, as the remaining work is in w3c/csswg-drafts#6891. Please re-open if there's anything I've missed that's not covered by that CSS issue. |
Note: I am opening this issue specifically to track the resolution of this discussion so that we don't have to dig through PR feedback to find it.
This is a quick recap of an issue on PR #124 - referincing the definition of
width
&height
with regards to utilizing CSS or device pixels. Here is the current spec text@chcunningham provided the following feedback:
@mwatson2 provided this response:
@chcunningham response
The text was updated successfully, but these errors were encountered: