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

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

Issue 2624053002: MediaRecorder: use VideoTrackRecorder::GetPreferredCodecId() when available (Closed)
Patch Set: emircan@ comments Created 3 years, 11 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
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 cea6710b159b6332dcdd7feea700c524ba27d134..7122a54b0f845c91385ab68215247b2d5a3b3054 100644
--- a/content/renderer/media/media_recorder_handler.cc
+++ b/content/renderer/media/media_recorder_handler.cc
@@ -42,6 +42,8 @@ media::VideoCodec CodecIdToMediaVideoCodec(VideoTrackRecorder::CodecId id) {
return media::kCodecVP9;
case VideoTrackRecorder::CodecId::H264:
return media::kCodecH264;
+ case VideoTrackRecorder::CodecId::LAST:
+ return media::kUnknownVideoCodec;
}
NOTREACHED() << "Unsupported codec";
return media::kUnknownVideoCodec;
@@ -119,8 +121,7 @@ bool MediaRecorderHandler::initialize(
UpdateWebRTCMethodCount(WEBKIT_MEDIA_STREAM_RECORDER);
if (!canSupportMimeType(type, codecs)) {
- DLOG(ERROR) << "Can't support " << type.utf8()
- << ";codecs=" << codecs.utf8();
+ DLOG(ERROR) << "Unsupported " << type.utf8() << ";codecs=" << codecs.utf8();
return false;
}
@@ -136,6 +137,11 @@ bool MediaRecorderHandler::initialize(
else if (codecs_str.find("avc1") != std::string::npos)
codec_id_ = VideoTrackRecorder::CodecId::H264;
#endif
+ else
+ codec_id_ = VideoTrackRecorder::GetPreferredCodecId();
chfremer 2017/01/11 23:24:55 Use of a static method is probably considered okay
mcasas 2017/01/12 00:20:54 Hmm given that the whole testing of this code is a
+
+ DVLOG_IF(1, codecs_str.empty()) << "Falling back to preferred codec id "
+ << static_cast<int>(codec_id_);
media_stream_ = media_stream;
DCHECK(client);
« no previous file with comments | « no previous file | content/renderer/media/video_track_recorder.h » ('j') | content/renderer/media/video_track_recorder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698