blob: 372ab73e8dadc0db43e9d9e431945242e70fdee6 [file] [log] [blame]
// 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 "cobalt/media/base/mime_util.h"
#include "base/lazy_instance.h"
#include "cobalt/media/base/mime_util_internal.h"
namespace cobalt {
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
} // namespace cobalt