Chromium Code Reviews| Index: media/gpu/ipc/service/gpu_video_decode_accelerator.cc |
| diff --git a/media/gpu/ipc/service/gpu_video_decode_accelerator.cc b/media/gpu/ipc/service/gpu_video_decode_accelerator.cc |
| index d26f19a0a213f255ce594dda26d0346e1947ff0d..8b10132f4dcd89b1b3d58c3d1e8ca1b6b52776a5 100644 |
| --- a/media/gpu/ipc/service/gpu_video_decode_accelerator.cc |
| +++ b/media/gpu/ipc/service/gpu_video_decode_accelerator.cc |
| @@ -161,7 +161,6 @@ GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator( |
| const AndroidOverlayMojoFactoryCB& overlay_factory_cb) |
| : host_route_id_(host_route_id), |
| stub_(stub), |
| - texture_target_(0), |
| textures_per_buffer_(0), |
| filter_removed_(base::WaitableEvent::ResetPolicy::MANUAL, |
| base::WaitableEvent::InitialState::NOT_SIGNALED), |
| @@ -241,9 +240,7 @@ void GpuVideoDecodeAccelerator::ProvidePictureBuffers( |
| DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ProvidePictureBuffers) " |
| << "failed"; |
| } |
| - texture_dimensions_ = dimensions; |
| textures_per_buffer_ = textures_per_buffer; |
| - texture_target_ = texture_target; |
| } |
| void GpuVideoDecodeAccelerator::DismissPictureBuffer( |
| @@ -402,7 +399,10 @@ void GpuVideoDecodeAccelerator::OnDecode( |
| void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
| const std::vector<int32_t>& buffer_ids, |
| - const std::vector<PictureBuffer::TextureIds>& texture_ids) { |
| + const std::vector<PictureBuffer::TextureIds>& texture_ids, |
| + uint32_t texture_target, |
| + VideoPixelFormat format, |
| + const gfx::Size& dimensions) { |
| if (buffer_ids.size() != texture_ids.size()) { |
| NotifyError(VideoDecodeAccelerator::INVALID_ARGUMENT); |
| return; |
| @@ -439,27 +439,25 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
| return; |
| } |
| gpu::gles2::Texture* info = texture_ref->texture(); |
| - if (info->target() != texture_target_) { |
| + if (info->target() != texture_target) { |
| DLOG(ERROR) << "Texture target mismatch for texture id " |
| << buffer_texture_ids[j]; |
| NotifyError(VideoDecodeAccelerator::INVALID_ARGUMENT); |
| return; |
| } |
| - if (texture_target_ == GL_TEXTURE_EXTERNAL_OES || |
| - texture_target_ == GL_TEXTURE_RECTANGLE_ARB) { |
| + if (texture_target == GL_TEXTURE_EXTERNAL_OES || |
| + texture_target == GL_TEXTURE_RECTANGLE_ARB) { |
| // These textures have their dimensions defined by the underlying |
| // storage. |
| - // Use |texture_dimensions_| for this size. |
| - texture_manager->SetLevelInfo(texture_ref, texture_target_, 0, GL_RGBA, |
| - texture_dimensions_.width(), |
| - texture_dimensions_.height(), 1, 0, |
| - GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect()); |
| + // Use |dimensions| for this size. |
| + texture_manager->SetLevelInfo( |
| + texture_ref, texture_target, 0, GL_RGBA, dimensions.width(), |
| + dimensions.height(), 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, gfx::Rect()); |
| } else { |
| // For other targets, texture dimensions should already be defined. |
| GLsizei width = 0, height = 0; |
| - info->GetLevelSize(texture_target_, 0, &width, &height, nullptr); |
| - if (width != texture_dimensions_.width() || |
| - height != texture_dimensions_.height()) { |
| + info->GetLevelSize(texture_target, 0, &width, &height, nullptr); |
| + if (width != dimensions.width() || height != dimensions.height()) { |
| DLOG(ERROR) << "Size mismatch for texture id " |
| << buffer_texture_ids[j]; |
| NotifyError(VideoDecodeAccelerator::INVALID_ARGUMENT); |
| @@ -471,7 +469,7 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
| video_decode_accelerator_.get()->GetSurfaceInternalFormat(); |
| if (format != GL_RGBA) { |
| DCHECK(format == GL_BGRA_EXT); |
| - texture_manager->SetLevelInfo(texture_ref, texture_target_, 0, format, |
| + texture_manager->SetLevelInfo(texture_ref, texture_target, 0, format, |
| width, height, 1, 0, format, |
| GL_UNSIGNED_BYTE, gfx::Rect()); |
| } |
| @@ -480,7 +478,7 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
| current_textures.push_back(texture_ref); |
| } |
| textures.push_back(current_textures); |
| - buffers.push_back(PictureBuffer(buffer_ids[i], texture_dimensions_, |
| + buffers.push_back(PictureBuffer(buffer_ids[i], dimensions, |
|
liberato (no reviews please)
2017/05/16 17:25:24
i think that this should pass in |texture_target|
Chandan
2017/05/17 12:07:06
Done.
|
| buffer_texture_ids, service_ids)); |
| } |
| { |