OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
ddorwin
2015/05/08 16:29:18
We should probably keep the year from the other fi
servolk
2015/05/08 17:33:05
Done.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_BASE_MIME_UTIL_H__ | |
6 #define MEDIA_BASE_MIME_UTIL_H__ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "media/base/media_export.h" | |
12 | |
13 namespace media { | |
ddorwin
2015/05/08 16:29:18
I'm assuming everything below was copied without c
servolk
2015/05/08 17:33:05
Yes, the very first patchset was simple copy, in l
| |
14 | |
15 // Check to see if a particular MIME type is in the list of | |
ddorwin
2015/05/08 16:29:18
In a future CL, we need to update these comments t
servolk
2015/05/08 17:33:05
Yeah, and since it lives under media/ now, it will
| |
16 // supported/recognized MIME types. | |
17 MEDIA_EXPORT bool IsSupportedMediaMimeType(const std::string& mime_type); | |
18 | |
19 // Returns true if and only if all codecs are supported, false otherwise. | |
20 MEDIA_EXPORT bool AreSupportedMediaCodecs( | |
21 const std::vector<std::string>& codecs); | |
22 | |
23 // Parses a codec string, populating |codecs_out| with the prefix of each codec | |
24 // in the string |codecs_in|. For example, passed "aaa.b.c,dd.eee", if | |
25 // |strip| == true |codecs_out| will contain {"aaa", "dd"}, if |strip| == false | |
26 // |codecs_out| will contain {"aaa.b.c", "dd.eee"}. | |
27 // See http://www.ietf.org/rfc/rfc4281.txt. | |
28 MEDIA_EXPORT void ParseCodecString(const std::string& codecs, | |
29 std::vector<std::string>* codecs_out, | |
30 bool strip); | |
31 | |
32 // Check to see if a particular MIME type is in our list which only supports a | |
33 // certain subset of codecs. | |
34 MEDIA_EXPORT bool IsStrictMediaMimeType(const std::string& mime_type); | |
35 | |
36 // Indicates that the MIME type and (possible codec string) are supported by the | |
37 // underlying platform. | |
38 enum SupportsType { | |
39 // The underlying platform is known not to support the given MIME type and | |
40 // codec combination. | |
41 IsNotSupported, | |
42 | |
43 // The underlying platform is known to support the given MIME type and codec | |
44 // combination. | |
45 IsSupported, | |
46 | |
47 // The underlying platform is unsure whether the given MIME type and codec | |
48 // combination can be rendered or not before actually trying to play it. | |
49 MayBeSupported | |
50 }; | |
51 | |
52 // Checks the |mime_type| and |codecs| against the MIME types known to support | |
53 // only a particular subset of codecs. | |
54 // * Returns IsSupported if the |mime_type| is supported and all the codecs | |
55 // within the |codecs| are supported for the |mime_type|. | |
56 // * Returns MayBeSupported if the |mime_type| is supported and is known to | |
57 // support only a subset of codecs, but |codecs| was empty. Also returned if | |
58 // all the codecs in |codecs| are supported, but additional codec parameters | |
59 // were supplied (such as profile) for which the support cannot be decided. | |
60 // * Returns IsNotSupported if either the |mime_type| is not supported or the | |
61 // |mime_type| is supported but at least one of the codecs within |codecs| is | |
62 // not supported for the |mime_type|. | |
63 MEDIA_EXPORT SupportsType IsSupportedStrictMediaMimeType( | |
64 const std::string& mime_type, | |
65 const std::vector<std::string>& codecs); | |
66 | |
67 // Test only method that removes proprietary media types and codecs from the | |
68 // list of supported MIME types and codecs. These types and codecs must be | |
69 // removed to ensure consistent layout test results across all Chromium | |
70 // variations. | |
71 MEDIA_EXPORT void RemoveProprietaryMediaTypesAndCodecsForTests(); | |
72 | |
73 } // namespace media | |
74 | |
75 #endif // MEDIA_BASE_MIME_UTIL_H__ | |
76 | |
OLD | NEW |