feat: import shared texture supports nv16

This commit is contained in:
David Franco
2026-04-06 11:42:04 +02:00
parent 903e65e048
commit d82ef8752c
2 changed files with 5 additions and 0 deletions

View File

@@ -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.
* `nv16` - 16bpp with Y plane followed by a 2x1 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.

View File

@@ -127,6 +127,8 @@ std::string TransferVideoPixelFormatToString(media::VideoPixelFormat format) {
return "rgbaf16";
case media::PIXEL_FORMAT_NV12:
return "nv12";
case media::PIXEL_FORMAT_NV16:
return "nv16";
case media::PIXEL_FORMAT_P010LE:
return "p010le";
default:
@@ -577,6 +579,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 == "nv16")
out->pixel_format = media::PIXEL_FORMAT_NV16;
else if (pixel_format_str == "p010le")
out->pixel_format = media::PIXEL_FORMAT_P010LE;
else