OLD | NEW |
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 #include "media/base/mime_util.h" | 5 #include "media/base/mime_util.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "media/base/mime_util_internal.h" | 8 #include "media/base/mime_util_internal.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 | 11 |
12 // This variable is Leaky because it is accessed from WorkerPool threads. | 12 // This variable is Leaky because it is accessed from WorkerPool threads. |
13 static base::LazyInstance<internal::MimeUtil>::Leaky g_media_mime_util = | 13 static base::LazyInstance<internal::MimeUtil>::Leaky g_media_mime_util = |
14 LAZY_INSTANCE_INITIALIZER; | 14 LAZY_INSTANCE_INITIALIZER; |
15 | 15 |
16 bool IsSupportedMediaMimeType(const std::string& mime_type) { | 16 bool IsSupportedMediaMimeType(const std::string& mime_type) { |
17 return g_media_mime_util.Pointer()->IsSupportedMediaMimeType(mime_type); | 17 return g_media_mime_util.Pointer()->IsSupportedMediaMimeType(mime_type); |
18 } | 18 } |
19 | 19 |
20 SupportsType IsSupportedMediaFormat(const std::string& mime_type, | 20 SupportsType IsSupportedMediaFormat(const std::string& mime_type, |
21 const std::vector<std::string>& codecs) { | 21 const std::vector<std::string>& codecs) { |
22 return g_media_mime_util.Pointer()->IsSupportedMediaFormat(mime_type, codecs); | 22 return g_media_mime_util.Pointer()->IsSupportedMediaFormat(mime_type, codecs, |
| 23 false); |
| 24 } |
| 25 |
| 26 SupportsType IsSupportedEncryptedMediaFormat( |
| 27 const std::string& mime_type, |
| 28 const std::vector<std::string>& codecs) { |
| 29 return g_media_mime_util.Pointer()->IsSupportedMediaFormat(mime_type, codecs, |
| 30 true); |
23 } | 31 } |
24 | 32 |
25 void ParseCodecString(const std::string& codecs, | 33 void ParseCodecString(const std::string& codecs, |
26 std::vector<std::string>* codecs_out, | 34 std::vector<std::string>* codecs_out, |
27 bool strip) { | 35 bool strip) { |
28 g_media_mime_util.Pointer()->ParseCodecString(codecs, codecs_out, strip); | 36 g_media_mime_util.Pointer()->ParseCodecString(codecs, codecs_out, strip); |
29 } | 37 } |
30 | 38 |
31 void RemoveProprietaryMediaTypesAndCodecsForTests() { | 39 void RemoveProprietaryMediaTypesAndCodecsForTests() { |
32 g_media_mime_util.Pointer()->RemoveProprietaryMediaTypesAndCodecs(); | 40 g_media_mime_util.Pointer()->RemoveProprietaryMediaTypesAndCodecs(); |
33 } | 41 } |
34 | 42 |
35 } // namespace media | 43 } // namespace media |
OLD | NEW |