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

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

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

Powered by Google App Engine
This is Rietveld 408576698