| Index: media/filters/gpu_video_decoder.cc
|
| diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
|
| index b7229f00124e94c3c77d383ed47639b94336984f..9b456623e4ee52c875c8ed5d8a3818e1552e4f57 100644
|
| --- a/media/filters/gpu_video_decoder.cc
|
| +++ b/media/filters/gpu_video_decoder.cc
|
| @@ -68,6 +68,7 @@ GpuVideoDecoder::GpuVideoDecoder(GpuVideoAcceleratorFactories* factories)
|
| next_picture_buffer_id_(0),
|
| next_bitstream_buffer_id_(0),
|
| available_pictures_(0),
|
| + can_stall_anytime_(false),
|
| weak_factory_(this) {
|
| DCHECK(factories_);
|
| }
|
| @@ -154,7 +155,10 @@ void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config,
|
| return;
|
| }
|
|
|
| - if (!IsProfileSupported(config.profile(), config.coded_size())) {
|
| + VideoDecodeAccelerator::Capabilities capabilities =
|
| + factories_->GetVideoDecodeAcceleratorCapabilities();
|
| + if (!IsProfileSupported(capabilities, config.profile(),
|
| + config.coded_size())) {
|
| DVLOG(1) << "Profile " << config.profile() << " or coded size "
|
| << config.coded_size().ToString() << " not supported.";
|
| bound_init_cb.Run(false);
|
| @@ -162,6 +166,8 @@ void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config,
|
| }
|
|
|
| config_ = config;
|
| + can_stall_anytime_ = capabilities.flags &
|
| + VideoDecodeAccelerator::Capabilities::kCanStallAnytime;
|
| needs_bitstream_conversion_ = (config.codec() == kCodecH264);
|
| output_cb_ = BindToCurrentLoop(output_cb);
|
|
|
| @@ -351,9 +357,9 @@ bool GpuVideoDecoder::NeedsBitstreamConversion() const {
|
|
|
| bool GpuVideoDecoder::CanReadWithoutStalling() const {
|
| DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
|
| - return
|
| - next_picture_buffer_id_ == 0 || // Decode() will ProvidePictureBuffers().
|
| - available_pictures_ > 0;
|
| + return next_picture_buffer_id_ ==
|
| + 0 || // Decode() will ProvidePictureBuffers().
|
| + (!can_stall_anytime_ && available_pictures_ > 0);
|
| }
|
|
|
| int GpuVideoDecoder::GetMaxDecodeRequests() const {
|
| @@ -640,11 +646,13 @@ void GpuVideoDecoder::NotifyError(media::VideoDecodeAccelerator::Error error) {
|
| DestroyVDA();
|
| }
|
|
|
| -bool GpuVideoDecoder::IsProfileSupported(VideoCodecProfile profile,
|
| - const gfx::Size& coded_size) {
|
| +bool GpuVideoDecoder::IsProfileSupported(
|
| + const VideoDecodeAccelerator::Capabilities& capabilities,
|
| + VideoCodecProfile profile,
|
| + const gfx::Size& coded_size) {
|
| DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent();
|
| - VideoDecodeAccelerator::SupportedProfiles supported_profiles =
|
| - factories_->GetVideoDecodeAcceleratorSupportedProfiles();
|
| + const VideoDecodeAccelerator::SupportedProfiles& supported_profiles =
|
| + capabilities.supported_profiles;
|
| for (const auto& supported_profile : supported_profiles) {
|
| if (profile == supported_profile.profile) {
|
| return IsCodedSizeSupported(coded_size,
|
|
|