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

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

Issue 2333983002: Reduce number of active codecs on low end devices. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
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 "media/gpu/android_video_decode_accelerator.h" 5 #include "media/gpu/android_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/android/build_info.h" 11 #include "base/android/build_info.h"
12 #include "base/auto_reset.h" 12 #include "base/auto_reset.h"
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/bind_helpers.h" 14 #include "base/bind_helpers.h"
15 #include "base/callback_helpers.h" 15 #include "base/callback_helpers.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/lazy_instance.h" 17 #include "base/lazy_instance.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/message_loop/message_loop.h" 19 #include "base/message_loop/message_loop.h"
20 #include "base/metrics/histogram.h" 20 #include "base/metrics/histogram.h"
21 #include "base/sys_info.h"
21 #include "base/task_runner_util.h" 22 #include "base/task_runner_util.h"
22 #include "base/threading/thread_checker.h" 23 #include "base/threading/thread_checker.h"
23 #include "base/threading/thread_task_runner_handle.h" 24 #include "base/threading/thread_task_runner_handle.h"
24 #include "base/trace_event/trace_event.h" 25 #include "base/trace_event/trace_event.h"
25 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 26 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
26 #include "gpu/command_buffer/service/mailbox_manager.h" 27 #include "gpu/command_buffer/service/mailbox_manager.h"
27 #include "gpu/ipc/service/gpu_channel.h" 28 #include "gpu/ipc/service/gpu_channel.h"
28 #include "media/base/android/media_codec_bridge.h" 29 #include "media/base/android/media_codec_bridge.h"
29 #include "media/base/android/media_codec_util.h" 30 #include "media/base/android/media_codec_util.h"
30 #include "media/base/bind_to_current_loop.h" 31 #include "media/base/bind_to_current_loop.h"
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 surface_waiter_map_.erase(iter); 318 surface_waiter_map_.erase(iter);
318 return; 319 return;
319 } 320 }
320 321
321 // Promote |waiter| to be the owner. 322 // Promote |waiter| to be the owner.
322 iter->second.owner = waiter; 323 iter->second.owner = waiter;
323 iter->second.waiter = nullptr; 324 iter->second.waiter = nullptr;
324 waiter->OnSurfaceAvailable(true); 325 waiter->OnSurfaceAvailable(true);
325 } 326 }
326 327
328 bool ShouldDeferSurfaceCreation(int surface_id, VideoCodec codec) {
329 return surface_id == AndroidVideoDecodeAccelerator::Config::kNoSurfaceID &&
330 codec == kCodecH264 && !thread_avda_instances_.empty() &&
331 (base::android::BuildInfo::GetInstance()->sdk_int() <= 18 ||
332 base::SysInfo::IsLowEndDevice());
333 }
334
327 private: 335 private:
328 friend struct base::DefaultLazyInstanceTraits<AVDAManager>; 336 friend struct base::DefaultLazyInstanceTraits<AVDAManager>;
329 337
330 AVDAManager() 338 AVDAManager()
331 : construction_thread_("AVDAThread"), weak_this_factory_(this) {} 339 : construction_thread_("AVDAThread"), weak_this_factory_(this) {}
332 ~AVDAManager() { NOTREACHED(); } 340 ~AVDAManager() { NOTREACHED(); }
333 341
334 void RunTimer() { 342 void RunTimer() {
335 { 343 {
336 // Call out to all AVDA instances, some of which may attempt to remove 344 // Call out to all AVDA instances, some of which may attempt to remove
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 state_(NO_ERROR), 426 state_(NO_ERROR),
419 picturebuffers_requested_(false), 427 picturebuffers_requested_(false),
420 drain_type_(DRAIN_TYPE_NONE), 428 drain_type_(DRAIN_TYPE_NONE),
421 media_drm_bridge_cdm_context_(nullptr), 429 media_drm_bridge_cdm_context_(nullptr),
422 cdm_registration_id_(0), 430 cdm_registration_id_(0),
423 pending_input_buf_index_(-1), 431 pending_input_buf_index_(-1),
424 error_sequence_token_(0), 432 error_sequence_token_(0),
425 defer_errors_(false), 433 defer_errors_(false),
426 deferred_initialization_pending_(false), 434 deferred_initialization_pending_(false),
427 codec_needs_reset_(false), 435 codec_needs_reset_(false),
436 defer_surface_creation_(false),
428 weak_this_factory_(this) {} 437 weak_this_factory_(this) {}
429 438
430 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { 439 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() {
431 DCHECK(thread_checker_.CalledOnValidThread()); 440 DCHECK(thread_checker_.CalledOnValidThread());
432 g_avda_manager.Get().StopTimer(this); 441 g_avda_manager.Get().StopTimer(this);
433 g_avda_manager.Get().StopThread(this); 442 g_avda_manager.Get().StopThread(this);
434 443
435 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 444 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
436 if (!media_drm_bridge_cdm_context_) 445 if (!media_drm_bridge_cdm_context_)
437 return; 446 return;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 // or if the stream is encrypted. 503 // or if the stream is encrypted.
495 if (IsMediaCodecSoftwareDecodingForbidden() && 504 if (IsMediaCodecSoftwareDecodingForbidden() &&
496 VideoCodecBridge::IsKnownUnaccelerated(codec_config_->codec_, 505 VideoCodecBridge::IsKnownUnaccelerated(codec_config_->codec_,
497 MEDIA_CODEC_DECODER)) { 506 MEDIA_CODEC_DECODER)) {
498 DVLOG(1) << "Initialization failed: " 507 DVLOG(1) << "Initialization failed: "
499 << (codec_config_->codec_ == kCodecVP8 ? "vp8" : "vp9") 508 << (codec_config_->codec_ == kCodecVP8 ? "vp8" : "vp9")
500 << " is not hardware accelerated"; 509 << " is not hardware accelerated";
501 return false; 510 return false;
502 } 511 }
503 512
513 if (g_avda_manager.Get().ShouldDeferSurfaceCreation(config_.surface_id,
514 codec_config_->codec_)) {
515 defer_surface_creation_ = true;
516 deferred_initialization_pending_ = false;
liberato (no reviews please) 2016/09/13 15:34:28 can you restructure this a bit so that |deferred_i
DaleCurtis 2016/09/15 23:03:55 Done.
517 NotifyInitializationComplete(true);
518 return true;
519 }
520
504 auto gles_decoder = get_gles2_decoder_cb_.Run(); 521 auto gles_decoder = get_gles2_decoder_cb_.Run();
505 if (!gles_decoder) { 522 if (!gles_decoder) {
506 LOG(ERROR) << "Failed to get gles2 decoder instance."; 523 LOG(ERROR) << "Failed to get gles2 decoder instance.";
507 return false; 524 return false;
508 } 525 }
509 526
510 if (!make_context_current_cb_.Run()) { 527 if (!make_context_current_cb_.Run()) {
511 LOG(ERROR) << "Failed to make this decoder's GL context current."; 528 LOG(ERROR) << "Failed to make this decoder's GL context current.";
512 return false; 529 return false;
513 } 530 }
514 531
515 if (g_avda_manager.Get().AllocateSurface(config_.surface_id, this)) { 532 if (g_avda_manager.Get().AllocateSurface(config_.surface_id, this)) {
516 // We have succesfully owned the surface, so finish initialization now. 533 // We have succesfully owned the surface, so finish initialization now.
517 return InitializePictureBufferManager(); 534 return InitializePictureBufferManager(false);
518 } 535 }
519 536
520 // We have to wait for some other AVDA instance to free up the surface. 537 // We have to wait for some other AVDA instance to free up the surface.
521 // OnSurfaceAvailable will be called when it's available. 538 // OnSurfaceAvailable will be called when it's available.
522 return true; 539 return true;
523 } 540 }
524 541
525 void AndroidVideoDecodeAccelerator::OnSurfaceAvailable(bool success) { 542 void AndroidVideoDecodeAccelerator::OnSurfaceAvailable(bool success) {
526 DCHECK(deferred_initialization_pending_); 543 DCHECK(deferred_initialization_pending_);
liberato (no reviews please) 2016/09/13 15:34:28 maybe DCHECK !defer_surface_creation_, mostly as t
DaleCurtis 2016/09/15 23:03:55 Done.
527 544
528 if (!success || !InitializePictureBufferManager()) { 545 if (!success || !InitializePictureBufferManager(false)) {
529 NotifyInitializationComplete(false); 546 NotifyInitializationComplete(false);
530 deferred_initialization_pending_ = false; 547 deferred_initialization_pending_ = false;
531 } 548 }
532 } 549 }
533 550
534 bool AndroidVideoDecodeAccelerator::InitializePictureBufferManager() { 551 bool AndroidVideoDecodeAccelerator::InitializePictureBufferManager(
552 bool force_async_init) {
535 codec_config_->surface_ = 553 codec_config_->surface_ =
536 picture_buffer_manager_.Initialize(this, config_.surface_id); 554 picture_buffer_manager_.Initialize(this, config_.surface_id);
537 if (codec_config_->surface_.IsEmpty()) 555 if (codec_config_->surface_.IsEmpty())
538 return false; 556 return false;
539 557
540 on_destroying_surface_cb_ = 558 on_destroying_surface_cb_ =
541 base::Bind(&AndroidVideoDecodeAccelerator::OnDestroyingSurface, 559 base::Bind(&AndroidVideoDecodeAccelerator::OnDestroyingSurface,
542 weak_this_factory_.GetWeakPtr()); 560 weak_this_factory_.GetWeakPtr());
543 AVDASurfaceTracker::GetInstance()->RegisterOnDestroyingSurfaceCallback( 561 AVDASurfaceTracker::GetInstance()->RegisterOnDestroyingSurfaceCallback(
544 on_destroying_surface_cb_); 562 on_destroying_surface_cb_);
545 563
546 if (!g_avda_manager.Get().StartThread(this)) 564 if (!g_avda_manager.Get().StartThread(this))
547 return false; 565 return false;
548 566
549 // If we are encrypted, then we aren't able to create the codec yet. 567 // If we are encrypted, then we aren't able to create the codec yet.
550 if (config_.is_encrypted) { 568 if (config_.is_encrypted) {
551 InitializeCdm(); 569 InitializeCdm();
552 return true; 570 return true;
553 } 571 }
554 572
555 if (deferred_initialization_pending_) { 573 if (deferred_initialization_pending_ || force_async_init) {
556 ConfigureMediaCodecAsynchronously(); 574 ConfigureMediaCodecAsynchronously();
557 return true; 575 return true;
558 } 576 }
559 577
560 // If the client doesn't support deferred initialization (WebRTC), then we 578 // If the client doesn't support deferred initialization (WebRTC), then we
561 // should complete it now and return a meaningful result. Note that it would 579 // should complete it now and return a meaningful result. Note that it would
562 // be nice if we didn't have to worry about starting codec configuration at 580 // be nice if we didn't have to worry about starting codec configuration at
563 // all (::Initialize or the wrapper can do it), but then they have to remember 581 // all (::Initialize or the wrapper can do it), but then they have to remember
564 // not to start codec config if we have to wait for the cdm. It's somewhat 582 // not to start codec config if we have to wait for the cdm. It's somewhat
565 // clearer for us to handle both cases. 583 // clearer for us to handle both cases.
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 931
914 // Connect the PictureBuffer to the decoded frame. 932 // Connect the PictureBuffer to the decoded frame.
915 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index, 933 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index,
916 picture_buffer); 934 picture_buffer);
917 } 935 }
918 936
919 void AndroidVideoDecodeAccelerator::Decode( 937 void AndroidVideoDecodeAccelerator::Decode(
920 const BitstreamBuffer& bitstream_buffer) { 938 const BitstreamBuffer& bitstream_buffer) {
921 DCHECK(thread_checker_.CalledOnValidThread()); 939 DCHECK(thread_checker_.CalledOnValidThread());
922 940
941 if (defer_surface_creation_) {
942 // We should never be here if a SurfaceView is required.
943 defer_surface_creation_ = false;
944 DCHECK_EQ(config_.surface_id, Config::kNoSurfaceID);
945 DCHECK(g_avda_manager.Get().AllocateSurface(config_.surface_id, this));
946 if (!make_context_current_cb_.Run() ||
liberato (no reviews please) 2016/09/13 15:34:28 hrm, i just noticed that the OnSurfaceAvailable =>
DaleCurtis 2016/09/15 23:03:55 Done.
947 !InitializePictureBufferManager(true)) {
948 POST_ERROR(PLATFORM_FAILURE,
949 "Failed deferred surface and MediaCodec initialization.");
950 return;
951 }
952 }
953
923 // If we previously deferred a codec restart, take care of it now. This can 954 // If we previously deferred a codec restart, take care of it now. This can
924 // happen on older devices where configuration changes require a codec reset. 955 // happen on older devices where configuration changes require a codec reset.
925 if (codec_needs_reset_) { 956 if (codec_needs_reset_) {
926 DCHECK_EQ(drain_type_, DRAIN_TYPE_NONE); 957 DCHECK_EQ(drain_type_, DRAIN_TYPE_NONE);
927 ResetCodecState(); 958 ResetCodecState();
928 } 959 }
929 960
930 if (bitstream_buffer.id() >= 0 && bitstream_buffer.size() > 0) { 961 if (bitstream_buffer.id() >= 0 && bitstream_buffer.size() > 0) {
931 DecodeBuffer(bitstream_buffer); 962 DecodeBuffer(bitstream_buffer);
932 return; 963 return;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 } 1043 }
1013 1044
1014 picture_buffer_manager_.ReuseOnePictureBuffer(it->second); 1045 picture_buffer_manager_.ReuseOnePictureBuffer(it->second);
1015 DoIOTask(true); 1046 DoIOTask(true);
1016 } 1047 }
1017 1048
1018 void AndroidVideoDecodeAccelerator::Flush() { 1049 void AndroidVideoDecodeAccelerator::Flush() {
1019 DVLOG(1) << __FUNCTION__; 1050 DVLOG(1) << __FUNCTION__;
1020 DCHECK(thread_checker_.CalledOnValidThread()); 1051 DCHECK(thread_checker_.CalledOnValidThread());
1021 1052
1022 if (state_ == SURFACE_DESTROYED) 1053 if (state_ == SURFACE_DESTROYED || defer_surface_creation_)
1023 NotifyFlushDone(); 1054 NotifyFlushDone();
1024 else 1055 else
1025 StartCodecDrain(DRAIN_FOR_FLUSH); 1056 StartCodecDrain(DRAIN_FOR_FLUSH);
1026 } 1057 }
1027 1058
1028 void AndroidVideoDecodeAccelerator::ConfigureMediaCodecAsynchronously() { 1059 void AndroidVideoDecodeAccelerator::ConfigureMediaCodecAsynchronously() {
1029 DCHECK(thread_checker_.CalledOnValidThread()); 1060 DCHECK(thread_checker_.CalledOnValidThread());
1030 1061
1031 // It's probably okay just to return here, since the codec will be configured 1062 // It's probably okay just to return here, since the codec will be configured
1032 // asynchronously. It's unclear that any state for the new request could 1063 // asynchronously. It's unclear that any state for the new request could
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 // We might increment error_sequence_token here to cancel any delayed errors, 1274 // We might increment error_sequence_token here to cancel any delayed errors,
1244 // but right now it's unclear that it's safe to do so. If we are in an error 1275 // but right now it's unclear that it's safe to do so. If we are in an error
1245 // state because of a codec error, then it would be okay. Otherwise, it's 1276 // state because of a codec error, then it would be okay. Otherwise, it's
1246 // less obvious that we are exiting the error state. Since deferred errors 1277 // less obvious that we are exiting the error state. Since deferred errors
1247 // are only intended for fullscreen transitions right now, we take the more 1278 // are only intended for fullscreen transitions right now, we take the more
1248 // conservative approach and let the errors post. 1279 // conservative approach and let the errors post.
1249 // TODO(liberato): revisit this once we sort out the error state a bit more. 1280 // TODO(liberato): revisit this once we sort out the error state a bit more.
1250 1281
1251 // Flush the codec if possible, or create a new one if not. 1282 // Flush the codec if possible, or create a new one if not.
1252 if (!did_codec_error_happen && 1283 if (!did_codec_error_happen &&
1253 !media::MediaCodecUtil::CodecNeedsFlushWorkaround(media_codec_.get())) { 1284 !MediaCodecUtil::CodecNeedsFlushWorkaround(media_codec_.get())) {
1254 DVLOG(3) << __FUNCTION__ << " Flushing MediaCodec."; 1285 DVLOG(3) << __FUNCTION__ << " Flushing MediaCodec.";
1255 media_codec_->Flush(); 1286 media_codec_->Flush();
1256 // Since we just flushed all the output buffers, make sure that nothing is 1287 // Since we just flushed all the output buffers, make sure that nothing is
1257 // using them. 1288 // using them.
1258 picture_buffer_manager_.CodecChanged(media_codec_.get()); 1289 picture_buffer_manager_.CodecChanged(media_codec_.get());
1259 } else { 1290 } else {
1260 DVLOG(3) << __FUNCTION__ 1291 DVLOG(3) << __FUNCTION__
1261 << " Deleting the MediaCodec and creating a new one."; 1292 << " Deleting the MediaCodec and creating a new one.";
1262 g_avda_manager.Get().StopTimer(this); 1293 g_avda_manager.Get().StopTimer(this);
1263 ConfigureMediaCodecAsynchronously(); 1294 ConfigureMediaCodecAsynchronously();
1264 } 1295 }
1265 } 1296 }
1266 1297
1267 void AndroidVideoDecodeAccelerator::Reset() { 1298 void AndroidVideoDecodeAccelerator::Reset() {
1268 DVLOG(1) << __FUNCTION__; 1299 DVLOG(1) << __FUNCTION__;
1269 DCHECK(thread_checker_.CalledOnValidThread()); 1300 DCHECK(thread_checker_.CalledOnValidThread());
1270 TRACE_EVENT0("media", "AVDA::Reset"); 1301 TRACE_EVENT0("media", "AVDA::Reset");
1271 1302
1303 if (defer_surface_creation_) {
1304 DCHECK(!media_codec_);
1305 DCHECK(pending_bitstream_records_.empty());
1306 DCHECK_EQ(state_, NO_ERROR);
1307 base::ThreadTaskRunnerHandle::Get()->PostTask(
1308 FROM_HERE, base::Bind(&AndroidVideoDecodeAccelerator::NotifyResetDone,
1309 weak_this_factory_.GetWeakPtr()));
1310 return;
1311 }
1312
1272 while (!pending_bitstream_records_.empty()) { 1313 while (!pending_bitstream_records_.empty()) {
1273 int32_t bitstream_buffer_id = 1314 int32_t bitstream_buffer_id =
1274 pending_bitstream_records_.front().buffer.id(); 1315 pending_bitstream_records_.front().buffer.id();
1275 pending_bitstream_records_.pop(); 1316 pending_bitstream_records_.pop();
1276 1317
1277 if (bitstream_buffer_id != -1) { 1318 if (bitstream_buffer_id != -1) {
1278 base::ThreadTaskRunnerHandle::Get()->PostTask( 1319 base::ThreadTaskRunnerHandle::Get()->PostTask(
1279 FROM_HERE, 1320 FROM_HERE,
1280 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer, 1321 base::Bind(&AndroidVideoDecodeAccelerator::NotifyEndOfBitstreamBuffer,
1281 weak_this_factory_.GetWeakPtr(), bitstream_buffer_id)); 1322 weak_this_factory_.GetWeakPtr(), bitstream_buffer_id));
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1610 capabilities.flags = 1651 capabilities.flags =
1611 VideoDecodeAccelerator::Capabilities::SUPPORTS_DEFERRED_INITIALIZATION; 1652 VideoDecodeAccelerator::Capabilities::SUPPORTS_DEFERRED_INITIALIZATION;
1612 capabilities.flags |= 1653 capabilities.flags |=
1613 VideoDecodeAccelerator::Capabilities::NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE; 1654 VideoDecodeAccelerator::Capabilities::NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE;
1614 1655
1615 // If we're using threaded texture mailboxes the COPY_REQUIRED flag must be 1656 // If we're using threaded texture mailboxes the COPY_REQUIRED flag must be
1616 // set on the video frames (http://crbug.com/582170), and SurfaceView output 1657 // set on the video frames (http://crbug.com/582170), and SurfaceView output
1617 // is disabled (http://crbug.com/582170). 1658 // is disabled (http://crbug.com/582170).
1618 if (gpu_preferences.enable_threaded_texture_mailboxes) { 1659 if (gpu_preferences.enable_threaded_texture_mailboxes) {
1619 capabilities.flags |= 1660 capabilities.flags |=
1620 media::VideoDecodeAccelerator::Capabilities::REQUIRES_TEXTURE_COPY; 1661 VideoDecodeAccelerator::Capabilities::REQUIRES_TEXTURE_COPY;
1621 } else if (media::MediaCodecUtil::IsSurfaceViewOutputSupported()) { 1662 } else if (MediaCodecUtil::IsSurfaceViewOutputSupported()) {
1622 capabilities.flags |= media::VideoDecodeAccelerator::Capabilities:: 1663 capabilities.flags |=
1623 SUPPORTS_EXTERNAL_OUTPUT_SURFACE; 1664 VideoDecodeAccelerator::Capabilities::SUPPORTS_EXTERNAL_OUTPUT_SURFACE;
1624 } 1665 }
1625 1666
1626 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) 1667 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
1627 for (const auto& supported_profile : kSupportedHevcProfiles) { 1668 for (const auto& supported_profile : kSupportedHevcProfiles) {
1628 SupportedProfile profile; 1669 SupportedProfile profile;
1629 profile.profile = supported_profile; 1670 profile.profile = supported_profile;
1630 profile.min_resolution.SetSize(0, 0); 1671 profile.min_resolution.SetSize(0, 0);
1631 profile.max_resolution.SetSize(3840, 2160); 1672 profile.max_resolution.SetSize(3840, 2160);
1632 profiles.push_back(profile); 1673 profiles.push_back(profile);
1633 } 1674 }
1634 #endif 1675 #endif
1635 1676
1636 return capabilities; 1677 return capabilities;
1637 } 1678 }
1638 1679
1639 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() 1680 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden()
1640 const { 1681 const {
1641 // Prevent MediaCodec from using its internal software decoders when we have 1682 // Prevent MediaCodec from using its internal software decoders when we have
1642 // more secure and up to date versions in the renderer process. 1683 // more secure and up to date versions in the renderer process.
1643 return !config_.is_encrypted && (codec_config_->codec_ == kCodecVP8 || 1684 return !config_.is_encrypted && (codec_config_->codec_ == kCodecVP8 ||
1644 codec_config_->codec_ == kCodecVP9); 1685 codec_config_->codec_ == kCodecVP9);
1645 } 1686 }
1646 1687
1647 } // namespace media 1688 } // namespace media
OLDNEW
« media/gpu/android_video_decode_accelerator.h ('K') | « media/gpu/android_video_decode_accelerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698