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

Side by Side Diff: media/base/decode_capabilities.cc

Issue 2803823003: Query LibVPX for VP9 profile support.
Patch Set: Created 3 years, 8 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 | media/base/mime_util_internal.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/base/decode_capabilities.h" 5 #include "media/base/decode_capabilities.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/feature_list.h" 8 #include "base/feature_list.h"
9 #include "media/base/media_switches.h" 9 #include "media/base/media_switches.h"
10 #include "media/filters/vpx_video_decoder.h"
10 #include "ui/display/display_switches.h" 11 #include "ui/display/display_switches.h"
11 12
12 namespace media { 13 namespace media {
13 14
14 bool IsColorSpaceSupported(const media::VideoColorSpace& color_space) { 15 bool IsColorSpaceSupported(const media::VideoColorSpace& color_space) {
15 bool color_management = 16 bool color_management =
16 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR) || 17 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableHDR) ||
17 base::FeatureList::IsEnabled(media::kVideoColorManagement); 18 base::FeatureList::IsEnabled(media::kVideoColorManagement);
18 switch (color_space.primaries) { 19 switch (color_space.primaries) {
19 case media::VideoColorSpace::PrimaryID::EBU_3213_E: 20 case media::VideoColorSpace::PrimaryID::EBU_3213_E:
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 NOTREACHED(); 136 NOTREACHED();
136 return false; 137 return false;
137 } 138 }
138 139
139 // TODO(chcunningham): Query decoders for codec profile support. Add platform 140 // TODO(chcunningham): Query decoders for codec profile support. Add platform
140 // specific logic for Android (move from MimeUtilIntenral). 141 // specific logic for Android (move from MimeUtilIntenral).
141 bool IsSupportedVideoConfig(const VideoConfig& config) { 142 bool IsSupportedVideoConfig(const VideoConfig& config) {
142 switch (config.codec) { 143 switch (config.codec) {
143 case media::kCodecVP9: 144 case media::kCodecVP9:
144 // Color management required for HDR to not look terrible. 145 // Color management required for HDR to not look terrible.
145 return IsColorSpaceSupported(config.color_space); 146 return IsColorSpaceSupported(config.color_space)
147 // VP9 decoding will fall through to LibVPX.
148 && VpxVideoDecoder::IsVideoConfigSupported(config);
146 149
147 case media::kCodecH264: 150 case media::kCodecH264:
148 case media::kCodecVP8: 151 case media::kCodecVP8:
149 case media::kCodecTheora: 152 case media::kCodecTheora:
150 return true; 153 return true;
151 154
152 case media::kUnknownVideoCodec: 155 case media::kUnknownVideoCodec:
153 case media::kCodecVC1: 156 case media::kCodecVC1:
154 case media::kCodecMPEG2: 157 case media::kCodecMPEG2:
155 case media::kCodecMPEG4: 158 case media::kCodecMPEG4:
156 case media::kCodecHEVC: 159 case media::kCodecHEVC:
157 case media::kCodecDolbyVision: 160 case media::kCodecDolbyVision:
158 return false; 161 return false;
159 } 162 }
160 163
161 NOTREACHED(); 164 NOTREACHED();
162 return false; 165 return false;
163 } 166 }
164 167
165 } // namespace media 168 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/mime_util_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698