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

Unified Diff: net/base/mime_util.h

Issue 1054943004: Refactoring media mime type and supported codec checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/mime_util.cc » ('j') | net/base/mime_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_util.h
diff --git a/net/base/mime_util.h b/net/base/mime_util.h
index 80f440ef3e0adc990e121c2f4a608e40608f7e87..06b918ff05a2bfe262db65c8ed7416fb7118c656 100644
--- a/net/base/mime_util.h
+++ b/net/base/mime_util.h
@@ -20,6 +20,7 @@
#include <string>
#include <vector>
+#include "base/callback.h"
#include "base/files/file_path.h"
#include "net/base/net_export.h"
@@ -93,6 +94,20 @@ NET_EXPORT void ParseCodecString(const std::string& codecs,
std::vector<std::string>* codecs_out,
bool strip);
+// Returns true if the given |codec_id|, identified by a codec id string
+// described in RFC 6381, is supported. Returns false if the codec id is not
+// recognized or if that codec is not supported.
+NET_EXPORT bool IsCodecSupported(const std::string& codec_id);
+
+// The default implementation of IsCodecSupported, it can be overridden by
+// providing a custom callback via SetIsCodecSupportedCB.
+NET_EXPORT bool DefaultIsCodecSupported(const std::string& codec_id);
+
+// Provides a custom, platform-specific implementation of IsCodecSupported.
+typedef base::Callback<bool(const std::string&)> IsCodecSupportedCB;
+NET_EXPORT void SetIsCodecSupportedCB(
+ const IsCodecSupportedCB& is_codec_supported_cb);
+
// Check to see if a particular MIME type is in our list which only supports a
// certain subset of codecs.
NET_EXPORT bool IsStrictMediaMimeType(const std::string& mime_type);
« no previous file with comments | « no previous file | net/base/mime_util.cc » ('j') | net/base/mime_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698