| 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 744 |
| 745 // Request picture buffers to be handed to the component. | 745 // Request picture buffers to be handed to the component. |
| 746 // ProvidePictureBuffers() will trigger AssignPictureBuffers, which ultimately | 746 // ProvidePictureBuffers() will trigger AssignPictureBuffers, which ultimately |
| 747 // assigns the textures to the component and re-enables the port. | 747 // assigns the textures to the component and re-enables the port. |
| 748 const OMX_VIDEO_PORTDEFINITIONTYPE& vformat = port_format.format.video; | 748 const OMX_VIDEO_PORTDEFINITIONTYPE& vformat = port_format.format.video; |
| 749 last_requested_picture_buffer_dimensions_.SetSize(vformat.nFrameWidth, | 749 last_requested_picture_buffer_dimensions_.SetSize(vformat.nFrameWidth, |
| 750 vformat.nFrameHeight); | 750 vformat.nFrameHeight); |
| 751 if (client_) { | 751 if (client_) { |
| 752 client_->ProvidePictureBuffers( | 752 client_->ProvidePictureBuffers( |
| 753 kNumPictureBuffers, | 753 kNumPictureBuffers, |
| 754 gfx::Size(vformat.nFrameWidth, vformat.nFrameHeight)); | 754 gfx::Size(vformat.nFrameWidth, vformat.nFrameHeight), |
| 755 media::VideoDecodeAccelerator::TEXTURE_TARGET_2D); |
| 755 } | 756 } |
| 756 } | 757 } |
| 757 | 758 |
| 758 void OmxVideoDecodeAccelerator::OnOutputPortEnabled() { | 759 void OmxVideoDecodeAccelerator::OnOutputPortEnabled() { |
| 759 DCHECK_EQ(message_loop_, MessageLoop::current()); | 760 DCHECK_EQ(message_loop_, MessageLoop::current()); |
| 760 | 761 |
| 761 if (!CanFillBuffer()) { | 762 if (!CanFillBuffer()) { |
| 762 StopOnError(ILLEGAL_STATE); | 763 StopOnError(ILLEGAL_STATE); |
| 763 return; | 764 return; |
| 764 } | 765 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 | 1052 |
| 1052 bool OmxVideoDecodeAccelerator::SendCommandToPort( | 1053 bool OmxVideoDecodeAccelerator::SendCommandToPort( |
| 1053 OMX_COMMANDTYPE cmd, int port_index) { | 1054 OMX_COMMANDTYPE cmd, int port_index) { |
| 1054 DCHECK_EQ(message_loop_, MessageLoop::current()); | 1055 DCHECK_EQ(message_loop_, MessageLoop::current()); |
| 1055 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_, | 1056 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_, |
| 1056 cmd, port_index, 0); | 1057 cmd, port_index, 0); |
| 1057 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd, | 1058 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd, |
| 1058 PLATFORM_FAILURE, false); | 1059 PLATFORM_FAILURE, false); |
| 1059 return true; | 1060 return true; |
| 1060 } | 1061 } |
| OLD | NEW |