mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
feat: import shared texture supports p010le (#49272)
feat: import shared texture supports p010le.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* `rgba` - 32bpp RGBA (byte-order), 1 plane.
|
||||
* `rgbaf16` - Half float RGBA, 1 plane.
|
||||
* `nv12` - 12bpp with Y plane followed by a 2x2 interleaved UV plane.
|
||||
* `p010le` - 4:2:0 10-bit YUV (little-endian), Y plane followed by a 2x2 interleaved UV plane.
|
||||
* `colorSpace` [ColorSpace](color-space.md) (optional) - The color space of the texture.
|
||||
* `codedSize` [Size](size.md) - The full dimensions of the shared texture.
|
||||
* `visibleRect` [Rectangle](rectangle.md) (optional) - A subsection of [0, 0, codedSize.width, codedSize.height]. In common cases, it is the full section area.
|
||||
|
||||
@@ -127,6 +127,8 @@ std::string TransferVideoPixelFormatToString(media::VideoPixelFormat format) {
|
||||
return "rgbaf16";
|
||||
case media::PIXEL_FORMAT_NV12:
|
||||
return "nv12";
|
||||
case media::PIXEL_FORMAT_P010LE:
|
||||
return "p010le";
|
||||
default:
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -569,6 +571,8 @@ struct Converter<ImportSharedTextureInfo> {
|
||||
out->pixel_format = media::PIXEL_FORMAT_RGBAF16;
|
||||
else if (pixel_format_str == "nv12")
|
||||
out->pixel_format = media::PIXEL_FORMAT_NV12;
|
||||
else if (pixel_format_str == "p010le")
|
||||
out->pixel_format = media::PIXEL_FORMAT_P010LE;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user