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

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

Issue 10916203: OMX: Avoid calling Fillbuffer while OMX is flushing. (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: OMX: Avoid calling Fillbuffer while OMX is flushing. Created 8 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bef07c0f060643f5795afc2ac7a375d475040c18..cdfaf5c5c4f1002284103b9b8d2c5f593255cd36 100644
--- a/content/common/gpu/media/omx_video_decode_accelerator.cc
+++ b/content/common/gpu/media/omx_video_decode_accelerator.cc
@@ -390,6 +390,12 @@ void OmxVideoDecodeAccelerator::ReusePictureBuffer(int32 picture_buffer_id) {
"Picture id", picture_buffer_id);
DCHECK_EQ(message_loop_, MessageLoop::current());
+ // During port-flushing, do not call OMX FillThisBuffer.
+ if (current_state_change_ == RESETTING) {
+ queued_picture_buffer_ids_.push_back(picture_buffer_id);
+ return;
+ }
+
RETURN_ON_FAILURE(CanFillBuffer(), "Can't fill buffer", ILLEGAL_STATE,);
OutputPictureById::iterator it = pictures_.find(picture_buffer_id);
@@ -795,6 +801,14 @@ void OmxVideoDecodeAccelerator::OnOutputPortDisabled() {
void OmxVideoDecodeAccelerator::OnOutputPortEnabled() {
DCHECK_EQ(message_loop_, MessageLoop::current());
+ if (current_state_change_ == RESETTING) {
+ for (OutputPictureById::iterator it = pictures_.begin();
+ it != pictures_.end(); ++it) {
+ queued_picture_buffer_ids_.push_back(it->first);
+ }
+ return;
+ }
+
if (!CanFillBuffer()) {
StopOnError(ILLEGAL_STATE);
return;
@@ -1123,7 +1137,7 @@ bool OmxVideoDecodeAccelerator::CanFillBuffer() {
DCHECK_EQ(message_loop_, MessageLoop::current());
const CurrentStateChange csc = current_state_change_;
const OMX_STATETYPE cs = client_state_;
- return (csc != DESTROYING && csc != ERRORING) &&
+ return (csc != DESTROYING && csc != ERRORING && csc != RESETTING) &&
(cs == OMX_StateIdle || cs == OMX_StateExecuting || cs == OMX_StatePause);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698