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

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

Issue 1884633002: Always start AVDA codec configuration thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed comment. Created 4 years, 8 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
« no previous file with comments | « no previous file | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/android_video_decode_accelerator.h" 5 #include "content/common/gpu/media/android_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 } 398 }
399 399
400 // TODO(watk,liberato): move this into the strategy. 400 // TODO(watk,liberato): move this into the strategy.
401 scoped_refptr<gfx::SurfaceTexture> surface_texture = 401 scoped_refptr<gfx::SurfaceTexture> surface_texture =
402 strategy_->GetSurfaceTexture(); 402 strategy_->GetSurfaceTexture();
403 if (surface_texture) { 403 if (surface_texture) {
404 on_frame_available_handler_ = 404 on_frame_available_handler_ =
405 new OnFrameAvailableHandler(this, surface_texture); 405 new OnFrameAvailableHandler(this, surface_texture);
406 } 406 }
407 407
408 // Start the thread for async configuration, even if we don't need it now.
409 // ResetCodecState might rebuild the codec later, for example.
410 g_avda_timer.Pointer()->StartThread(this);
411
408 // If we are encrypted, then we aren't able to create the codec yet. 412 // If we are encrypted, then we aren't able to create the codec yet.
409 if (is_encrypted_) 413 if (is_encrypted_)
410 return true; 414 return true;
411 415
412 if (deferred_initialization_pending_) { 416 if (deferred_initialization_pending_) {
413 g_avda_timer.Pointer()->StartThread(this);
414 ConfigureMediaCodecAsynchronously(); 417 ConfigureMediaCodecAsynchronously();
415 return true; 418 return true;
416 } 419 }
417 420
418 // If the client doesn't support deferred initialization (WebRTC), then we 421 // If the client doesn't support deferred initialization (WebRTC), then we
419 // should complete it now and return a meaningful result. 422 // should complete it now and return a meaningful result.
420 return ConfigureMediaCodecSynchronously(); 423 return ConfigureMediaCodecSynchronously();
421 } 424 }
422 425
423 void AndroidVideoDecodeAccelerator::SetCdm(int cdm_id) { 426 void AndroidVideoDecodeAccelerator::SetCdm(int cdm_id) {
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 media::VideoDecodeAccelerator::Capabilities:: 1321 media::VideoDecodeAccelerator::Capabilities::
1319 SUPPORTS_EXTERNAL_OUTPUT_SURFACE | 1322 SUPPORTS_EXTERNAL_OUTPUT_SURFACE |
1320 media::VideoDecodeAccelerator::Capabilities:: 1323 media::VideoDecodeAccelerator::Capabilities::
1321 SUPPORTS_DEFERRED_INITIALIZATION; 1324 SUPPORTS_DEFERRED_INITIALIZATION;
1322 } 1325 }
1323 1326
1324 return capabilities; 1327 return capabilities;
1325 } 1328 }
1326 1329
1327 } // namespace content 1330 } // namespace content
OLDNEW
« 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