Chromium Code Reviews| Index: media/gpu/dxva_video_decode_accelerator_win.cc |
| diff --git a/media/gpu/dxva_video_decode_accelerator_win.cc b/media/gpu/dxva_video_decode_accelerator_win.cc |
| index e368dd35728060fa7d46dd57dc67eb3a6809b59f..e4d19eb248f4d5fdb813d6a1c56bf55fa54aac69 100644 |
| --- a/media/gpu/dxva_video_decode_accelerator_win.cc |
| +++ b/media/gpu/dxva_video_decode_accelerator_win.cc |
| @@ -486,6 +486,7 @@ DXVAVideoDecodeAccelerator::PendingSampleInfo::~PendingSampleInfo() {} |
| DXVAVideoDecodeAccelerator::DXVAVideoDecodeAccelerator( |
| const GetGLContextCallback& get_gl_context_cb, |
| const MakeGLContextCurrentCallback& make_context_current_cb, |
| + const BindGLImageCallback& bind_image_cb, |
| const gpu::GpuDriverBugWorkarounds& workarounds, |
| const gpu::GpuPreferences& gpu_preferences) |
| : client_(NULL), |
| @@ -498,6 +499,7 @@ DXVAVideoDecodeAccelerator::DXVAVideoDecodeAccelerator( |
| sent_drain_message_(false), |
| get_gl_context_cb_(get_gl_context_cb), |
| make_context_current_cb_(make_context_current_cb), |
| + bind_image_cb_(bind_image_cb), |
| codec_(kUnknownVideoCodec), |
| decoder_thread_("DXVAVideoDecoderThread"), |
| pending_flush_(false), |
| @@ -885,6 +887,12 @@ void DXVAVideoDecodeAccelerator::AssignPictureBuffers( |
| RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer.get(), |
| "Failed to allocate picture buffer", |
| PLATFORM_FAILURE, ); |
| + if (bind_image_cb_) { |
| + for (uint32_t client_id : buffers[buffer_index].client_texture_ids()) { |
|
sandersd (OOO until July 31)
2016/11/15 01:40:06
For people like myself that rarely work with BOUND
|
| + bind_image_cb_.Run(client_id, GetTextureTarget(), |
| + picture_buffer->gl_image(), true); |
| + } |
| + } |
| bool inserted = |
| output_picture_buffers_ |
| @@ -1936,7 +1944,7 @@ void DXVAVideoDecodeAccelerator::RequestPictureBuffers(int width, int height) { |
| kNumPictureBuffers, |
| provide_nv12_textures ? PIXEL_FORMAT_NV12 : PIXEL_FORMAT_UNKNOWN, |
| provide_nv12_textures ? 2 : 1, gfx::Size(width, height), |
| - provide_nv12_textures ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D); |
| + GetTextureTarget()); |
| } |
| } |
| @@ -2749,4 +2757,9 @@ void DXVAVideoDecodeAccelerator::ConfigChanged(const Config& config) { |
| base::Unretained(this))); |
| } |
| +uint32_t DXVAVideoDecodeAccelerator::GetTextureTarget() const { |
| + bool provide_nv12_textures = share_nv12_textures_ || copy_nv12_textures_; |
| + return provide_nv12_textures ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D; |
| +} |
| + |
| } // namespace media |