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

Unified Diff: media/filters/media_source_state.cc

Issue 2170303002: Make MSE buffer sizes configurable via command line (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« media/base/media_switches.h ('K') | « media/base/media_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/media_source_state.cc
diff --git a/media/filters/media_source_state.cc b/media/filters/media_source_state.cc
index 154ce167bc4bd31272880dfb4bba528d236d4fdc..bee924bdad8262fa4a13a0c23a50c2e723b55b96 100644
--- a/media/filters/media_source_state.cc
+++ b/media/filters/media_source_state.cc
@@ -5,7 +5,10 @@
#include "media/filters/media_source_state.h"
#include "base/callback_helpers.h"
+#include "base/command_line.h"
#include "base/stl_util.h"
+#include "base/strings/string_number_conversions.h"
+#include "media/base/media_switches.h"
#include "media/base/media_track.h"
#include "media/base/media_tracks.h"
#include "media/filters/chunk_demuxer.h"
@@ -581,6 +584,15 @@ bool MediaSourceState::OnNewConfigs(
return false;
}
+ std::string audioBufferSwitchStr =
wolenetz 2016/07/28 17:55:08 nit: I think the convention is to first check HasS
servolk 2016/07/28 21:46:46 This comment seems to imply that it's unnecessary:
wolenetz 2016/07/28 23:02:15 Acknowledged.
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kMSEAudioBufferSize);
+ unsigned mseAudioBufferSize = 0;
+ if (base::StringToUint(audioBufferSwitchStr, &mseAudioBufferSize) &&
+ mseAudioBufferSize > 0) {
+ audio_->SetStreamMemoryLimit(mseAudioBufferSize);
wolenetz 2016/07/28 17:55:08 nit: Please add a MEDIA_LOG either here, or perhap
servolk 2016/07/28 21:46:46 Done.
+ }
+
if (!frame_processor_->AddTrack(FrameProcessor::kAudioTrackId, audio_)) {
DVLOG(1) << "Failed to add audio track to frame processor.";
return false;
@@ -609,6 +621,15 @@ bool MediaSourceState::OnNewConfigs(
return false;
}
+ std::string videoBufferSwitchStr =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kMSEVideoBufferSize);
+ unsigned mseVideoBufferSize = 0;
+ if (base::StringToUint(videoBufferSwitchStr, &mseVideoBufferSize) &&
+ mseVideoBufferSize > 0) {
+ video_->SetStreamMemoryLimit(mseVideoBufferSize);
+ }
+
if (!frame_processor_->AddTrack(FrameProcessor::kVideoTrackId, video_)) {
DVLOG(1) << "Failed to add video track to frame processor.";
return false;
« media/base/media_switches.h ('K') | « media/base/media_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698