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

Unified Diff: content/renderer/media/media_recorder_handler.cc

Issue 2585533002: MediaRecorder (cleanup): support mime type video/x-matroska and codec=avc1 to the list (Closed)
Patch Set: Created 4 years 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
Index: content/renderer/media/media_recorder_handler.cc
diff --git a/content/renderer/media/media_recorder_handler.cc b/content/renderer/media/media_recorder_handler.cc
index bba34682e8b8eb842697f28b3d9e165e828f2b28..c5c4ecf873e871afa26d5bed8cac94b2570c3089 100644
--- a/content/renderer/media/media_recorder_handler.cc
+++ b/content/renderer/media/media_recorder_handler.cc
@@ -74,16 +74,18 @@ bool MediaRecorderHandler::canSupportMimeType(
return true;
const std::string type(web_type.utf8());
- const bool video = base::EqualsCaseInsensitiveASCII(type, "video/webm");
+ const bool video = base::EqualsCaseInsensitiveASCII(type, "video/webm") ||
+ base::EqualsCaseInsensitiveASCII(type, "video/x-matroska");
const bool audio =
video ? false : base::EqualsCaseInsensitiveASCII(type, "audio/webm");
if (!video && !audio)
return false;
// Both |video| and |audio| support empty |codecs|; |type| == "video" supports
- // vp8, vp9 or opus; |type| = "audio", supports only opus.
+ // vp8, vp9, h264 and avc1 or opus; |type| = "audio", supports only opus.
// http://www.webmproject.org/docs/container Sec:"HTML5 Video Type Parameters"
- static const char* const kVideoCodecs[] = { "vp8", "vp9", "h264", "opus" };
+ static const char* const kVideoCodecs[] = {"vp8", "vp9", "h264", "avc1",
+ "opus"};
static const char* const kAudioCodecs[] = { "opus" };
const char* const* codecs = video ? &kVideoCodecs[0] : &kAudioCodecs[0];
const int codecs_count =
@@ -129,6 +131,8 @@ bool MediaRecorderHandler::initialize(
#if BUILDFLAG(RTC_USE_H264)
else if (codecs_str.find("h264") != std::string::npos)
codec_id_ = VideoTrackRecorder::CodecId::H264;
+ else if (codecs_str.find("avc1") != std::string::npos)
+ codec_id_ = VideoTrackRecorder::CodecId::H264;
#endif
media_stream_ = media_stream;
« no previous file with comments | « content/browser/webrtc/webrtc_media_recorder_browsertest.cc ('k') | content/test/data/media/mediarecorder_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698