OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/omx_video_decode_accelerator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
706 result = OMX_FreeBuffer(component_handle_, input_port_, omx_buffer); | 706 result = OMX_FreeBuffer(component_handle_, input_port_, omx_buffer); |
707 RETURN_ON_OMX_FAILURE(result, "OMX_FreeBuffer", PLATFORM_FAILURE,); | 707 RETURN_ON_OMX_FAILURE(result, "OMX_FreeBuffer", PLATFORM_FAILURE,); |
708 } | 708 } |
709 } | 709 } |
710 | 710 |
711 void OmxVideoDecodeAccelerator::FreeOutputBuffers() { | 711 void OmxVideoDecodeAccelerator::FreeOutputBuffers() { |
712 DCHECK_EQ(message_loop_, MessageLoop::current()); | 712 DCHECK_EQ(message_loop_, MessageLoop::current()); |
713 // Calls to OMX to free buffers. | 713 // Calls to OMX to free buffers. |
714 OMX_ERRORTYPE result; | 714 OMX_ERRORTYPE result; |
715 | 715 |
716 if (!make_context_current_.Run()) | |
717 return; | |
718 | |
719 for (OutputPictureById::iterator it = pictures_.begin(); | 716 for (OutputPictureById::iterator it = pictures_.begin(); |
720 it != pictures_.end(); ++it) { | 717 it != pictures_.end(); ++it) { |
721 OMX_BUFFERHEADERTYPE* omx_buffer = it->second.omx_buffer_header; | 718 OMX_BUFFERHEADERTYPE* omx_buffer = it->second.omx_buffer_header; |
722 DCHECK(omx_buffer); | 719 DCHECK(omx_buffer); |
723 delete reinterpret_cast<media::Picture*>(omx_buffer->pAppPrivate); | 720 delete reinterpret_cast<media::Picture*>(omx_buffer->pAppPrivate); |
724 result = OMX_FreeBuffer(component_handle_, output_port_, omx_buffer); | 721 result = OMX_FreeBuffer(component_handle_, output_port_, omx_buffer); |
725 RETURN_ON_OMX_FAILURE(result, "OMX_FreeBuffer", PLATFORM_FAILURE,); | 722 RETURN_ON_OMX_FAILURE(result, "OMX_FreeBuffer", PLATFORM_FAILURE,); |
726 texture_to_egl_image_translator_->DestroyEglImage(egl_display_, | 723 |
727 it->second.egl_image); | 724 // If make_context_current_.Run() fails, we still want to keep iterating. |
725 if (make_context_current_.Run()) | |
Ami GONE FROM CHROMIUM
2012/08/11 04:23:37
multi-line if bodies require braces in chromium st
Ami GONE FROM CHROMIUM
2012/08/11 04:23:37
Do you have an idea of what can cause the makecurr
piman
2012/08/11 04:50:12
It doesn't look like we need to make_context_curre
| |
726 texture_to_egl_image_translator_->DestroyEglImage(egl_display_, | |
727 it->second.egl_image); | |
728 if (client_) | 728 if (client_) |
729 client_->DismissPictureBuffer(it->first); | 729 client_->DismissPictureBuffer(it->first); |
730 } | 730 } |
731 pictures_.clear(); | 731 pictures_.clear(); |
732 } | 732 } |
733 | 733 |
734 void OmxVideoDecodeAccelerator::OnOutputPortDisabled() { | 734 void OmxVideoDecodeAccelerator::OnOutputPortDisabled() { |
735 DCHECK_EQ(message_loop_, MessageLoop::current()); | 735 DCHECK_EQ(message_loop_, MessageLoop::current()); |
736 OMX_PARAM_PORTDEFINITIONTYPE port_format; | 736 OMX_PARAM_PORTDEFINITIONTYPE port_format; |
737 InitParam(*this, &port_format); | 737 InitParam(*this, &port_format); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1086 | 1086 |
1087 bool OmxVideoDecodeAccelerator::SendCommandToPort( | 1087 bool OmxVideoDecodeAccelerator::SendCommandToPort( |
1088 OMX_COMMANDTYPE cmd, int port_index) { | 1088 OMX_COMMANDTYPE cmd, int port_index) { |
1089 DCHECK_EQ(message_loop_, MessageLoop::current()); | 1089 DCHECK_EQ(message_loop_, MessageLoop::current()); |
1090 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_, | 1090 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_, |
1091 cmd, port_index, 0); | 1091 cmd, port_index, 0); |
1092 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd, | 1092 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd, |
1093 PLATFORM_FAILURE, false); | 1093 PLATFORM_FAILURE, false); |
1094 return true; | 1094 return true; |
1095 } | 1095 } |
OLD | NEW |