Chromium Code Reviews| Index: content/common/gpu/media/omx_video_decode_accelerator.cc |
| =================================================================== |
| --- content/common/gpu/media/omx_video_decode_accelerator.cc (revision 91551) |
| +++ content/common/gpu/media/omx_video_decode_accelerator.cc (working copy) |
| @@ -391,9 +391,12 @@ |
| CHECK_EQ(pictures_.size(), 0U); |
| CHECK_EQ(message_loop_, MessageLoop::current()); |
| + static Gles2TextureToEglImageTranslator texture2eglImage_translator; |
| for (size_t i = 0; i < buffers.size(); ++i) { |
| + void* egl_image = texture2eglImage_translator.TranslateToEglImage( |
|
Ami GONE FROM CHROMIUM
2011/07/07 06:13:33
s/void*/EGLImageKHR/ here and below.
|
| + egl_display_, egl_context_, buffers[i].texture_id()); |
| CHECK(pictures_.insert(std::make_pair( |
| - buffers[i].id(), OutputPicture(buffers[i], NULL))).second); |
| + buffers[i].id(), OutputPicture(buffers[i], NULL, egl_image))).second); |
| } |
| if (pictures_.size() < kNumPictureBuffers) |
| @@ -688,7 +691,6 @@ |
| bool OmxVideoDecodeAccelerator::AllocateOutputBuffers() { |
| CHECK_EQ(message_loop_, MessageLoop::current()); |
| - static Gles2TextureToEglImageTranslator texture2eglImage_translator; |
| DCHECK(!pictures_.empty()); |
| gfx::Size decoded_pixel_size(pictures_.begin()->second.gles_buffer.size()); |
| @@ -698,10 +700,9 @@ |
| media::GLESBuffer& gles_buffer = it->second.gles_buffer; |
| OMX_BUFFERHEADERTYPE** omx_buffer = &it->second.omx_buffer_header; |
| DCHECK(!*omx_buffer); |
| - void* egl = texture2eglImage_translator.TranslateToEglImage( |
| - egl_display_, egl_context_, gles_buffer.texture_id()); |
| OMX_ERRORTYPE result = OMX_UseEGLImage( |
| - component_handle_, omx_buffer, output_port_, &gles_buffer, egl); |
| + component_handle_, omx_buffer, output_port_, &gles_buffer, |
| + it->second.egl_image); |
| if (result != OMX_ErrorNone) { |
| LOG(ERROR) << "OMX_UseEGLImage failed with: " << result; |
| return false; |
| @@ -736,6 +737,7 @@ |
| void OmxVideoDecodeAccelerator::FreeOutputBuffers() { |
| // Calls to OMX to free buffers. |
| OMX_ERRORTYPE result; |
| + static Gles2TextureToEglImageTranslator texture2eglImage_translator; |
| for (OutputPictureById::iterator it = pictures_.begin(); |
| it != pictures_.end(); ++it) { |
| OMX_BUFFERHEADERTYPE* omx_buffer = it->second.omx_buffer_header; |
| @@ -747,6 +749,8 @@ |
| StopOnError(VIDEODECODERERROR_INVALIDINPUT); |
| return; |
| } |
| + texture2eglImage_translator.DestroyEglImage(egl_display_, |
| + it->second.egl_image); |
| client_->DismissPictureBuffer(it->first); |
| } |
| pictures_.clear(); |