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/base/decode_capabilities.cc

Issue 2783963002: Add IsSupportedAudioConfig in MediaClient (Closed)
Patch Set: Update MediaCanPlayTypeTest 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 | « media/base/decode_capabilities.h ('k') | media/base/key_systems_unittest.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 "ui/display/display_switches.h" 10 #include "ui/display/display_switches.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 case media::VideoColorSpace::MatrixID::INVALID: 95 case media::VideoColorSpace::MatrixID::INVALID:
96 return false; 96 return false;
97 } 97 }
98 98
99 if (color_space.range == gfx::ColorSpace::RangeID::INVALID) 99 if (color_space.range == gfx::ColorSpace::RangeID::INVALID)
100 return false; 100 return false;
101 101
102 return true; 102 return true;
103 } 103 }
104 104
105 bool IsSupportedAudioConfig(const AudioConfig& config) {
chcunningham 2017/03/30 18:09:04 This is fine for now, but I'll note some things fo
servolk 2017/03/30 18:16:43 Acknowledged.
106 switch (config.codec) {
107 case media::kCodecAAC:
108 case media::kCodecMP3:
109 case media::kCodecPCM:
110 case media::kCodecVorbis:
111 case media::kCodecFLAC:
112 case media::kCodecAMR_NB:
113 case media::kCodecAMR_WB:
114 case media::kCodecPCM_MULAW:
chcunningham 2017/03/30 18:09:04 Can you group all the PCM codecs together?
servolk 2017/03/30 18:16:43 Done.
115 case media::kCodecGSM_MS:
chcunningham 2017/03/30 18:09:04 Can you move the GSM and AMR codecs into a separat
servolk 2017/03/30 18:16:43 Done.
116 case media::kCodecPCM_S16BE:
117 case media::kCodecPCM_S24BE:
118 case media::kCodecOpus:
119 case media::kCodecPCM_ALAW:
120 return true;
121
122 case media::kCodecEAC3:
123 case media::kCodecALAC:
124 case media::kCodecAC3:
125 case media::kUnknownAudioCodec:
126 return false;
127 }
128
129 NOTREACHED();
130 return false;
131 }
132
105 // TODO(chcunningham): Query decoders for codec profile support. Add platform 133 // TODO(chcunningham): Query decoders for codec profile support. Add platform
106 // specific logic for Android (move from MimeUtilIntenral). 134 // specific logic for Android (move from MimeUtilIntenral).
107 bool IsSupportedVideoConfig(const VideoConfig& config) { 135 bool IsSupportedVideoConfig(const VideoConfig& config) {
108 switch (config.codec) { 136 switch (config.codec) {
109 case media::kCodecVP9: 137 case media::kCodecVP9:
110 // Color management required for HDR to not look terrible. 138 // Color management required for HDR to not look terrible.
111 return IsColorSpaceSupported(config.color_space); 139 return IsColorSpaceSupported(config.color_space);
112 140
113 case media::kCodecH264: 141 case media::kCodecH264:
114 case media::kCodecVP8: 142 case media::kCodecVP8:
115 case media::kCodecTheora: 143 case media::kCodecTheora:
116 return true; 144 return true;
117 145
118 case media::kUnknownVideoCodec: 146 case media::kUnknownVideoCodec:
119 case media::kCodecVC1: 147 case media::kCodecVC1:
120 case media::kCodecMPEG2: 148 case media::kCodecMPEG2:
121 case media::kCodecMPEG4: 149 case media::kCodecMPEG4:
122 case media::kCodecHEVC: 150 case media::kCodecHEVC:
123 case media::kCodecDolbyVision: 151 case media::kCodecDolbyVision:
124 return false; 152 return false;
125 } 153 }
126 154
127 NOTREACHED(); 155 NOTREACHED();
128 return false; 156 return false;
129 } 157 }
130 158
131 } // namespace media 159 } // namespace media
OLDNEW
« no previous file with comments | « media/base/decode_capabilities.h ('k') | media/base/key_systems_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698