summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorposciak@chromium.org <posciak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-18 04:29:30 +0000
committerposciak@chromium.org <posciak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-18 04:29:30 +0000
commit3d0f4832578ce54f12f188a1055584c19c9f5641 (patch)
tree46cd760765b42c076a2e5a106b9940535bba060c /content
parent1e6ef6c000c406a2c7980bd527068a18327a808e (diff)
downloadchromium_src-3d0f4832578ce54f12f188a1055584c19c9f5641.zip
chromium_src-3d0f4832578ce54f12f188a1055584c19c9f5641.tar.gz
chromium_src-3d0f4832578ce54f12f188a1055584c19c9f5641.tar.bz2
Remove GL context parameters from {E,VA}VDA.
gl{x}_context is not directly used in {E,VA}VDA anymore, so remove it. The classes will call make_context_current_ callbacks when a valid context is required and error out if it fails. BUG=None TEST=build, video playback Review URL: https://codereview.chromium.org/109983003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/gpu/media/exynos_video_decode_accelerator.cc8
-rw-r--r--content/common/gpu/media/exynos_video_decode_accelerator.h2
-rw-r--r--content/common/gpu/media/gpu_video_decode_accelerator.cc6
-rw-r--r--content/common/gpu/media/rendering_helper.cc4
-rw-r--r--content/common/gpu/media/rendering_helper.h3
-rw-r--r--content/common/gpu/media/vaapi_video_decode_accelerator.cc3
-rw-r--r--content/common/gpu/media/vaapi_video_decode_accelerator.h3
-rw-r--r--content/common/gpu/media/video_decode_accelerator_unittest.cc2
8 files changed, 3 insertions, 28 deletions
diff --git a/content/common/gpu/media/exynos_video_decode_accelerator.cc b/content/common/gpu/media/exynos_video_decode_accelerator.cc
index b74d4d2..95c875d 100644
--- a/content/common/gpu/media/exynos_video_decode_accelerator.cc
+++ b/content/common/gpu/media/exynos_video_decode_accelerator.cc
@@ -180,7 +180,6 @@ ExynosVideoDecodeAccelerator::PictureRecord::~PictureRecord() {}
ExynosVideoDecodeAccelerator::ExynosVideoDecodeAccelerator(
EGLDisplay egl_display,
- EGLContext egl_context,
Client* client,
const base::WeakPtr<Client>& io_client,
const base::Callback<bool(void)>& make_context_current,
@@ -213,7 +212,6 @@ ExynosVideoDecodeAccelerator::ExynosVideoDecodeAccelerator(
device_poll_interrupt_fd_(-1),
make_context_current_(make_context_current),
egl_display_(egl_display),
- egl_context_(egl_context),
video_profile_(media::VIDEO_CODEC_PROFILE_UNKNOWN) {}
ExynosVideoDecodeAccelerator::~ExynosVideoDecodeAccelerator() {
@@ -268,12 +266,6 @@ bool ExynosVideoDecodeAccelerator::Initialize(
return false;
}
- if (egl_context_ == EGL_NO_CONTEXT) {
- DLOG(ERROR) << "Initialize(): could not get EGLContext";
- NOTIFY_ERROR(PLATFORM_FAILURE);
- return false;
- }
-
// We need the context to be initialized to query extensions.
if (!make_context_current_.Run()) {
DLOG(ERROR) << "Initialize(): could not make context current";
diff --git a/content/common/gpu/media/exynos_video_decode_accelerator.h b/content/common/gpu/media/exynos_video_decode_accelerator.h
index 7ccd594..52ae989 100644
--- a/content/common/gpu/media/exynos_video_decode_accelerator.h
+++ b/content/common/gpu/media/exynos_video_decode_accelerator.h
@@ -61,7 +61,6 @@ class CONTENT_EXPORT ExynosVideoDecodeAccelerator
public:
ExynosVideoDecodeAccelerator(
EGLDisplay egl_display,
- EGLContext egl_context,
Client* client,
const base::WeakPtr<Client>& io_client_,
const base::Callback<bool(void)>& make_context_current,
@@ -416,7 +415,6 @@ class CONTENT_EXPORT ExynosVideoDecodeAccelerator
// EGL state
EGLDisplay egl_display_;
- EGLContext egl_context_;
// The codec we'll be decoding for.
media::VideoCodecProfile video_profile_;
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index b932258..3a86c48 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -273,7 +273,6 @@ void GpuVideoDecodeAccelerator::Initialize(
#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
video_decode_accelerator_.reset(new ExynosVideoDecodeAccelerator(
gfx::GLSurfaceEGL::GetHardwareDisplay(),
- stub_->decoder()->GetGLContext()->GetHandle(),
this,
weak_factory_for_io_.GetWeakPtr(),
make_context_current_,
@@ -281,11 +280,8 @@ void GpuVideoDecodeAccelerator::Initialize(
#elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11)
gfx::GLContextGLX* glx_context =
static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext());
- GLXContext glx_context_handle =
- static_cast<GLXContext>(glx_context->GetHandle());
video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator(
- glx_context->display(), glx_context_handle, this,
- make_context_current_));
+ glx_context->display(), this, make_context_current_));
#elif defined(OS_ANDROID)
video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator(
this,
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc
index c18cffc..04a3c05 100644
--- a/content/common/gpu/media/rendering_helper.cc
+++ b/content/common/gpu/media/rendering_helper.cc
@@ -517,10 +517,6 @@ void RenderingHelper::DeleteTexture(uint32 texture_id) {
CHECK_EQ(static_cast<int>(glGetError()), GL_NO_ERROR);
}
-void* RenderingHelper::GetGLContext() {
- return gl_context_;
-}
-
void* RenderingHelper::GetGLDisplay() {
#if GL_VARIANT_GLX
return x_display_;
diff --git a/content/common/gpu/media/rendering_helper.h b/content/common/gpu/media/rendering_helper.h
index 7890b53..081d0ba 100644
--- a/content/common/gpu/media/rendering_helper.h
+++ b/content/common/gpu/media/rendering_helper.h
@@ -75,9 +75,6 @@ class RenderingHelper {
// Delete |texture_id|.
void DeleteTexture(uint32 texture_id);
- // Get the platform specific handle to the OpenGL context.
- void* GetGLContext();
-
// Get the platform specific handle to the OpenGL display.
void* GetGLDisplay();
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
index cd18574..611ce5a 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -240,11 +240,10 @@ VaapiVideoDecodeAccelerator::TFPPicture*
}
VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator(
- Display* x_display, GLXContext glx_context,
+ Display* x_display,
Client* client,
const base::Callback<bool(void)>& make_context_current)
: x_display_(x_display),
- glx_context_(glx_context),
make_context_current_(make_context_current),
state_(kUninitialized),
input_ready_(&lock_),
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.h b/content/common/gpu/media/vaapi_video_decode_accelerator.h
index 1755b98..ac97386 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.h
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.h
@@ -45,7 +45,7 @@ class CONTENT_EXPORT VaapiVideoDecodeAccelerator
: public VideoDecodeAcceleratorImpl {
public:
VaapiVideoDecodeAccelerator(
- Display* x_display, GLXContext glx_context,
+ Display* x_display,
Client* client,
const base::Callback<bool(void)>& make_context_current);
virtual ~VaapiVideoDecodeAccelerator();
@@ -153,7 +153,6 @@ private:
// Client-provided X/GLX state.
Display* x_display_;
- GLXContext glx_context_;
base::Callback<bool(void)> make_context_current_;
GLXFBConfig fb_config_;
diff --git a/content/common/gpu/media/video_decode_accelerator_unittest.cc b/content/common/gpu/media/video_decode_accelerator_unittest.cc
index 7c1f077..34df90c 100644
--- a/content/common/gpu/media/video_decode_accelerator_unittest.cc
+++ b/content/common/gpu/media/video_decode_accelerator_unittest.cc
@@ -548,7 +548,6 @@ void GLRenderingVDAClient::CreateAndStartDecoder() {
#if defined(ARCH_CPU_ARMEL)
decoder_.reset(new ExynosVideoDecodeAccelerator(
static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
- static_cast<EGLContext>(rendering_helper_->GetGLContext()),
client,
weak_client,
base::Bind(&DoNothingReturnTrue),
@@ -556,7 +555,6 @@ void GLRenderingVDAClient::CreateAndStartDecoder() {
#elif defined(ARCH_CPU_X86_FAMILY)
decoder_.reset(new VaapiVideoDecodeAccelerator(
static_cast<Display*>(rendering_helper_->GetGLDisplay()),
- static_cast<GLXContext>(rendering_helper_->GetGLContext()),
client,
base::Bind(&DoNothingReturnTrue)));
#endif // ARCH_CPU_ARMEL