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

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: a1d2f2c4 Bitrate settings. Created 7 years, 6 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/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();
}

Powered by Google App Engine
This is Rietveld 408576698