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

Unified Diff: content/common/gpu/gl_surface_encoder.cc

Issue 16693005: Add ExynosVideoEncodeAccelerator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screencast_cl_5
Patch Set: b673f1a3 WIP - for posciak@ Created 7 years, 5 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
« no previous file with comments | « no previous file | content/common/gpu/media/exynos_video_encode_accelerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gl_surface_encoder.cc
diff --git a/content/common/gpu/gl_surface_encoder.cc b/content/common/gpu/gl_surface_encoder.cc
index efa717f743a5426c4f4455eb6763a1abc329850e..ea0cad1e9f26e1a05c75afd723edc9dacd82a5b8 100644
--- a/content/common/gpu/gl_surface_encoder.cc
+++ b/content/common/gpu/gl_surface_encoder.cc
@@ -12,14 +12,30 @@
#include "media/base/video_frame.h"
#include "ui/gl/gl_surface.h"
+#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+#include "content/common/gpu/media/exynos_video_encode_accelerator.h"
+#include "ui/gl/gl_surface_egl.h"
+#endif
+
namespace content {
-namespace {
+static bool MakeEncoderContextCurrent(
+ const base::WeakPtr<GpuCommandBufferStub> stub) {
+ if (!stub) {
+ DLOG(ERROR) << "Stub is gone; won't MakeCurrent().";
+ return false;
+ }
-void DoNothingWithSurface(gfx::GLSurface* surface) {
+ if (!stub->decoder()->MakeCurrent()) {
+ DLOG(ERROR) << "Failed to MakeCurrent()";
+ return false;
+ }
+
+ return true;
}
-} // anonymous namespace
+static void DoNothingWithSurface(gfx::GLSurface* surface) {
+}
GLSurfaceEncoder::GLSurfaceEncoder(int32 host_route_id,
GpuCommandBufferStub* stub)
@@ -117,7 +133,17 @@ scoped_ptr<media::VideoEncodeAccelerator> GLSurfaceEncoder::CreateEncoder(
media::VideoEncodeAccelerator::Client* client) {
scoped_ptr<media::VideoEncodeAccelerator> encoder;
- // TODO(sheu): actually create an encoder.
+ base::Callback<bool(void)> make_current =
+ base::Bind(&MakeEncoderContextCurrent, stub->AsWeakPtr());
+
+#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
+ encoder.reset(new ExynosVideoEncodeAccelerator(
+ gfx::GLSurfaceEGL::GetHardwareDisplay(),
+ client,
+ make_current,
+ true));
+#endif
+
return encoder.Pass();
}
« no previous file with comments | « no previous file | content/common/gpu/media/exynos_video_encode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698