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

Unified Diff: content/renderer/media/android/media_source_delegate.cc

Issue 1185453004: Implemented setting memory limits through WebMediaPlayer interface Base URL: https://chromium.googlesource.com/chromium/src.git@set-mem-limits-on-demux-stream
Patch Set: int -> size_t Created 5 years, 6 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/android/media_source_delegate.cc
diff --git a/content/renderer/media/android/media_source_delegate.cc b/content/renderer/media/android/media_source_delegate.cc
index 5d4aca1baba5b880f93c415fe3e81c09a08ebc32..b3a186e877a5491e235f3d462d8247c4d1e64733 100644
--- a/content/renderer/media/android/media_source_delegate.cc
+++ b/content/renderer/media/android/media_source_delegate.cc
@@ -204,6 +204,40 @@ size_t MediaSourceDelegate::VideoDecodedByteCount() const {
return statistics_.video_bytes_decoded;
}
+size_t MediaSourceDelegate::getAudioBufferSize() const {
+ media::DemuxerStream* stream = nullptr;
+ if (chunk_demuxer_)
+ stream = chunk_demuxer_->GetStream(DemuxerStream::AUDIO);
+ if (stream)
+ return stream->GetMemoryLimit();
+ return 0;
+}
+
+void MediaSourceDelegate::setAudioBufferSize(size_t size) {
+ media::DemuxerStream* stream = nullptr;
+ if (chunk_demuxer_)
+ stream = chunk_demuxer_->GetStream(DemuxerStream::AUDIO);
+ if (stream)
+ return stream->SetMemoryLimit(size);
+}
+
+size_t MediaSourceDelegate::getVideoBufferSize() const {
+ media::DemuxerStream* stream = nullptr;
+ if (chunk_demuxer_)
+ stream = chunk_demuxer_->GetStream(DemuxerStream::VIDEO);
+ if (stream)
+ return stream->GetMemoryLimit();
+ return 0;
+}
+
+void MediaSourceDelegate::setVideoBufferSize(size_t size) {
+ media::DemuxerStream* stream = nullptr;
+ if (chunk_demuxer_)
+ stream = chunk_demuxer_->GetStream(DemuxerStream::VIDEO);
+ if (stream)
+ return stream->SetMemoryLimit(size);
+}
+
void MediaSourceDelegate::CancelPendingSeek(const base::TimeDelta& seek_time) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
DVLOG(1) << __FUNCTION__ << "(" << seek_time.InSecondsF() << ") : "

Powered by Google App Engine
This is Rietveld 408576698