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

Side by Side Diff: public/web/WebMediaPlayer.h

Issue 67083003: Move WebMediaPlayer and friends to public/platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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 unified diff | Download patch
« no previous file with comments | « public/web/WebAudioSourceProviderClient.h ('k') | public/web/WebMediaPlayerClient.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 10 matching lines...) Expand all
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
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 #include "public/platform/WebMediaPlayer.h"
32 #define WebMediaPlayer_h
33
34 #include "../platform/WebCanvas.h"
35 #include "../platform/WebMediaSource.h"
36 #include "../platform/WebString.h"
37 #include "../platform/WebTimeRange.h"
38
39 namespace blink {
40
41 class WebAudioSourceProvider;
42 class WebAudioSourceProviderClient;
43 class WebMediaPlayerClient;
44 class WebString;
45 class WebURL;
46 struct WebRect;
47 struct WebSize;
48 class WebGraphicsContext3D;
49
50 class WebMediaPlayer {
51 public:
52 enum NetworkState {
53 NetworkStateEmpty,
54 NetworkStateIdle,
55 NetworkStateLoading,
56 NetworkStateLoaded,
57 NetworkStateFormatError,
58 NetworkStateNetworkError,
59 NetworkStateDecodeError,
60 };
61
62 enum ReadyState {
63 ReadyStateHaveNothing,
64 ReadyStateHaveMetadata,
65 ReadyStateHaveCurrentData,
66 ReadyStateHaveFutureData,
67 ReadyStateHaveEnoughData,
68 };
69
70 enum Preload {
71 PreloadNone,
72 PreloadMetaData,
73 PreloadAuto,
74 };
75
76 // Represents synchronous exceptions that can be thrown from the Encrypted
77 // Media methods. This is different from the asynchronous MediaKeyError.
78 enum MediaKeyException {
79 MediaKeyExceptionNoError,
80 MediaKeyExceptionInvalidPlayerState,
81 MediaKeyExceptionKeySystemNotSupported,
82 };
83
84 enum CORSMode {
85 CORSModeUnspecified,
86 CORSModeAnonymous,
87 CORSModeUseCredentials,
88 };
89
90 enum LoadType {
91 LoadTypeURL,
92 LoadTypeMediaSource,
93 LoadTypeMediaStream,
94 };
95
96 virtual ~WebMediaPlayer() { }
97
98 virtual void load(LoadType, const WebURL&, CORSMode) = 0;
99
100 // Playback controls.
101 virtual void play() = 0;
102 virtual void pause() = 0;
103 virtual bool supportsFullscreen() const = 0;
104 virtual bool supportsSave() const = 0;
105 virtual void seek(double seconds) = 0;
106 virtual void setRate(double rate) = 0;
107 virtual void setVolume(double volume) = 0;
108 virtual void setPreload(Preload) { };
109 virtual const WebTimeRanges& buffered() = 0;
110 virtual double maxTimeSeekable() const = 0;
111
112 virtual void paint(WebCanvas*, const WebRect&, unsigned char alpha) = 0;
113
114 // True if the loaded media has a playable video/audio track.
115 virtual bool hasVideo() const = 0;
116 virtual bool hasAudio() const = 0;
117
118 // Dimension of the video.
119 virtual WebSize naturalSize() const = 0;
120
121 // Getters of playback state.
122 virtual bool paused() const = 0;
123 virtual bool seeking() const = 0;
124 virtual double duration() const = 0;
125 virtual double currentTime() const = 0;
126
127 // Internal states of loading and network.
128 virtual NetworkState networkState() const = 0;
129 virtual ReadyState readyState() const = 0;
130
131 virtual bool didLoadingProgress() const = 0;
132
133 virtual bool hasSingleSecurityOrigin() const = 0;
134 virtual bool didPassCORSAccessCheck() const = 0;
135
136 virtual double mediaTimeForTimeValue(double timeValue) const = 0;
137
138 virtual unsigned decodedFrameCount() const = 0;
139 virtual unsigned droppedFrameCount() const = 0;
140 virtual unsigned corruptedFrameCount() const { return 0; };
141 virtual unsigned audioDecodedByteCount() const = 0;
142 virtual unsigned videoDecodedByteCount() const = 0;
143
144 // Do a GPU-GPU textures copy if possible.
145 virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsign ed texture, unsigned level, unsigned internalFormat, unsigned type, bool premult iplyAlpha, bool flipY) { return false; }
146
147 virtual WebAudioSourceProvider* audioSourceProvider() { return 0; }
148
149 // Returns whether keySystem is supported. If true, the result will be
150 // reported by an event.
151 virtual MediaKeyException generateKeyRequest(const WebString& keySystem, con st unsigned char* initData, unsigned initDataLength) { return MediaKeyExceptionK eySystemNotSupported; }
152 virtual MediaKeyException addKey(const WebString& keySystem, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataL ength, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupport ed; }
153 virtual MediaKeyException cancelKeyRequest(const WebString& keySystem, const WebString& sessionId) { return MediaKeyExceptionKeySystemNotSupported; }
154
155 // Instruct WebMediaPlayer to enter/exit fullscreen.
156 virtual void enterFullscreen() { }
157 virtual void exitFullscreen() { }
158 // Returns true if the player can enter fullscreen.
159 virtual bool canEnterFullscreen() const { return false; }
160 };
161
162 } // namespace blink
163
164 #endif
OLDNEW
« no previous file with comments | « public/web/WebAudioSourceProviderClient.h ('k') | public/web/WebMediaPlayerClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698