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

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

Issue 10837199: OMX: Make context current before using EGLImage functions. (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Created 8 years, 4 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/omx_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/omx_video_decode_accelerator.cc b/content/common/gpu/media/omx_video_decode_accelerator.cc
index de862197752cc2d491d7c388b15a5266ccc374a3..956742d7eca9ae5154efd2f92414462acbb9f0f4 100644
--- a/content/common/gpu/media/omx_video_decode_accelerator.cc
+++ b/content/common/gpu/media/omx_video_decode_accelerator.cc
@@ -91,7 +91,8 @@ bool OmxVideoDecodeAccelerator::pre_sandbox_init_done_ = false;
OmxVideoDecodeAccelerator::OmxVideoDecodeAccelerator(
EGLDisplay egl_display, EGLContext egl_context,
- media::VideoDecodeAccelerator::Client* client)
+ media::VideoDecodeAccelerator::Client* client,
+ const base::Callback<bool(void)>& make_context_current)
: message_loop_(MessageLoop::current()),
component_handle_(NULL),
weak_this_(base::AsWeakPtr(this)),
@@ -106,6 +107,7 @@ OmxVideoDecodeAccelerator::OmxVideoDecodeAccelerator(
output_buffers_at_component_(0),
egl_display_(egl_display),
egl_context_(egl_context),
+ make_context_current_(make_context_current),
client_(client),
codec_(UNKNOWN),
h264_profile_(OMX_VIDEO_AVCProfileMax),
@@ -334,6 +336,9 @@ void OmxVideoDecodeAccelerator::AssignPictureBuffers(
DCHECK_EQ(fake_output_buffers_.size(), 0U);
DCHECK_EQ(pictures_.size(), 0U);
+ if (!make_context_current_.Run())
+ return;
+
for (size_t i = 0; i < buffers.size(); ++i) {
EGLImageKHR egl_image =
texture_to_egl_image_translator_->TranslateToEglImage(
@@ -707,6 +712,10 @@ void OmxVideoDecodeAccelerator::FreeOutputBuffers() {
DCHECK_EQ(message_loop_, MessageLoop::current());
// Calls to OMX to free buffers.
OMX_ERRORTYPE result;
+
+ if (!make_context_current_.Run())
+ return;
+
for (OutputPictureById::iterator it = pictures_.begin();
it != pictures_.end(); ++it) {
OMX_BUFFERHEADERTYPE* omx_buffer = it->second.omx_buffer_header;
« no previous file with comments | « content/common/gpu/media/omx_video_decode_accelerator.h ('k') | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698