Index: content/common/gpu/media/omx_video_decode_accelerator.cc |
=================================================================== |
--- content/common/gpu/media/omx_video_decode_accelerator.cc (revision 120554) |
+++ content/common/gpu/media/omx_video_decode_accelerator.cc (working copy) |
@@ -199,6 +199,13 @@ |
reinterpret_cast<char *>(component.get()), |
"OMX.Nvidia.h264ext.decode"); |
+ bool component_name_is_sec_h264ext = !strcmp( |
+ reinterpret_cast<char *>(component.get()), |
+ "OMX.SEC.AVC.Decoder"); |
+ Gles2TextureToEglImageTranslator* texture_to_egl_image_translator = |
+ new Gles2TextureToEglImageTranslator(component_name_is_sec_h264ext); |
+ texture_to_egl_image_translator_.reset(texture_to_egl_image_translator); |
+ |
// Get the port information. This will obtain information about the number of |
// ports and index of the first port. |
OMX_PORT_PARAM_TYPE port_param; |
@@ -344,10 +351,12 @@ |
DCHECK_EQ(fake_output_buffers_.size(), 0U); |
DCHECK_EQ(pictures_.size(), 0U); |
- static Gles2TextureToEglImageTranslator texture2eglImage_translator; |
for (size_t i = 0; i < buffers.size(); ++i) { |
- EGLImageKHR egl_image = texture2eglImage_translator.TranslateToEglImage( |
- egl_display_, egl_context_, buffers[i].texture_id()); |
+ EGLImageKHR egl_image = |
+ texture_to_egl_image_translator_->TranslateToEglImage( |
+ egl_display_, egl_context_, |
+ buffers[i].texture_id(), |
+ last_requested_picture_buffer_dimensions_); |
CHECK(pictures_.insert(std::make_pair( |
buffers[i].id(), OutputPicture(buffers[i], NULL, egl_image))).second); |
} |
@@ -696,7 +705,6 @@ |
DCHECK_EQ(message_loop_, MessageLoop::current()); |
// 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; |
@@ -704,8 +712,8 @@ |
delete reinterpret_cast<media::Picture*>(omx_buffer->pAppPrivate); |
result = OMX_FreeBuffer(component_handle_, output_port_, omx_buffer); |
RETURN_ON_OMX_FAILURE(result, "OMX_FreeBuffer", PLATFORM_FAILURE,); |
- texture2eglImage_translator.DestroyEglImage(egl_display_, |
- it->second.egl_image); |
+ texture_to_egl_image_translator_->DestroyEglImage(egl_display_, |
+ it->second.egl_image); |
if (client_) |
client_->DismissPictureBuffer(it->first); |
} |
@@ -730,6 +738,8 @@ |
// ProvidePictureBuffers() will trigger AssignPictureBuffers, which ultimately |
// assigns the textures to the component and re-enables the port. |
const OMX_VIDEO_PORTDEFINITIONTYPE& vformat = port_format.format.video; |
+ last_requested_picture_buffer_dimensions_.SetSize(vformat.nFrameWidth, |
+ vformat.nFrameHeight); |
if (client_) { |
client_->ProvidePictureBuffers( |
kNumPictureBuffers, |