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

Unified Diff: media/base/pipeline_impl.h

Issue 269002: Report stalled event correctly for <video> (Closed)
Patch Set: comments Created 11 years, 2 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: media/base/pipeline_impl.h
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h
index 891404a893a32ab2d007e00ee5af64d02528e142..92eceaa4b84c3b5f5eac21b584bdeeb40080aab7 100644
--- a/media/base/pipeline_impl.h
+++ b/media/base/pipeline_impl.h
@@ -72,6 +72,7 @@ class PipelineImpl : public Pipeline, public FilterHost {
virtual void Seek(base::TimeDelta time, PipelineCallback* seek_callback);
virtual bool IsRunning() const;
virtual bool IsInitialized() const;
+ virtual bool IsNetworkActive() const;
virtual bool IsRendered(const std::string& major_mime_type) const;
virtual float GetPlaybackRate() const;
virtual void SetPlaybackRate(float playback_rate);
@@ -96,6 +97,9 @@ class PipelineImpl : public Pipeline, public FilterHost {
// of |error_callback|.
virtual void SetPipelineErrorCallback(PipelineCallback* error_callback);
+ // |network_callback_| will be executed when there's a network event.
+ virtual void SetNetworkEventCallback(PipelineCallback* network_callback);
+
private:
// Pipeline states, as described above.
enum State {
@@ -145,6 +149,7 @@ class PipelineImpl : public Pipeline, public FilterHost {
virtual void SetVideoSize(size_t width, size_t height);
virtual void SetStreaming(bool streamed);
virtual void SetLoaded(bool loaded);
+ virtual void SetNetworkActivity(bool network_activity);
virtual void NotifyEnded();
virtual void BroadcastMessage(FilterMessage message);
@@ -194,6 +199,9 @@ class PipelineImpl : public Pipeline, public FilterHost {
// Carries out handling a notification from a filter that it has ended.
void NotifyEndedTask();
+ // Carries out handling a notification of network event.
+ void NotifyNetworkEventTask();
+
// Carries out message broadcasting on the message loop.
void BroadcastMessageTask(FilterMessage message);
@@ -299,6 +307,9 @@ class PipelineImpl : public Pipeline, public FilterHost {
// loaded source.
bool loaded_;
+ // Sets by the filters to indicate whether network is active.
+ bool network_activity_;
+
// Current volume level (from 0.0f to 1.0f). This value is set immediately
// via SetVolume() and a task is dispatched on the message loop to notify the
// filters.
@@ -356,6 +367,7 @@ class PipelineImpl : public Pipeline, public FilterHost {
scoped_ptr<PipelineCallback> stop_callback_;
scoped_ptr<PipelineCallback> ended_callback_;
scoped_ptr<PipelineCallback> error_callback_;
+ scoped_ptr<PipelineCallback> network_callback_;
// Vector of our filters and map maintaining the relationship between the
// FilterType and the filter itself.

Powered by Google App Engine
This is Rietveld 408576698