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

Side by Side Diff: webkit/api/public/WebMediaPlayer.h

Issue 199037: Buffered time ranges for <video> (Closed)
Patch Set: DEPS Created 11 years, 3 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 unified diff | Download patch
« no previous file with comments | « DEPS ('k') | webkit/api/src/WebMediaPlayerClientImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebMediaPlayer_h 31 #ifndef WebMediaPlayer_h
32 #define WebMediaPlayer_h 32 #define WebMediaPlayer_h
33 33
34 #include <vector>
35
34 #include "WebCanvas.h" 36 #include "WebCanvas.h"
35 37
36 namespace WebKit { 38 namespace WebKit {
37 class WebMediaPlayerClient; 39 class WebMediaPlayerClient;
38 class WebURL; 40 class WebURL;
39 struct WebRect; 41 struct WebRect;
40 struct WebSize; 42 struct WebSize;
41 43
44 struct WebTimeRange {
45 WebTimeRange(float s, float e) : start(s), end(e) {}
46
47 float start;
48 float end;
49 };
50
51 typedef std::vector<WebTimeRange> WebTimeRanges;
52
42 class WebMediaPlayer { 53 class WebMediaPlayer {
43 public: 54 public:
44 enum NetworkState { 55 enum NetworkState {
45 Empty, 56 Empty,
46 Idle, 57 Idle,
47 Loading, 58 Loading,
48 Loaded, 59 Loaded,
49 FormatError, 60 FormatError,
50 NetworkError, 61 NetworkError,
51 DecodeError, 62 DecodeError,
(...skipping 24 matching lines...) Expand all
76 virtual void pause() = 0; 87 virtual void pause() = 0;
77 virtual bool supportsFullscreen() const = 0; 88 virtual bool supportsFullscreen() const = 0;
78 virtual bool supportsSave() const = 0; 89 virtual bool supportsSave() const = 0;
79 virtual void seek(float seconds) = 0; 90 virtual void seek(float seconds) = 0;
80 virtual void setEndTime(float seconds) = 0; 91 virtual void setEndTime(float seconds) = 0;
81 virtual void setRate(float) = 0; 92 virtual void setRate(float) = 0;
82 virtual void setVolume(float) = 0; 93 virtual void setVolume(float) = 0;
83 virtual void setVisible(bool) = 0; 94 virtual void setVisible(bool) = 0;
84 virtual bool setAutoBuffer(bool) = 0; 95 virtual bool setAutoBuffer(bool) = 0;
85 virtual bool totalBytesKnown() = 0; 96 virtual bool totalBytesKnown() = 0;
86 virtual float maxTimeBuffered() const = 0; 97 virtual const WebTimeRanges& buffered() const = 0;
87 virtual float maxTimeSeekable() const = 0; 98 virtual float maxTimeSeekable() const = 0;
88 99
89 virtual void setSize(const WebSize&) = 0; 100 virtual void setSize(const WebSize&) = 0;
90 101
91 virtual void paint(WebCanvas*, const WebRect&) = 0; 102 virtual void paint(WebCanvas*, const WebRect&) = 0;
92 103
93 // True if the loaded media has a playable video/audio track. 104 // True if the loaded media has a playable video/audio track.
94 virtual bool hasVideo() const = 0; 105 virtual bool hasVideo() const = 0;
95 virtual bool hasAudio() const = 0; 106 virtual bool hasAudio() const = 0;
96 107
(...skipping 16 matching lines...) Expand all
113 virtual unsigned long long bytesLoaded() const = 0; 124 virtual unsigned long long bytesLoaded() const = 0;
114 virtual unsigned long long totalBytes() const = 0; 125 virtual unsigned long long totalBytes() const = 0;
115 126
116 virtual bool hasSingleSecurityOrigin() const = 0; 127 virtual bool hasSingleSecurityOrigin() const = 0;
117 virtual MovieLoadType movieLoadType() const = 0; 128 virtual MovieLoadType movieLoadType() const = 0;
118 }; 129 };
119 130
120 } // namespace WebKit 131 } // namespace WebKit
121 132
122 #endif 133 #endif
OLDNEW
« no previous file with comments | « DEPS ('k') | webkit/api/src/WebMediaPlayerClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698