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

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

Issue 1485043002: Passed is_encrypted parameter to the VDA initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted erroneously added files Created 5 years 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 "content/common/gpu/media/android_video_decode_accelerator.h" 5 #include "content/common/gpu/media/android_video_decode_accelerator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 return base::TimeDelta::FromMicroseconds(0); 74 return base::TimeDelta::FromMicroseconds(0);
75 } 75 }
76 76
77 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator( 77 AndroidVideoDecodeAccelerator::AndroidVideoDecodeAccelerator(
78 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder, 78 const base::WeakPtr<gpu::gles2::GLES2Decoder> decoder,
79 const base::Callback<bool(void)>& make_context_current, 79 const base::Callback<bool(void)>& make_context_current,
80 scoped_ptr<BackingStrategy> strategy) 80 scoped_ptr<BackingStrategy> strategy)
81 : client_(NULL), 81 : client_(NULL),
82 make_context_current_(make_context_current), 82 make_context_current_(make_context_current),
83 codec_(media::kCodecH264), 83 codec_(media::kCodecH264),
84 is_encrypted_(false),
84 state_(NO_ERROR), 85 state_(NO_ERROR),
85 picturebuffers_requested_(false), 86 picturebuffers_requested_(false),
86 gl_decoder_(decoder), 87 gl_decoder_(decoder),
87 strategy_(strategy.Pass()), 88 strategy_(strategy.Pass()),
88 weak_this_factory_(this) {} 89 weak_this_factory_(this) {}
89 90
90 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() { 91 AndroidVideoDecodeAccelerator::~AndroidVideoDecodeAccelerator() {
91 DCHECK(thread_checker_.CalledOnValidThread()); 92 DCHECK(thread_checker_.CalledOnValidThread());
92 } 93 }
93 94
94 bool AndroidVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, 95 bool AndroidVideoDecodeAccelerator::Initialize(
95 Client* client) { 96 const media::VideoDecodeAccelerator::InitParams& params,
97 Client* client) {
96 DCHECK(!media_codec_); 98 DCHECK(!media_codec_);
97 DCHECK(thread_checker_.CalledOnValidThread()); 99 DCHECK(thread_checker_.CalledOnValidThread());
98 TRACE_EVENT0("media", "AVDA::Initialize"); 100 TRACE_EVENT0("media", "AVDA::Initialize");
99 101
102 DVLOG(1) << __FUNCTION__ << ": profile:" << params.profile
103 << " is_encrypted:" << params.is_encrypted;
104
100 client_ = client; 105 client_ = client;
101 codec_ = VideoCodecProfileToVideoCodec(profile); 106 codec_ = VideoCodecProfileToVideoCodec(params.profile);
107 is_encrypted_ = params.is_encrypted;
liberato (no reviews please) 2015/12/01 14:59:35 might just want to keep a copy of the params as an
Tima Vaisburd 2015/12/02 02:25:06 |codec_| already existed. The idea was that a part
102 108
103 bool profile_supported = codec_ == media::kCodecVP8; 109 bool profile_supported = codec_ == media::kCodecVP8;
104 #if defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID) 110 #if defined(ENABLE_MEDIA_PIPELINE_ON_ANDROID)
105 profile_supported |= 111 profile_supported |=
106 (codec_ == media::kCodecVP9 || codec_ == media::kCodecH264); 112 (codec_ == media::kCodecVP9 || codec_ == media::kCodecH264);
107 #endif 113 #endif
108 114
109 if (!profile_supported) { 115 if (!profile_supported) {
110 LOG(ERROR) << "Unsupported profile: " << profile; 116 LOG(ERROR) << "Unsupported profile: " << params.profile;
111 return false; 117 return false;
112 } 118 }
113 119
114 // Only use MediaCodec for VP8/9 if it's likely backed by hardware. 120 // Only use MediaCodec for VP8/9 if it's likely backed by hardware.
115 if ((codec_ == media::kCodecVP8 || codec_ == media::kCodecVP9) && 121 if ((codec_ == media::kCodecVP8 || codec_ == media::kCodecVP9) &&
116 media::VideoCodecBridge::IsKnownUnaccelerated( 122 media::VideoCodecBridge::IsKnownUnaccelerated(
117 codec_, media::MEDIA_CODEC_DECODER)) { 123 codec_, media::MEDIA_CODEC_DECODER)) {
118 DVLOG(1) << "Initialization failed: " 124 DVLOG(1) << "Initialization failed: "
119 << (codec_ == media::kCodecVP8 ? "vp8" : "vp9") 125 << (codec_ == media::kCodecVP8 ? "vp8" : "vp9")
120 << " is not hardware accelerated"; 126 << " is not hardware accelerated";
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 // software fallback for H264 on Android anyway. 667 // software fallback for H264 on Android anyway.
662 profile.max_resolution.SetSize(3840, 2160); 668 profile.max_resolution.SetSize(3840, 2160);
663 profiles.push_back(profile); 669 profiles.push_back(profile);
664 } 670 }
665 #endif 671 #endif
666 672
667 return profiles; 673 return profiles;
668 } 674 }
669 675
670 } // namespace content 676 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698