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

Side by Side Diff: media/base/mime_util_internal.h

Issue 1864743002: Use codec enum values instead of strings to initialize |media_format_map_|. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enums
Patch Set: rebase Created 4 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef MEDIA_BASE_MIME_UTIL_INTERNAL_H_ 5 #ifndef MEDIA_BASE_MIME_UTIL_INTERNAL_H_
6 #define MEDIA_BASE_MIME_UTIL_INTERNAL_H_ 6 #define MEDIA_BASE_MIME_UTIL_INTERNAL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 typedef std::map<std::string, CodecEntry> StringToCodecMappings; 88 typedef std::map<std::string, CodecEntry> StringToCodecMappings;
89 89
90 // Initializes the supported media types into hash sets for faster lookup. 90 // Initializes the supported media types into hash sets for faster lookup.
91 void InitializeMimeTypeMaps(); 91 void InitializeMimeTypeMaps();
92 92
93 // Initializes the supported media formats (|media_format_map_|). 93 // Initializes the supported media formats (|media_format_map_|).
94 void AddSupportedMediaFormats(); 94 void AddSupportedMediaFormats();
95 95
96 // Adds |mime_type| with the specified codecs to |media_format_map_|. 96 // Adds |mime_type| with the specified codecs to |media_format_map_|.
97 void AddContainerWithCodecs(const std::string& mime_type, 97 void AddContainerWithCodecs(const std::string& mime_type,
98 const std::string& codecs_list, 98 const CodecSet& codecs_list,
99 bool is_proprietary_mime_type); 99 bool is_proprietary_mime_type);
100 100
101 // Returns IsSupported if all codec IDs in |codecs| are unambiguous and are 101 // Returns IsSupported if all codec IDs in |codecs| are unambiguous and are
102 // supported in |mime_type_lower_case|. MayBeSupported is returned if at least 102 // supported in |mime_type_lower_case|. MayBeSupported is returned if at least
103 // one codec ID in |codecs| is ambiguous but all the codecs are supported. 103 // one codec ID in |codecs| is ambiguous but all the codecs are supported.
104 // IsNotSupported is returned if |mime_type_lower_case| is not supported or at 104 // IsNotSupported is returned if |mime_type_lower_case| is not supported or at
105 // least one is not supported in |mime_type_lower_case|. |is_encrypted| means 105 // least one is not supported in |mime_type_lower_case|. |is_encrypted| means
106 // the codec will be used with encrypted blocks. 106 // the codec will be used with encrypted blocks.
107 SupportsType AreSupportedCodecs(const CodecSet& supported_codecs, 107 SupportsType AreSupportedCodecs(const CodecSet& supported_codecs,
108 const std::vector<std::string>& codecs, 108 const std::vector<std::string>& codecs,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // Lookup table for string compare based string -> Codec mappings. 162 // Lookup table for string compare based string -> Codec mappings.
163 StringToCodecMappings string_to_codec_map_; 163 StringToCodecMappings string_to_codec_map_;
164 164
165 DISALLOW_COPY_AND_ASSIGN(MimeUtil); 165 DISALLOW_COPY_AND_ASSIGN(MimeUtil);
166 }; 166 };
167 167
168 } // namespace internal 168 } // namespace internal
169 } // namespace media 169 } // namespace media
170 170
171 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_ 171 #endif // MEDIA_BASE_MIME_UTIL_INTERNAL_H_
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