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

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

Issue 1892673002: VideoTrackRecorder: add support for more codecs on construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: emircan@ nits Created 4 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 | content/renderer/media/video_track_recorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0beedc394745310459719b71055efe2751366f60..6d8eb4de4d3964905e695a8e9ad9c5334584c138 100644
--- a/content/renderer/media/media_recorder_handler.cc
+++ b/content/renderer/media/media_recorder_handler.cc
@@ -68,7 +68,8 @@ bool MediaRecorderHandler::canSupportMimeType(
static const char* const kVideoCodecs[] = { "vp8", "vp9", "opus" };
static const char* const kAudioCodecs[] = { "opus" };
const char* const* codecs = video ? &kVideoCodecs[0] : &kAudioCodecs[0];
- int codecs_count = video ? arraysize(kVideoCodecs) : arraysize(kAudioCodecs);
+ const int codecs_count =
+ video ? arraysize(kVideoCodecs) : arraysize(kAudioCodecs);
std::vector<std::string> codecs_list;
media::ParseCodecString(web_codecs.utf8(), &codecs_list, true /* strip */);
@@ -165,7 +166,9 @@ bool MediaRecorderHandler::start(int timeslice) {
&MediaRecorderHandler::OnEncodedVideo, weak_factory_.GetWeakPtr()));
video_recorders_.push_back(new VideoTrackRecorder(
- use_vp9_, video_track, on_encoded_video_cb, video_bits_per_second_));
+ use_vp9_ ? VideoTrackRecorder::CodecId::VP9
+ : VideoTrackRecorder::CodecId::VP8,
+ video_track, on_encoded_video_cb, video_bits_per_second_));
}
if (use_audio_tracks) {
« no previous file with comments | « no previous file | content/renderer/media/video_track_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698