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

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

Issue 2086263003: Merge M52: "GpuVideoDecoder should reject playback of videos with alpha channel." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 5 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 << "GVD with config: " << config.AsHumanReadableString(); 175 << "GVD with config: " << config.AsHumanReadableString();
176 176
177 // TODO(posciak): destroy and create a new VDA on codec/profile change 177 // TODO(posciak): destroy and create a new VDA on codec/profile change
178 // (http://crbug.com/260224). 178 // (http://crbug.com/260224).
179 if (previously_initialized && (config_.profile() != config.profile())) { 179 if (previously_initialized && (config_.profile() != config.profile())) {
180 DVLOG(1) << "Codec or profile changed, cannot reinitialize."; 180 DVLOG(1) << "Codec or profile changed, cannot reinitialize.";
181 bound_init_cb.Run(false); 181 bound_init_cb.Run(false);
182 return; 182 return;
183 } 183 }
184 184
185 // TODO(sandersd): This should be moved to capabilities if we ever have a
186 // hardware decoder which supports alpha formats.
187 if (config.format() == PIXEL_FORMAT_YV12A) {
188 DVLOG(1) << "Alpha transparency formats are not supported.";
189 bound_init_cb.Run(false);
190 return;
191 }
192
185 VideoDecodeAccelerator::Capabilities capabilities = 193 VideoDecodeAccelerator::Capabilities capabilities =
186 factories_->GetVideoDecodeAcceleratorCapabilities(); 194 factories_->GetVideoDecodeAcceleratorCapabilities();
187 if (!IsProfileSupported(capabilities, config.profile(), config.coded_size(), 195 if (!IsProfileSupported(capabilities, config.profile(), config.coded_size(),
188 config.is_encrypted())) { 196 config.is_encrypted())) {
189 DVLOG(1) << "Unsupported profile " << config.profile() 197 DVLOG(1) << "Unsupported profile " << config.profile()
190 << ", unsupported coded size " << config.coded_size().ToString() 198 << ", unsupported coded size " << config.coded_size().ToString()
191 << ", or accelerator should only be used for encrypted content. " 199 << ", or accelerator should only be used for encrypted content. "
192 << " is_encrypted: " << (config.is_encrypted() ? "yes." : "no."); 200 << " is_encrypted: " << (config.is_encrypted() ? "yes." : "no.");
193 bound_init_cb.Run(false); 201 bound_init_cb.Run(false);
194 return; 202 return;
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 } 789 }
782 return false; 790 return false;
783 } 791 }
784 792
785 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() 793 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent()
786 const { 794 const {
787 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); 795 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread());
788 } 796 }
789 797
790 } // namespace media 798 } // 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