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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 return; | 383 return; |
384 if (!SendCommandToPort(OMX_CommandPortEnable, output_port_)) | 384 if (!SendCommandToPort(OMX_CommandPortEnable, output_port_)) |
385 return; | 385 return; |
386 } | 386 } |
387 | 387 |
388 void OmxVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) { | 388 void OmxVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) { |
389 TRACE_EVENT1("Video Decoder", "OVDA::ReusePictureBuffer", | 389 TRACE_EVENT1("Video Decoder", "OVDA::ReusePictureBuffer", |
390 "Picture id", picture_buffer_id); | 390 "Picture id", picture_buffer_id); |
391 DCHECK_EQ(message_loop_, MessageLoop::current()); | 391 DCHECK_EQ(message_loop_, MessageLoop::current()); |
392 | 392 |
393 RETURN_ON_FAILURE(CanFillBuffer(), "Can't fill buffer", ILLEGAL_STATE,); | 393 RETURN_ON_FAILURE(CanFillBuffer(), "Can't fill buffer", ILLEGAL_STATE,); |
Ami GONE FROM CHROMIUM
2012/09/12 01:09:36
This probably belongs *after* the new code, not be
| |
394 | 394 |
395 //During port-flushing, do not call OMX FillThisBuffer | |
Ami GONE FROM CHROMIUM
2012/09/12 01:09:36
nits: add a space between the // and the 'D', and
| |
396 if (current_state_change_ == RESETTING) { | |
397 queued_picture_buffer_ids_.push_back(picture_buffer_id); | |
398 return; | |
399 } | |
400 | |
395 OutputPictureById::iterator it = pictures_.find(picture_buffer_id); | 401 OutputPictureById::iterator it = pictures_.find(picture_buffer_id); |
396 RETURN_ON_FAILURE(it != pictures_.end(), | 402 RETURN_ON_FAILURE(it != pictures_.end(), |
397 "Missing picture buffer id: " << picture_buffer_id, | 403 "Missing picture buffer id: " << picture_buffer_id, |
398 INVALID_ARGUMENT,); | 404 INVALID_ARGUMENT,); |
399 OutputPicture& output_picture = it->second; | 405 OutputPicture& output_picture = it->second; |
400 | 406 |
401 ++output_buffers_at_component_; | 407 ++output_buffers_at_component_; |
402 OMX_ERRORTYPE result = | 408 OMX_ERRORTYPE result = |
403 OMX_FillThisBuffer(component_handle_, output_picture.omx_buffer_header); | 409 OMX_FillThisBuffer(component_handle_, output_picture.omx_buffer_header); |
404 RETURN_ON_OMX_FAILURE(result, "OMX_FillThisBuffer() failed", | 410 RETURN_ON_OMX_FAILURE(result, "OMX_FillThisBuffer() failed", |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1129 | 1135 |
1130 bool OmxVideoDecodeAccelerator::SendCommandToPort( | 1136 bool OmxVideoDecodeAccelerator::SendCommandToPort( |
1131 OMX_COMMANDTYPE cmd, int port_index) { | 1137 OMX_COMMANDTYPE cmd, int port_index) { |
1132 DCHECK_EQ(message_loop_, MessageLoop::current()); | 1138 DCHECK_EQ(message_loop_, MessageLoop::current()); |
1133 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_, | 1139 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_, |
1134 cmd, port_index, 0); | 1140 cmd, port_index, 0); |
1135 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd, | 1141 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd, |
1136 PLATFORM_FAILURE, false); | 1142 PLATFORM_FAILURE, false); |
1137 return true; | 1143 return true; |
1138 } | 1144 } |
OLD | NEW |