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

Unified Diff: media/base/mime_util.h

Issue 2864593003: Add MimeUtil::Parse{Audio|Video}CodecString (Closed)
Patch Set: Feedback && Proprietary Codecs fix && Rebase Created 3 years, 7 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 | « media/base/media.cc ('k') | media/base/mime_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mime_util.h
diff --git a/media/base/mime_util.h b/media/base/mime_util.h
index d7a39f41a959dc2045d2addab12cbb2045b53be2..0ff67036d80d8837fd5d966adc10345f009505b6 100644
--- a/media/base/mime_util.h
+++ b/media/base/mime_util.h
@@ -8,7 +8,9 @@
#include <string>
#include <vector>
+#include "media/base/audio_codecs.h"
#include "media/base/media_export.h"
+#include "media/base/video_codecs.h"
namespace media {
@@ -25,6 +27,31 @@ MEDIA_EXPORT void SplitCodecsToVector(const std::string& codecs,
std::vector<std::string>* codecs_out,
bool strip);
+// Returns true if successfully parsed the given |mime_type| and |codec_id|,
+// setting |out_*| arguments to the parsed video codec, profile, and level.
+// |out_is_ambiguous| will be true when the codec string is incomplete such that
+// some guessing was required to decide the codec, profile, or level.
+// Returns false if parsing fails (invalid string, or unrecognized video codec),
+// in which case values for |out_*| arguments are undefined.
+MEDIA_EXPORT bool ParseVideoCodecString(const std::string& mime_type,
+ const std::string& codec_id,
+ bool* out_is_ambiguous,
+ VideoCodec* out_codec,
+ VideoCodecProfile* out_profile,
+ uint8_t* out_level,
+ VideoColorSpace* out_colorspace);
+
+// Returns true if successfully parsed the given |mime_type| and |codec_id|,
+// setting |out_audio_codec| to found codec. |out_is_ambiguous| will be true
+// when the codec string is incomplete such that some guessing was required to
+// decide the codec.
+// Returns false if parsing fails (invalid string, or unrecognized audio codec),
+// in which case values for |out_*| arguments are undefined.
+MEDIA_EXPORT bool ParseAudioCodecString(const std::string& mime_type,
+ const std::string& codec_id,
+ bool* out_is_ambiguous,
+ AudioCodec* out_codec);
+
// Indicates that the MIME type and (possible codec string) are supported.
enum SupportsType {
// The given MIME type and codec combination is not supported.
« no previous file with comments | « media/base/media.cc ('k') | media/base/mime_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698