Commit b70d8c27 authored by Miguel Casas-Sanchez's avatar Miguel Casas-Sanchez Committed by Commit Bot

Reland: simplify VaapiPictureFactory::Create() method and VaapiPicture members

This CL is a reland of crrev.com/c/1079834 and crrev.com/c/1086131
that got reverted (the second is just adding a few forgotten DCHECKs).
This is because  GpuArcVideoDecodeAccelerator sends empty client and
texture id vectors [0]; this CL handles gracefully these cases.

[0] https://cs.chromium.org/chromium/src/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc?l=468

original cl description ------------------------------------------------

This CL moves part of the logic of VaapiPicture creation from VaVDA to
VaapiPictureFactory, passing the PictureBuffer wholesale since we use
most of it anyway.  The net result is less lines of code.

VaapiPicture and derived classes hold on to a |texture_id_| and a
|client_texture_id_|, the latter only used with |bind_image_cb_|:
- |texture_id_| cannot be zero, either in the tests or in reality, because
  is a GL texture id; this CL enforces this via a DCHECK() in ctor. That
  simplifies the body a few methods.
- |client_texture_id_| can be zero, and is always zero in the v_d_a_unittests,
  but it doesn't matter because |bind_image_cb_| is dummy for tests ([1]),
  so there's no point of enforcing it to be non zero.  Moreover, since
  it's a client-side texture id, it can be any number, so let's skip
  the confusing checks.

Sprinkled a couple of consts and also, there's no need to do
!callback.is_null() because CallbackBase provides bool(), so
s/!callback.is_null()/callback/

[1] https://cs.chromium.org/chromium/src/media/gpu/video_decode_accelerator_unittest.cc?sq=package:chromium&dr&g=0&l=452

