OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 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 { |
| 14 |
| 15 MEDIA_EXPORT bool IsSupportedMediaMimeType(const std::string& mime_type); |
| 16 |
| 17 // Returns true if and only if all codecs are supported, false otherwise. |
| 18 MEDIA_EXPORT bool AreSupportedMediaCodecs( |
| 19 const std::vector<std::string>& codecs); |
| 20 |
| 21 // Parses a codec string, populating |codecs_out| with the prefix of each codec |
| 22 // in the string |codecs_in|. For example, passed "aaa.b.c,dd.eee", if |
| 23 // |strip| == true |codecs_out| will contain {"aaa", "dd"}, if |strip| == false |
| 24 // |codecs_out| will contain {"aaa.b.c", "dd.eee"}. |
| 25 // See http://www.ietf.org/rfc/rfc4281.txt. |
| 26 MEDIA_EXPORT void ParseCodecString(const std::string& codecs, |
| 27 std::vector<std::string>* codecs_out, |
| 28 bool strip); |
| 29 |
| 30 // Check to see if a particular MIME type is in our list which only supports a |
| 31 // certain subset of codecs. |
| 32 MEDIA_EXPORT bool IsStrictMediaMimeType(const std::string& mime_type); |
| 33 |
| 34 // Indicates that the MIME type and (possible codec string) are supported by the |
| 35 // underlying platform. |
| 36 enum SupportsType { |
| 37 // The underlying platform is known not to support the given MIME type and |
| 38 // codec combination. |
| 39 IsNotSupported, |
| 40 |
| 41 // The underlying platform is known to support the given MIME type and codec |
| 42 // combination. |
| 43 IsSupported, |
| 44 |
| 45 // The underlying platform is unsure whether the given MIME type and codec |
| 46 // combination can be rendered or not before actually trying to play it. |
| 47 MayBeSupported |
| 48 }; |
| 49 |
| 50 // Checks the |mime_type| and |codecs| against the MIME types known to support |
| 51 // only a particular subset of codecs. |
| 52 // * Returns IsSupported if the |mime_type| is supported and all the codecs |
| 53 // within the |codecs| are supported for the |mime_type|. |
| 54 // * Returns MayBeSupported if the |mime_type| is supported and is known to |
| 55 // support only a subset of codecs, but |codecs| was empty. Also returned if |
| 56 // all the codecs in |codecs| are supported, but additional codec parameters |
| 57 // were supplied (such as profile) for which the support cannot be decided. |
| 58 // * Returns IsNotSupported if either the |mime_type| is not supported or the |
| 59 // |mime_type| is supported but at least one of the codecs within |codecs| is |
| 60 // not supported for the |mime_type|. |
| 61 MEDIA_EXPORT SupportsType IsSupportedStrictMediaMimeType( |
| 62 const std::string& mime_type, |
| 63 const std::vector<std::string>& codecs); |
| 64 |
| 65 // Test only method that removes proprietary media types and codecs from the |
| 66 // list of supported MIME types and codecs. These types and codecs must be |
| 67 // removed to ensure consistent layout test results across all Chromium |
| 68 // variations. |
| 69 MEDIA_EXPORT void RemoveProprietaryMediaTypesAndCodecsForTests(); |
| 70 |
| 71 } // namespace media |
| 72 |
| 73 #endif // MEDIA_BASE_MIME_UTIL_H__ |
OLD | NEW |