Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Unified Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 858653002: vaapi plumbing to allow hardware video overlays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change bool to virtual fn Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/gpu_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index 9ef0a537f2b9e63ac72cea9b39f80adf50e9e1e6..ea0574e59f48ae4c72b9e59261a3625ac6bcd3e4 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -22,6 +22,7 @@
#include "ipc/message_filter.h"
#include "media/base/limits.h"
#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_image.h"
#include "ui/gl/gl_surface_egl.h"
#if defined(OS_WIN)
@@ -337,11 +338,24 @@ GpuVideoDecodeAccelerator::CreateV4L2SliceVDA() {
return decoder.Pass();
}
+void GpuVideoDecodeAccelerator::BindImage(uint32 client_texture_id,
+ uint32 texture_target,
+ scoped_refptr<gfx::GLImage> image) {
+ gpu::gles2::GLES2Decoder* command_decoder = stub_->decoder();
+ gpu::gles2::TextureManager* texture_manager =
+ command_decoder->GetContextGroup()->texture_manager();
+ gpu::gles2::TextureRef* ref = texture_manager->GetTexture(client_texture_id);
+ if (ref)
+ texture_manager->SetLevelImage(ref, texture_target, 0, image.get());
+}
+
scoped_ptr<media::VideoDecodeAccelerator>
GpuVideoDecodeAccelerator::CreateVaapiVDA() {
scoped_ptr<media::VideoDecodeAccelerator> decoder;
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
- decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_));
+ decoder.reset(new VaapiVideoDecodeAccelerator(
+ make_context_current_, base::Bind(&GpuVideoDecodeAccelerator::BindImage,
+ base::Unretained(this))));
#endif
return decoder.Pass();
}
@@ -468,15 +482,9 @@ void GpuVideoDecodeAccelerator::OnAssignPictureBuffers(
width, height, 1, 0, format, 0, false);
}
}
- uint32 service_texture_id;
- if (!command_decoder->GetServiceTextureId(
- texture_ids[i], &service_texture_id)) {
- DLOG(ERROR) << "Failed to translate texture!";
- NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
- return;
- }
- buffers.push_back(media::PictureBuffer(
- buffer_ids[i], texture_dimensions_, service_texture_id));
+ buffers.push_back(media::PictureBuffer(buffer_ids[i], texture_dimensions_,
+ texture_ref->service_id(),
+ texture_ids[i]));
textures.push_back(texture_ref);
}
video_decode_accelerator_->AssignPictureBuffers(buffers);

Powered by Google App Engine
This is Rietveld 408576698