X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fozone%2Fmedia%2Fvaapi_video_decode_accelerator.cc;h=3c5ac594c9f4e9393c049f101a065c93a1923782;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=6d95db2241e03bf9887bf40d3540db85a94e991b;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/ozone/media/vaapi_video_decode_accelerator.cc b/src/ozone/media/vaapi_video_decode_accelerator.cc index 6d95db2..3c5ac59 100644 --- a/src/ozone/media/vaapi_video_decode_accelerator.cc +++ b/src/ozone/media/vaapi_video_decode_accelerator.cc @@ -186,6 +186,21 @@ bool VaapiVideoDecodeAccelerator::TFPPicture::Upload(VASurfaceID surface) { gfx::ScopedTextureBinder texture_binder(GL_TEXTURE_2D, texture_id_); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + + // See bug https://crosswalk-project.org/jira/browse/XWALK-2265. + // The following small piece of code is a workaround for the current VDA + // texture output implementation. It can be removed when zero buffer copy + // is implemented. + unsigned int al = 4 * size_.width(); + if (al != va_image_.pitches[0]) { + // Not aligned phenomenon occurs only in special size video in None-X11. + // So re-check RGBA data alignment and realign filled video frame in need. + unsigned char* bhandle = static_cast(buffer); + for (int i = 0; i < size_.height(); i++) { + memcpy(bhandle + (i * al), bhandle + (i * (va_image_.pitches[0])), al); + } + } + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size_.width(), size_.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer); @@ -244,7 +259,7 @@ bool VaapiVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, vaapi_wrapper_ = VaapiWrapper::Create( profile, - gfx::GetPlatformDefaultEGLNativeDisplay(), + gfx::GLSurfaceEGL::GetNativeDisplay(), base::Bind(&ReportToUMA, VaapiH264Decoder::VAAPI_ERROR)); if (!vaapi_wrapper_.get()) {