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

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

Issue 9346012: Video decode in hardware on ARM platform. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 8 years, 10 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
===================================================================
--- 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,

Powered by Google App Engine
This is Rietveld 408576698