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

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

Issue 7260008: Implement proper synchronization between HW video decode IPC and CommandBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 6 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
diff --git a/content/common/gpu/media/omx_video_decode_accelerator.cc b/content/common/gpu/media/omx_video_decode_accelerator.cc
index 2dfc1da7dc9bfc9c5deceea77833b8a33994adaf..36df321a0a2cac81b3d99ea0dcd41b6432a1dfe6 100644
--- a/content/common/gpu/media/omx_video_decode_accelerator.cc
+++ b/content/common/gpu/media/omx_video_decode_accelerator.cc
@@ -335,12 +335,12 @@ bool OmxVideoDecodeAccelerator::CreateComponent() {
return true;
}
-bool OmxVideoDecodeAccelerator::Decode(
+void OmxVideoDecodeAccelerator::Decode(
const media::BitstreamBuffer& bitstream_buffer) {
DCHECK(!free_input_buffers_.empty());
if (!CanAcceptInput())
- return false;
+ return;
OMX_BUFFERHEADERTYPE* omx_buffer = free_input_buffers_.front();
free_input_buffers_.pop();
@@ -350,7 +350,7 @@ bool OmxVideoDecodeAccelerator::Decode(
new base::SharedMemory(bitstream_buffer.handle(), true));
if (!shm->Map(bitstream_buffer.size())) {
LOG(ERROR) << "Failed to SharedMemory::Map().";
- return false;
+ return;
}
SharedMemoryAndId* input_buffer_details = new SharedMemoryAndId();
input_buffer_details->first.reset(shm.release());
@@ -373,10 +373,9 @@ bool OmxVideoDecodeAccelerator::Decode(
if (result != OMX_ErrorNone) {
LOG(ERROR) << "OMX_EmptyThisBuffer() failed with result " << result;
StopOnError();
- return false;
+ return;
}
input_buffers_at_component_++;
- return true;
}
void OmxVideoDecodeAccelerator::AssignGLESBuffers(
@@ -440,14 +439,14 @@ void OmxVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) {
}
}
-bool OmxVideoDecodeAccelerator::Flush() {
+void OmxVideoDecodeAccelerator::Flush() {
OMX_STATETYPE il_state;
OMX_GetState(component_handle_, &il_state);
DCHECK_EQ(il_state, OMX_StateExecuting);
// Decode the pending data first. Then flush I/O ports.
if (il_state != OMX_StateExecuting) {
client_->NotifyFlushDone();
- return false;
+ return;
}
on_buffer_flag_event_func_ = &OmxVideoDecodeAccelerator::FlushBegin;
@@ -464,10 +463,9 @@ bool OmxVideoDecodeAccelerator::Flush() {
if (result != OMX_ErrorNone) {
LOG(ERROR) << "OMX_EmptyThisBuffer() failed with result " << result;
StopOnError();
- return false;
+ return;
}
input_buffers_at_component_++;
- return true;
}
void OmxVideoDecodeAccelerator::FlushBegin() {
@@ -525,12 +523,12 @@ void OmxVideoDecodeAccelerator::OutputPortFlushDone(int port) {
client_->NotifyFlushDone();
}
-bool OmxVideoDecodeAccelerator::Abort() {
+void OmxVideoDecodeAccelerator::Abort() {
CHECK_EQ(message_loop_, MessageLoop::current());
// Abort() implies immediacy but Flush() actually decodes pending data first.
// TODO(vhiremath@nvidia.com) Fix the Abort to handle this immediacy.
ShutDownOMXFromExecuting();
- return true;
+ return;
}
// Event callback during initialization to handle DoneStateSet to idle

Powered by Google App Engine
This is Rietveld 408576698