Bug: 822346
Test: compiled+run simplechrome, v_d_a_unittests on eve. media_unittests.
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I8b211d97e6bcb3f86149224a1c130ca6a24984e8
Reviewed-on: https://chromium-review.googlesource.com/1100535Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567293}
parent 094d9eb2
...@@ -45,8 +45,7 @@ class MEDIA_GPU_EXPORT VaapiPicture { ...@@ -45,8 +45,7 @@ class MEDIA_GPU_EXPORT VaapiPicture {
virtual bool AllowOverlay() const; virtual bool AllowOverlay() const;
// Downloads the |va_surface| into the picture, potentially scaling // Downloads |va_surface| into the picture, potentially scaling it if needed.
// it if needed.
virtual bool DownloadFromSurface( virtual bool DownloadFromSurface(
const scoped_refptr<VASurface>& va_surface) = 0; const scoped_refptr<VASurface>& va_surface) = 0;
...@@ -60,7 +59,7 @@ class MEDIA_GPU_EXPORT VaapiPicture { ...@@ -60,7 +59,7 @@ class MEDIA_GPU_EXPORT VaapiPicture {
uint32_t client_texture_id, uint32_t client_texture_id,
uint32_t texture_target); uint32_t texture_target);
scoped_refptr<VaapiWrapper> vaapi_wrapper_; const scoped_refptr<VaapiWrapper> vaapi_wrapper_;
const MakeGLContextCurrentCallback make_context_current_cb_; const MakeGLContextCurrentCallback make_context_current_cb_;
const BindGLImageCallback bind_image_cb_; const BindGLImageCallback bind_image_cb_;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "media/gpu/vaapi/vaapi_picture_factory.h" #include "media/gpu/vaapi/vaapi_picture_factory.h"
#include "media/gpu/vaapi/vaapi_wrapper.h" #include "media/gpu/vaapi/vaapi_wrapper.h"
#include "media/video/picture.h"
#include "ui/gl/gl_bindings.h" #include "ui/gl/gl_bindings.h"
#if defined(USE_X11) #if defined(USE_X11)
...@@ -43,12 +44,18 @@ std::unique_ptr<VaapiPicture> VaapiPictureFactory::Create( ...@@ -43,12 +44,18 @@ std::unique_ptr<VaapiPicture> VaapiPictureFactory::Create(
const scoped_refptr<VaapiWrapper>& vaapi_wrapper, const scoped_refptr<VaapiWrapper>& vaapi_wrapper,
const MakeGLContextCurrentCallback& make_context_current_cb, const MakeGLContextCurrentCallback& make_context_current_cb,
const BindGLImageCallback& bind_image_cb, const BindGLImageCallback& bind_image_cb,
int32_t picture_buffer_id, const PictureBuffer& picture_buffer) {
const gfx::Size& size, DCHECK_EQ(picture_buffer.texture_target(), GetGLTextureTarget());
uint32_t texture_id,
uint32_t client_texture_id, // |client_texture_ids| and |service_texture_ids| are empty from ARC++.
uint32_t texture_target) { const uint32_t client_texture_id =
DCHECK_EQ(texture_target, GetGLTextureTarget()); !picture_buffer.client_texture_ids().empty()
? picture_buffer.client_texture_ids()[0]
: 0;
const uint32_t service_texture_id =
!picture_buffer.service_texture_ids().empty()
? picture_buffer.service_texture_ids()[0]
: 0;
std::unique_ptr<VaapiPicture> picture; std::unique_ptr<VaapiPicture> picture;
...@@ -61,25 +68,24 @@ std::unique_ptr<VaapiPicture> VaapiPictureFactory::Create( ...@@ -61,25 +68,24 @@ std::unique_ptr<VaapiPicture> VaapiPictureFactory::Create(
case kVaapiImplementationDrm: case kVaapiImplementationDrm:
picture.reset(new VaapiPictureNativePixmapOzone( picture.reset(new VaapiPictureNativePixmapOzone(
vaapi_wrapper, make_context_current_cb, bind_image_cb, vaapi_wrapper, make_context_current_cb, bind_image_cb,
picture_buffer_id, size, texture_id, client_texture_id, picture_buffer.id(), picture_buffer.size(), service_texture_id,
texture_target)); client_texture_id, picture_buffer.texture_target()));
break; break;
#elif defined(USE_EGL) #elif defined(USE_EGL)
case kVaapiImplementationDrm: case kVaapiImplementationDrm:
picture.reset(new VaapiPictureNativePixmapEgl( picture.reset(new VaapiPictureNativePixmapEgl(
vaapi_wrapper, make_context_current_cb, bind_image_cb, vaapi_wrapper, make_context_current_cb, bind_image_cb,
picture_buffer_id, size, texture_id, client_texture_id, picture_buffer.id(), picture_buffer.size(), service_texture_id,
texture_target)); client_texture_id, picture_buffer.texture_target()));
break; break;
#endif #endif
#if defined(USE_X11) #if defined(USE_X11)
case kVaapiImplementationX11: case kVaapiImplementationX11:
picture.reset(new VaapiTFPPicture(vaapi_wrapper, make_context_current_cb, picture.reset(new VaapiTFPPicture(
bind_image_cb, picture_buffer_id, size, vaapi_wrapper, make_context_current_cb, bind_image_cb,
texture_id, client_texture_id, picture_buffer.id(), picture_buffer.size(), service_texture_id,
texture_target)); client_texture_id, picture_buffer.texture_target()));
break; break;
#endif // USE_X11 #endif // USE_X11
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
namespace media { namespace media {
class PictureBuffer;
class VaapiWrapper; class VaapiWrapper;
// Factory of platform dependent VaapiPictures. // Factory of platform dependent VaapiPictures.
...@@ -29,18 +30,13 @@ class MEDIA_GPU_EXPORT VaapiPictureFactory { ...@@ -29,18 +30,13 @@ class MEDIA_GPU_EXPORT VaapiPictureFactory {
VaapiPictureFactory(); VaapiPictureFactory();
virtual ~VaapiPictureFactory(); virtual ~VaapiPictureFactory();
// Creates a VaapiPicture of |size| associated with |picture_buffer_id|. If // Creates a VaapiPicture of picture_buffer.size() associated with
// provided, bind it to |texture_id|, as well as to |client_texture_id| using // picture_buffer.id().
// |bind_image_cb|.
virtual std::unique_ptr<VaapiPicture> Create( virtual std::unique_ptr<VaapiPicture> Create(
const scoped_refptr<VaapiWrapper>& vaapi_wrapper, const scoped_refptr<VaapiWrapper>& vaapi_wrapper,
const MakeGLContextCurrentCallback& make_context_current_cb, const MakeGLContextCurrentCallback& make_context_current_cb,
const BindGLImageCallback& bind_image_cb, const BindGLImageCallback& bind_image_cb,
int32_t picture_buffer_id, const PictureBuffer& picture_buffer);
const gfx::Size& size,
uint32_t texture_id,
uint32_t client_texture_id,
uint32_t texture_target);
// Return the type of the VaapiPicture implementation for the given GL // Return the type of the VaapiPicture implementation for the given GL
// implementation. // implementation.
......
...@@ -33,6 +33,8 @@ VaapiPictureNativePixmapEgl::VaapiPictureNativePixmapEgl( ...@@ -33,6 +33,8 @@ VaapiPictureNativePixmapEgl::VaapiPictureNativePixmapEgl(
client_texture_id, client_texture_id,
texture_target) { texture_target) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(texture_id);
DCHECK(client_texture_id);
} }
VaapiPictureNativePixmapEgl::~VaapiPictureNativePixmapEgl() { VaapiPictureNativePixmapEgl::~VaapiPictureNativePixmapEgl() {
...@@ -58,14 +60,12 @@ bool VaapiPictureNativePixmapEgl::Initialize() { ...@@ -58,14 +60,12 @@ bool VaapiPictureNativePixmapEgl::Initialize() {
// because the dmabuf fds have been made from it. // because the dmabuf fds have been made from it.
DCHECK(pixmap_->AreDmaBufFdsValid()); DCHECK(pixmap_->AreDmaBufFdsValid());
if (client_texture_id_ != 0 && !bind_image_cb_.is_null()) { if (bind_image_cb_ &&
if (!bind_image_cb_.Run(client_texture_id_, texture_target_, gl_image_, !bind_image_cb_.Run(client_texture_id_, texture_target_, gl_image_,
true)) { true /* can_bind_to_sampler */)) {
LOG(ERROR) << "Failed to bind client_texture_id"; LOG(ERROR) << "Failed to bind client_texture_id";
return false; return false;
}
} }
return true; return true;
} }
...@@ -73,52 +73,45 @@ bool VaapiPictureNativePixmapEgl::Allocate(gfx::BufferFormat format) { ...@@ -73,52 +73,45 @@ bool VaapiPictureNativePixmapEgl::Allocate(gfx::BufferFormat format) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Export the gl texture as dmabuf. // Export the gl texture as dmabuf.
if (texture_id_ != 0 && !make_context_current_cb_.is_null()) { if (make_context_current_cb_ && !make_context_current_cb_.Run())
if (!make_context_current_cb_.Run()) return false;
return false;
scoped_refptr<gl::GLImageNativePixmap> image(
scoped_refptr<gl::GLImageNativePixmap> image(new gl::GLImageNativePixmap( new gl::GLImageNativePixmap(size_, BufferFormatToInternalFormat(format)));
size_, BufferFormatToInternalFormat(format)));
// Create an EGLImage from a gl texture
// Create an EGLImage from a gl texture if (!image->InitializeFromTexture(texture_id_)) {
if (!image->InitializeFromTexture(texture_id_)) { DLOG(ERROR) << "Failed to initialize eglimage from texture id: "
DLOG(ERROR) << "Failed to initialize eglimage from texture id: " << texture_id_;
<< texture_id_; return false;
return false;
}
// Export the EGLImage as dmabuf.
gfx::NativePixmapHandle native_pixmap_handle = image->ExportHandle();
if (!native_pixmap_handle.planes.size()) {
DLOG(ERROR) << "Failed to export EGLImage as dmabuf fds";
return false;
}
// Convert NativePixmapHandle to NativePixmapDmaBuf.
scoped_refptr<gfx::NativePixmap> native_pixmap_dmabuf(
new gfx::NativePixmapDmaBuf(size_, format, native_pixmap_handle));
if (!native_pixmap_dmabuf->AreDmaBufFdsValid()) {
DLOG(ERROR) << "Invalid dmabuf fds";
return false;
}
if (!image->BindTexImage(texture_target_)) {
DLOG(ERROR) << "Failed to bind texture to GLImage";
return false;
}
// The |pixmap_| takes ownership of the dmabuf fds. So the only reason
// to keep a reference on the image is because the GPU service needs to
// track this image as it will be attached to a client texture.
pixmap_ = native_pixmap_dmabuf;
gl_image_ = image;
} }
if (!pixmap_) { // Export the EGLImage as dmabuf.
DVLOG(1) << "Failed allocating a pixmap"; gfx::NativePixmapHandle native_pixmap_handle = image->ExportHandle();
if (!native_pixmap_handle.planes.size()) {
DLOG(ERROR) << "Failed to export EGLImage as dmabuf fds";
return false; return false;
} }
// Convert NativePixmapHandle to NativePixmapDmaBuf.
scoped_refptr<gfx::NativePixmap> native_pixmap_dmabuf(
new gfx::NativePixmapDmaBuf(size_, format, native_pixmap_handle));
if (!native_pixmap_dmabuf->AreDmaBufFdsValid()) {
DLOG(ERROR) << "Invalid dmabuf fds";
return false;
}
if (!image->BindTexImage(texture_target_)) {
DLOG(ERROR) << "Failed to bind texture to GLImage";
return false;
}
// The |pixmap_| takes ownership of the dmabuf fds. So the only reason
// to keep a reference on the image is because the GPU service needs to
// track this image as it will be attached to a client texture.
pixmap_ = native_pixmap_dmabuf;
gl_image_ = image;
return Initialize(); return Initialize();
} }
......
...@@ -35,6 +35,9 @@ VaapiPictureNativePixmapOzone::VaapiPictureNativePixmapOzone( ...@@ -35,6 +35,9 @@ VaapiPictureNativePixmapOzone::VaapiPictureNativePixmapOzone(
client_texture_id, client_texture_id,
texture_target) { texture_target) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Either |texture_id| and |client_texture_id| are both zero, or not.
DCHECK((texture_id == 0 && client_texture_id == 0) ||
(texture_id != 0 && client_texture_id != 0));
} }
VaapiPictureNativePixmapOzone::~VaapiPictureNativePixmapOzone() { VaapiPictureNativePixmapOzone::~VaapiPictureNativePixmapOzone() {
...@@ -56,34 +59,35 @@ bool VaapiPictureNativePixmapOzone::Initialize() { ...@@ -56,34 +59,35 @@ bool VaapiPictureNativePixmapOzone::Initialize() {
return false; return false;
} }
// ARC++ has no texture ids.
if (texture_id_ == 0 && client_texture_id_ == 0)
return true;
// Import dmabuf fds into the output gl texture through EGLImage. // Import dmabuf fds into the output gl texture through EGLImage.
if (texture_id_ != 0 && !make_context_current_cb_.is_null()) { if (make_context_current_cb_ && !make_context_current_cb_.Run())
if (!make_context_current_cb_.Run()) return false;
return false;
gl::ScopedTextureBinder texture_binder(texture_target_, texture_id_);
gl::ScopedTextureBinder texture_binder(texture_target_, texture_id_);
const gfx::BufferFormat format = pixmap_->GetBufferFormat();
gfx::BufferFormat format = pixmap_->GetBufferFormat();
scoped_refptr<gl::GLImageNativePixmap> image(
scoped_refptr<gl::GLImageNativePixmap> image(new gl::GLImageNativePixmap( new gl::GLImageNativePixmap(size_, BufferFormatToInternalFormat(format)));
size_, BufferFormatToInternalFormat(format))); if (!image->Initialize(pixmap_.get(), format)) {
if (!image->Initialize(pixmap_.get(), format)) { LOG(ERROR) << "Failed to create GLImage";
LOG(ERROR) << "Failed to create GLImage"; return false;
return false; }
} gl_image_ = image;
gl_image_ = image; if (!gl_image_->BindTexImage(texture_target_)) {
if (!gl_image_->BindTexImage(texture_target_)) { LOG(ERROR) << "Failed to bind texture to GLImage";
LOG(ERROR) << "Failed to bind texture to GLImage"; return false;
return false;
}
} }
if (client_texture_id_ != 0 && !bind_image_cb_.is_null()) { if (bind_image_cb_ &&
if (!bind_image_cb_.Run(client_texture_id_, texture_target_, gl_image_, !bind_image_cb_.Run(client_texture_id_, texture_target_, gl_image_,
true)) { true /* can_bind_to_sampler */)) {
LOG(ERROR) << "Failed to bind client_texture_id"; LOG(ERROR) << "Failed to bind client_texture_id";
return false; return false;
}
} }
return true; return true;
...@@ -98,7 +102,7 @@ bool VaapiPictureNativePixmapOzone::Allocate(gfx::BufferFormat format) { ...@@ -98,7 +102,7 @@ bool VaapiPictureNativePixmapOzone::Allocate(gfx::BufferFormat format) {
factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size_, format, factory->CreateNativePixmap(gfx::kNullAcceleratedWidget, size_, format,
gfx::BufferUsage::SCANOUT_VDA_WRITE); gfx::BufferUsage::SCANOUT_VDA_WRITE);
if (!pixmap_) { if (!pixmap_) {
DVLOG(1) << "Failed allocating a pixmap"; LOG(ERROR) << "Failed allocating a pixmap";
return false; return false;
} }
...@@ -118,7 +122,7 @@ bool VaapiPictureNativePixmapOzone::ImportGpuMemoryBufferHandle( ...@@ -118,7 +122,7 @@ bool VaapiPictureNativePixmapOzone::ImportGpuMemoryBufferHandle(
gpu_memory_buffer_handle.native_pixmap_handle); gpu_memory_buffer_handle.native_pixmap_handle);
if (!pixmap_) { if (!pixmap_) {
DVLOG(1) << "Failed creating a pixmap from a native handle"; LOG(ERROR) << "Failed creating a pixmap from a native handle";
return false; return false;
} }
......
...@@ -33,6 +33,8 @@ VaapiTFPPicture::VaapiTFPPicture( ...@@ -33,6 +33,8 @@ VaapiTFPPicture::VaapiTFPPicture(
x_display_(gfx::GetXDisplay()), x_display_(gfx::GetXDisplay()),
x_pixmap_(0) { x_pixmap_(0) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(texture_id);
DCHECK(client_texture_id);
} }
VaapiTFPPicture::~VaapiTFPPicture() { VaapiTFPPicture::~VaapiTFPPicture() {
...@@ -50,22 +52,20 @@ bool VaapiTFPPicture::Initialize() { ...@@ -50,22 +52,20 @@ bool VaapiTFPPicture::Initialize() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(x_pixmap_); DCHECK(x_pixmap_);
if (texture_id_ != 0 && !make_context_current_cb_.is_null()) { if (make_context_current_cb_ && !make_context_current_cb_.Run())
if (!make_context_current_cb_.Run()) return false;
return false;
glx_image_ = new gl::GLImageGLX(size_, GL_RGB);
glx_image_ = new gl::GLImageGLX(size_, GL_RGB); if (!glx_image_->Initialize(x_pixmap_)) {
if (!glx_image_->Initialize(x_pixmap_)) { // x_pixmap_ will be freed in the destructor.
// x_pixmap_ will be freed in the destructor. DLOG(ERROR) << "Failed creating a GLX Pixmap for TFP";
DLOG(ERROR) << "Failed creating a GLX Pixmap for TFP"; return false;
return false; }
}
gl::ScopedTextureBinder texture_binder(texture_target_, texture_id_);
gl::ScopedTextureBinder texture_binder(texture_target_, texture_id_); if (!glx_image_->BindTexImage(texture_target_)) {
if (!glx_image_->BindTexImage(texture_target_)) { DLOG(ERROR) << "Failed to bind texture to glx image";
DLOG(ERROR) << "Failed to bind texture to glx image"; return false;
return false;
}
} }
return true; return true;
......
...@@ -588,22 +588,12 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers( ...@@ -588,22 +588,12 @@ void VaapiVideoDecodeAccelerator::AssignPictureBuffers(
DCHECK_EQ(va_surface_ids.size(), buffers.size()); DCHECK_EQ(va_surface_ids.size(), buffers.size());
for (size_t i = 0; i < buffers.size(); ++i) { for (size_t i = 0; i < buffers.size(); ++i) {
uint32_t client_id = !buffers[i].client_texture_ids().empty() DCHECK(requested_pic_size_ == buffers[i].size());
? buffers[i].client_texture_ids()[0]
: 0;
uint32_t service_id = !buffers[i].service_texture_ids().empty()
? buffers[i].service_texture_ids()[0]
: 0;
DCHECK_EQ(buffers[i].texture_target(),
vaapi_picture_factory_->GetGLTextureTarget());
std::unique_ptr<VaapiPicture> picture(vaapi_picture_factory_->Create( std::unique_ptr<VaapiPicture> picture(vaapi_picture_factory_->Create(
vaapi_wrapper_, make_context_current_cb_, bind_image_cb_, vaapi_wrapper_, make_context_current_cb_, bind_image_cb_, buffers[i]));
buffers[i].id(), requested_pic_size_, service_id, client_id, RETURN_AND_NOTIFY_ON_FAILURE(picture, "Failed creating a VaapiPicture",
buffers[i].texture_target())); PLATFORM_FAILURE, );
RETURN_AND_NOTIFY_ON_FAILURE(
picture.get(), "Failed creating a VaapiPicture", PLATFORM_FAILURE, );
if (output_mode_ == Config::OutputMode::ALLOCATE) { if (output_mode_ == Config::OutputMode::ALLOCATE) {
RETURN_AND_NOTIFY_ON_FAILURE( RETURN_AND_NOTIFY_ON_FAILURE(
......
...@@ -116,15 +116,14 @@ class MockVaapiPictureFactory : public VaapiPictureFactory { ...@@ -116,15 +116,14 @@ class MockVaapiPictureFactory : public VaapiPictureFactory {
const scoped_refptr<VaapiWrapper>& vaapi_wrapper, const scoped_refptr<VaapiWrapper>& vaapi_wrapper,
const MakeGLContextCurrentCallback& make_context_current_cb, const MakeGLContextCurrentCallback& make_context_current_cb,
const BindGLImageCallback& bind_image_cb, const BindGLImageCallback& bind_image_cb,
int32_t picture_buffer_id, const PictureBuffer& picture_buffer) override {
const gfx::Size& size, const uint32_t service_texture_id = picture_buffer.service_texture_ids()[0];
uint32_t texture_id, const uint32_t client_texture_id = picture_buffer.client_texture_ids()[0];
uint32_t client_texture_id, MockCreateVaapiPicture(vaapi_wrapper.get(), picture_buffer.size());
uint32_t texture_target) override {
MockCreateVaapiPicture(vaapi_wrapper.get(), size);
return std::make_unique<MockVaapiPicture>( return std::make_unique<MockVaapiPicture>(
vaapi_wrapper, make_context_current_cb, bind_image_cb, vaapi_wrapper, make_context_current_cb, bind_image_cb,
picture_buffer_id, size, texture_id, client_texture_id, texture_target); picture_buffer.id(), picture_buffer.size(), service_texture_id,
client_texture_id, picture_buffer.texture_target());
} }
}; };
......
...@@ -528,14 +528,15 @@ void GLRenderingVDAClient::ProvidePictureBuffers( ...@@ -528,14 +528,15 @@ void GLRenderingVDAClient::ProvidePictureBuffers(
LOG_ASSERT(texture_ref); LOG_ASSERT(texture_ref);
int32_t picture_buffer_id = next_picture_buffer_id_++; int32_t picture_buffer_id = next_picture_buffer_id_++;
int irrelevant_id = picture_buffer_id;
LOG_ASSERT( LOG_ASSERT(
active_textures_.insert(std::make_pair(picture_buffer_id, texture_ref)) active_textures_.insert(std::make_pair(picture_buffer_id, texture_ref))
.second); .second);
PictureBuffer::TextureIds texture_ids(1, texture_id); PictureBuffer::TextureIds texture_ids(1, texture_id);
buffers.push_back(PictureBuffer(picture_buffer_id, dimensions, buffers.push_back(PictureBuffer(picture_buffer_id, dimensions,
PictureBuffer::TextureIds(), texture_ids, PictureBuffer::TextureIds{irrelevant_id++},
texture_target, pixel_format)); texture_ids, texture_target, pixel_format));
} }
decoder_->AssignPictureBuffers(buffers); decoder_->AssignPictureBuffers(buffers);
......
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