summaryrefslogtreecommitdiff
path: root/chromium/media/base/mime_util.cc
blob: 6eba4fc70b70bf5485708538558659fc858612e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/base/mime_util.h"

#include "base/lazy_instance.h"
#include "media/base/mime_util_internal.h"

namespace media {

// This variable is Leaky because it is accessed from WorkerPool threads.
static base::LazyInstance<internal::MimeUtil>::Leaky g_media_mime_util =
    LAZY_INSTANCE_INITIALIZER;

bool IsSupportedMediaMimeType(const std::string& mime_type) {
  return g_media_mime_util.Pointer()->IsSupportedMediaMimeType(mime_type);
}

SupportsType IsSupportedMediaFormat(const std::string& mime_type,
                                    const std::vector<std::string>& codecs) {
  return g_media_mime_util.Pointer()->IsSupportedMediaFormat(mime_type, codecs,
                                                             false);
}

SupportsType IsSupportedEncryptedMediaFormat(
    const std::string& mime_type,
    const std::vector<std::string>& codecs) {
  return g_media_mime_util.Pointer()->IsSupportedMediaFormat(mime_type, codecs,
                                                             true);
}

void ParseCodecString(const std::string& codecs,
                      std::vector<std::string>* codecs_out,
                      bool strip) {
  g_media_mime_util.Pointer()->ParseCodecString(codecs, codecs_out, strip);
}

void RemoveProprietaryMediaTypesAndCodecsForTests() {
  g_media_mime_util.Pointer()->RemoveProprietaryMediaTypesAndCodecs();
}

}  // namespace media