| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |