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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 2077023002: GpuVideoDecoder should reject playback of videos with alpha channel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TODO Created 4 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 << "GVD with config: " << config.AsHumanReadableString(); 177 << "GVD with config: " << config.AsHumanReadableString();
178 178
179 // TODO(posciak): destroy and create a new VDA on codec/profile change 179 // TODO(posciak): destroy and create a new VDA on codec/profile change
180 // (http://crbug.com/260224). 180 // (http://crbug.com/260224).
181 if (previously_initialized && (config_.profile() != config.profile())) { 181 if (previously_initialized && (config_.profile() != config.profile())) {
182 DVLOG(1) << "Codec or profile changed, cannot reinitialize."; 182 DVLOG(1) << "Codec or profile changed, cannot reinitialize.";
183 bound_init_cb.Run(false); 183 bound_init_cb.Run(false);
184 return; 184 return;
185 } 185 }
186 186
187 // TODO(sandersd): This should be moved to capabilities if we ever have a
188 // hardware decoder which supports alpha formats.
189 if (config.format() == PIXEL_FORMAT_YV12A) {
190 DVLOG(1) << "Alpha transparency formats are not supported.";
191 bound_init_cb.Run(false);
192 return;
193 }
194
187 VideoDecodeAccelerator::Capabilities capabilities = 195 VideoDecodeAccelerator::Capabilities capabilities =
188 factories_->GetVideoDecodeAcceleratorCapabilities(); 196 factories_->GetVideoDecodeAcceleratorCapabilities();
189 if (!IsProfileSupported(capabilities, config.profile(), config.coded_size(), 197 if (!IsProfileSupported(capabilities, config.profile(), config.coded_size(),
190 config.is_encrypted())) { 198 config.is_encrypted())) {
191 DVLOG(1) << "Unsupported profile " << config.profile() 199 DVLOG(1) << "Unsupported profile " << config.profile()
192 << ", unsupported coded size " << config.coded_size().ToString() 200 << ", unsupported coded size " << config.coded_size().ToString()
193 << ", or accelerator should only be used for encrypted content. " 201 << ", or accelerator should only be used for encrypted content. "
194 << " is_encrypted: " << (config.is_encrypted() ? "yes." : "no."); 202 << " is_encrypted: " << (config.is_encrypted() ? "yes." : "no.");
195 bound_init_cb.Run(false); 203 bound_init_cb.Run(false);
196 return; 204 return;
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 } 799 }
792 return false; 800 return false;
793 } 801 }
794 802
795 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 803 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
796 const { 804 const {
797 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 805 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
798 } 806 }
799 807
800 } // namespace media 808 } // namespace media
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