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

Unified Diff: media/base/pipeline_impl.h

Issue 8399023: Fire canplaythrough event at the proper time for audio/video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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 | « media/base/pipeline.h ('k') | media/base/pipeline_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_impl.h
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h
index 084e1cdc4dd4d8262ed8b5b984f2e7ae888420dc..57f8aebda2d75c85118f2cadd3b97ffe70bc3475 100644
--- a/media/base/pipeline_impl.h
+++ b/media/base/pipeline_impl.h
@@ -23,6 +23,7 @@
#include "media/base/clock.h"
#include "media/base/composite_filter.h"
#include "media/base/demuxer.h"
+#include "media/base/download_rate_monitor.h"
#include "media/base/filter_host.h"
#include "media/base/pipeline.h"
#include "ui/gfx/size.h"
@@ -261,7 +262,7 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public FilterHost {
void NotifyEndedTask();
// Carries out handling a notification of network event.
- void NotifyNetworkEventTask(bool is_downloading_data);
+ void NotifyNetworkEventTask(NetworkEvent type);
// Carries out disabling the audio renderer.
void DisableAudioRendererTask();
@@ -334,6 +335,14 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public FilterHost {
void OnAudioUnderflow();
+ // Called when |download_rate_monitor_| believes that the media can
+ // be played through without needing to pause to buffer.
+ void OnCanPlayThrough();
+
+ // Carries out the notification that the media can be played through without
+ // needing to pause to buffer.
+ void NotifyCanPlayThrough();
+
// Message loop used to execute pipeline tasks.
MessageLoop* message_loop_;
@@ -479,6 +488,12 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public FilterHost {
// reaches "kStarted", at which point it is used & zeroed out.
base::Time creation_time_;
+ // Approximates the rate at which the media is being downloaded.
+ DownloadRateMonitor download_rate_monitor_;
+
+ // True if the pipeline is actively downloading bytes, false otherwise.
+ bool is_downloading_data_;
+
FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime);
DISALLOW_COPY_AND_ASSIGN(PipelineImpl);
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698