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..08b18e92165c47a60e44a65cfacb77f0c91a88d7 100644 |
--- a/content/common/gpu/gl_surface_encoder.cc |
+++ b/content/common/gpu/gl_surface_encoder.cc |
@@ -12,10 +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 { |
+bool MakeEncoderContextCurrent( |
+ const base::WeakPtr<GpuCommandBufferStub> stub) { |
+ if (!stub) { |
+ DLOG(ERROR) << "Stub is gone; won't MakeCurrent()."; |
+ return false; |
+ } |
+ |
+ if (!stub->decoder()->MakeCurrent()) { |
+ DLOG(ERROR) << "Failed to MakeCurrent()"; |
+ return false; |
+ } |
+ |
+ return true; |
+} |
+ |
void DoNothingWithSurface(gfx::GLSurface* surface) { |
} |
@@ -117,7 +137,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(), |
Ami GONE FROM CHROMIUM
2013/06/18 01:09:25
Any reason not to do this in the EVDA ctor itself?
|
+ client, |
+ make_current, |
+ true)); |
+#endif |
+ |
return encoder.Pass(); |
} |