OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 NET_BASE_MIME_UTIL_H__ | 5 #ifndef NET_BASE_MIME_UTIL_H__ |
6 #define NET_BASE_MIME_UTIL_H__ | 6 #define NET_BASE_MIME_UTIL_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Returns true if this the mime_type_pattern matches a given mime-type. | 43 // Returns true if this the mime_type_pattern matches a given mime-type. |
44 // Checks for absolute matching and wildcards. mime-types should be in | 44 // Checks for absolute matching and wildcards. mime-types should be in |
45 // lower case. | 45 // lower case. |
46 bool MatchesMimeType(const std::string &mime_type_pattern, | 46 bool MatchesMimeType(const std::string &mime_type_pattern, |
47 const std::string &mime_type); | 47 const std::string &mime_type); |
48 | 48 |
49 // Returns true if and only if all codecs are supported, false otherwise. | 49 // Returns true if and only if all codecs are supported, false otherwise. |
50 bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs); | 50 bool AreSupportedMediaCodecs(const std::vector<std::string>& codecs); |
51 | 51 |
52 // Parses a codec string, populating |codecs_out| with the prefix of each codec | 52 // Parses a codec string, populating |codecs_out| with the prefix of each codec |
53 // in the string |codecs_in|. For example, passed "aaa.b.c,dd.eee", |codecs_out| | 53 // in the string |codecs_in|. For example, passed "aaa.b.c,dd.eee", if |
54 // will contain {"aaa", "dd"}. | 54 // |strip| == true |codecs_out| will contain {"aaa", "dd"}, if |strip| == false |
| 55 // |codecs_out| will contain {"aaa.b.c", "dd.eee"}. |
55 // See http://www.ietf.org/rfc/rfc4281.txt. | 56 // See http://www.ietf.org/rfc/rfc4281.txt. |
56 void ParseCodecString(const std::string& codecs, | 57 void ParseCodecString(const std::string& codecs, |
57 std::vector<std::string>* codecs_out); | 58 std::vector<std::string>* codecs_out, |
| 59 bool strip); |
| 60 |
| 61 // Check to see if a particular MIME type is in our list which only supports a |
| 62 // certain subset of codecs. |
| 63 bool IsStrictMediaMimeType(const std::string& mime_type); |
| 64 |
| 65 // Check to see if a particular MIME type is in our list which only supports a |
| 66 // certain subset of codecs. Returns true if and only if all codecs are |
| 67 // supported for that specific MIME type, false otherwise. If this returns |
| 68 // false you will still need to check if the media MIME tpyes and codecs are |
| 69 // supported. |
| 70 bool IsSupportedStrictMediaMimeType(const std::string& mime_type, |
| 71 const std::vector<std::string>& codecs); |
58 | 72 |
59 } // namespace net | 73 } // namespace net |
60 | 74 |
61 #endif // NET_BASE_MIME_UTIL_H__ | 75 #endif // NET_BASE_MIME_UTIL_H__ |
OLD | NEW |