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

Side by Side Diff: content/common/gpu/media/omx_video_decode_accelerator.cc

Issue 7587004: Destroy OmxVideoDecodeAccelerator on renderer close, too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "content/common/gpu/gpu_channel.h" 9 #include "content/common/gpu/gpu_channel.h"
10 #include "content/common/gpu/media/gles2_texture_to_egl_image_translator.h" 10 #include "content/common/gpu/media/gles2_texture_to_egl_image_translator.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 void OmxVideoDecodeAccelerator::Reset() { 417 void OmxVideoDecodeAccelerator::Reset() {
418 DCHECK_EQ(message_loop_, MessageLoop::current()); 418 DCHECK_EQ(message_loop_, MessageLoop::current());
419 DCHECK_EQ(current_state_change_, NO_TRANSITION); 419 DCHECK_EQ(current_state_change_, NO_TRANSITION);
420 DCHECK_EQ(client_state_, OMX_StateExecuting); 420 DCHECK_EQ(client_state_, OMX_StateExecuting);
421 current_state_change_ = RESETTING; 421 current_state_change_ = RESETTING;
422 BeginTransitionToState(OMX_StatePause); 422 BeginTransitionToState(OMX_StatePause);
423 } 423 }
424 424
425 void OmxVideoDecodeAccelerator::Destroy() { 425 void OmxVideoDecodeAccelerator::Destroy() {
426 DCHECK_EQ(message_loop_, MessageLoop::current()); 426 DCHECK_EQ(message_loop_, MessageLoop::current());
427 if (current_state_change_ == ERRORING) 427 if (current_state_change_ == ERRORING ||
428 current_state_change_ == DESTROYING) {
428 return; 429 return;
430 }
429 431
430 DCHECK(current_state_change_ == NO_TRANSITION || 432 DCHECK(current_state_change_ == NO_TRANSITION ||
431 current_state_change_ == FLUSHING || 433 current_state_change_ == FLUSHING ||
432 current_state_change_ == RESETTING) << current_state_change_; 434 current_state_change_ == RESETTING) << current_state_change_;
433 435
434 // If we were never initializeed there's no teardown to do. 436 // If we were never initializeed there's no teardown to do.
435 if (client_state_ == OMX_StateMax) 437 if (client_state_ == OMX_StateMax)
436 return; 438 return;
437 // If we can already call OMX_FreeHandle, simply do so. 439 // If we can already call OMX_FreeHandle, simply do so.
438 if (client_state_ == OMX_StateInvalid || client_state_ == OMX_StateLoaded) { 440 if (client_state_ == OMX_StateInvalid || client_state_ == OMX_StateLoaded) {
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 1013
1012 bool OmxVideoDecodeAccelerator::SendCommandToPort( 1014 bool OmxVideoDecodeAccelerator::SendCommandToPort(
1013 OMX_COMMANDTYPE cmd, int port_index) { 1015 OMX_COMMANDTYPE cmd, int port_index) {
1014 DCHECK_EQ(message_loop_, MessageLoop::current()); 1016 DCHECK_EQ(message_loop_, MessageLoop::current());
1015 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_, 1017 OMX_ERRORTYPE result = OMX_SendCommand(component_handle_,
1016 cmd, port_index, 0); 1018 cmd, port_index, 0);
1017 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd, 1019 RETURN_ON_OMX_FAILURE(result, "SendCommand() failed" << cmd,
1018 PLATFORM_FAILURE, false); 1020 PLATFORM_FAILURE, false);
1019 return true; 1021 return true;
1020 } 1022 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698