From 02022fc1935970dfc2690eb150cbb0ab304d54ed Mon Sep 17 00:00:00 2001 From: "sandersd@chromium.org" Date: Fri, 16 May 2014 00:05:31 +0000 Subject: Add return-by-value implementations of blink::WebMediaPlayer::buffered() This prep work will allow the interface in blink to be changed. Blink change is https://codereview.chromium.org/284143002/. BUG=360254 Review URL: https://codereview.chromium.org/282073003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270870 0039d316-1c4b-4281-b951-d872f2087c98 --- content/renderer/media/android/media_source_delegate.cc | 4 ++++ content/renderer/media/android/media_source_delegate.h | 1 + content/renderer/media/android/webmediaplayer_android.cc | 6 ++++++ content/renderer/media/android/webmediaplayer_android.h | 1 + content/renderer/media/buffered_data_source_host_impl.cc | 2 +- content/renderer/media/buffered_data_source_host_impl.h | 3 ++- content/renderer/media/webmediaplayer_impl.cc | 9 +++++++++ content/renderer/media/webmediaplayer_impl.h | 1 + content/renderer/media/webmediaplayer_ms.cc | 5 +++++ content/renderer/media/webmediaplayer_ms.h | 1 + media/base/pipeline.cc | 2 +- media/base/pipeline.h | 2 +- 12 files changed, 33 insertions(+), 4 deletions(-) diff --git a/content/renderer/media/android/media_source_delegate.cc b/content/renderer/media/android/media_source_delegate.cc index 6b6523c..bd786b0 100644 --- a/content/renderer/media/android/media_source_delegate.cc +++ b/content/renderer/media/android/media_source_delegate.cc @@ -190,6 +190,10 @@ const blink::WebTimeRanges& MediaSourceDelegate::Buffered() { return buffered_web_time_ranges_; } +blink::WebTimeRanges MediaSourceDelegate::Buffered() const { + return ConvertToWebTimeRanges(buffered_time_ranges_); +} + size_t MediaSourceDelegate::DecodedFrameCount() const { return statistics_.video_frames_decoded; } diff --git a/content/renderer/media/android/media_source_delegate.h b/content/renderer/media/android/media_source_delegate.h index 4480a45..75de676 100644 --- a/content/renderer/media/android/media_source_delegate.h +++ b/content/renderer/media/android/media_source_delegate.h @@ -68,6 +68,7 @@ class MediaSourceDelegate : public media::DemuxerHost { const DurationChangeCB& duration_change_cb); const blink::WebTimeRanges& Buffered(); + blink::WebTimeRanges Buffered() const; size_t DecodedFrameCount() const; size_t DroppedFrameCount() const; size_t AudioDecodedByteCount() const; diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc index 3fe6c2e..fbee409 100644 --- a/content/renderer/media/android/webmediaplayer_android.cc +++ b/content/renderer/media/android/webmediaplayer_android.cc @@ -440,6 +440,12 @@ const WebTimeRanges& WebMediaPlayerAndroid::buffered() { return buffered_; } +WebTimeRanges WebMediaPlayerAndroid::buffered() const { + if (media_source_delegate_) + return media_source_delegate_->Buffered(); + return buffered_; +} + double WebMediaPlayerAndroid::maxTimeSeekable() const { // If we haven't even gotten to ReadyStateHaveMetadata yet then just // return 0 so that the seekable range is empty. diff --git a/content/renderer/media/android/webmediaplayer_android.h b/content/renderer/media/android/webmediaplayer_android.h index 46142df..587e54c 100644 --- a/content/renderer/media/android/webmediaplayer_android.h +++ b/content/renderer/media/android/webmediaplayer_android.h @@ -99,6 +99,7 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer, virtual void setRate(double rate); virtual void setVolume(double volume); virtual const blink::WebTimeRanges& buffered(); + virtual blink::WebTimeRanges buffered() const; virtual double maxTimeSeekable() const; // Poster image, as defined in the