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

Unified Diff: webkit/glue/media/buffered_resource_loader.h

Issue 8294025: Merge 105121 - Numerous fixes to audio/video buffered resource loading. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/874/src/
Patch Set: '' Created 9 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
« no previous file with comments | « webkit/glue/media/buffered_data_source_unittest.cc ('k') | webkit/glue/media/buffered_resource_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/media/buffered_resource_loader.h
===================================================================
--- webkit/glue/media/buffered_resource_loader.h (revision 105891)
+++ webkit/glue/media/buffered_resource_loader.h (working copy)
@@ -56,9 +56,15 @@
// |kPositionNotSpecified| for not specified.
// |last_byte_position| - Last byte to be loaded,
// |kPositionNotSpecified| for not specified.
+ // |strategy| is the initial loading strategy to use.
+ // |bitrate| is the bitrate of the media, 0 if unknown.
+ // |playback_rate| is the current playback rate of the media.
BufferedResourceLoader(const GURL& url,
int64 first_byte_position,
int64 last_byte_position,
+ DeferStrategy strategy,
+ int bitrate,
+ float playback_rate,
media::MediaLog* media_log);
// Start the resource loading with the specified URL and range.
@@ -156,13 +162,25 @@
// Sets the defer strategy to the given value.
void UpdateDeferStrategy(DeferStrategy strategy);
+ // Sets the playback rate to the given value and updates buffer window
+ // accordingly.
+ void SetPlaybackRate(float playback_rate);
+
+ // Sets the bitrate to the given value and updates buffer window
+ // accordingly.
+ void SetBitrate(int bitrate);
+
protected:
friend class base::RefCountedThreadSafe<BufferedResourceLoader>;
virtual ~BufferedResourceLoader();
private:
+ friend class BufferedDataSourceTest2;
friend class BufferedResourceLoaderTest;
+ // Updates the |buffer_|'s forward and backward capacities.
+ void UpdateBufferWindow();
+
// Toggles whether the resource loading is deferred or not.
// Returns true if a network event was fired.
bool ToggleDeferring();
@@ -272,6 +290,12 @@
// Used to ensure mocks for unittests are used instead of reset in Start().
bool keep_test_loader_;
+ // Bitrate of the media. Set to 0 if unknown.
+ int bitrate_;
+
+ // Playback rate of the media.
+ float playback_rate_;
+
scoped_refptr<media::MediaLog> media_log_;
DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader);
« no previous file with comments | « webkit/glue/media/buffered_data_source_unittest.cc ('k') | webkit/glue/media/buffered_resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698