Commit a8670edf authored by Dongseong Hwang's avatar Dongseong Hwang Committed by Commit Bot

chromeos: decode video into NV12 format on Intel

We now have support for NV12 overlays on all platforms where we have
atomic KMS. That means that we can always pick NV12 as the format to
decode to as it's the most efficient format for scanout and GPU
compositing.  Before we had NV12 overlays, decoding to RGB was a
better choice since that let us use an overlay, which was an overall
win.

Delete unit test PictureBufferFormat, since that's an unhelpful
change-detector test.

Bug: 813250
Change-Id: Ib6cb1cd2275693d9da04cd428081282cc1031be1
Reviewed-on: https://chromium-review.googlesource.com/950007
Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544226}
parent bb4fdab0
......@@ -106,7 +106,7 @@ uint32_t VaapiPictureFactory::GetGLTextureTarget() {
gfx::BufferFormat VaapiPictureFactory::GetBufferFormat() {
#if defined(USE_OZONE)
return gfx::BufferFormat::BGRX_8888;
return gfx::BufferFormat::YUV_420_BIPLANAR;
#else
return gfx::BufferFormat::RGBX_8888;
#endif
......
......@@ -59,6 +59,9 @@ unsigned VaapiPictureNativePixmap::BufferFormatToInternalFormat(
case gfx::BufferFormat::YVU_420:
return GL_RGB_YCRCB_420_CHROMIUM;
case gfx::BufferFormat::YUV_420_BIPLANAR:
return GL_RGB_YCBCR_420V_CHROMIUM;
default:
NOTREACHED() << gfx::BufferFormatToString(format);
return GL_BGRA_EXT;
......
......@@ -94,9 +94,9 @@ bool VaapiPictureNativePixmapOzone::Allocate(gfx::BufferFormat format) {
ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance();
ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone();
pixmap_ = factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size_,
format, gfx::BufferUsage::SCANOUT);
pixmap_ =
factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size_, format,
gfx::BufferUsage::SCANOUT_VDA_WRITE);
if (!pixmap_) {
DVLOG(1) << "Failed allocating a pixmap";
return false;
......
......@@ -349,19 +349,6 @@ TEST_P(VaapiVideoDecodeAcceleratorTest, SupportedPlatforms) {
#endif
}
// Verifies the expected buffer format.
TEST_P(VaapiVideoDecodeAcceleratorTest, PictureBufferFormat) {
gfx::BufferFormat format = mock_vaapi_picture_factory_->GetBufferFormat();
#if defined(USE_OZONE)
EXPECT_EQ(gfx::BufferFormat::BGRX_8888, format);
#else
EXPECT_EQ(gfx::BufferFormat::RGBX_8888, format);
#endif // USE_OZONE
EXPECT_EQ(PIXEL_FORMAT_XRGB, GfxBufferFormatToVideoPixelFormat(format));
}
INSTANTIATE_TEST_CASE_P(/* No prefix. */,
VaapiVideoDecodeAcceleratorTest,
ValuesIn(kCodecProfiles));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment