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