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

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.h

Issue 157423003: Remove the dependency on encryptedmedia from HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move EME completely from core::HTMLMediaElement to modules::HTMLMediaElementEncryptedMedia (Based o… Created 6 years, 10 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // This class serves as a bridge between WebCore::MediaPlayer and 61 // This class serves as a bridge between WebCore::MediaPlayer and
62 // blink::WebMediaPlayer. 62 // blink::WebMediaPlayer.
63 class WebMediaPlayerClientImpl FINAL : public WebCore::MediaPlayer, public WebMe diaPlayerClient { 63 class WebMediaPlayerClientImpl FINAL : public WebCore::MediaPlayer, public WebMe diaPlayerClient {
64 64
65 public: 65 public:
66 static PassOwnPtr<WebCore::MediaPlayer> create(WebCore::MediaPlayerClient*); 66 static PassOwnPtr<WebCore::MediaPlayer> create(WebCore::MediaPlayerClient*);
67 67
68 virtual ~WebMediaPlayerClientImpl(); 68 virtual ~WebMediaPlayerClientImpl();
69 69
70 // Returns the encapsulated blink::WebMediaPlayer. 70 // Returns the encapsulated blink::WebMediaPlayer.
71 WebMediaPlayer* mediaPlayer() const; 71 virtual WebMediaPlayer* webMediaPlayer() const OVERRIDE;
72 72
73 // WebMediaPlayerClient methods: 73 // WebMediaPlayerClient methods:
74 virtual void networkStateChanged() OVERRIDE; 74 virtual void networkStateChanged() OVERRIDE;
75 virtual void readyStateChanged() OVERRIDE; 75 virtual void readyStateChanged() OVERRIDE;
76 virtual void timeChanged() OVERRIDE; 76 virtual void timeChanged() OVERRIDE;
77 virtual void repaint() OVERRIDE; 77 virtual void repaint() OVERRIDE;
78 virtual void durationChanged() OVERRIDE; 78 virtual void durationChanged() OVERRIDE;
79 virtual void sizeChanged() OVERRIDE; 79 virtual void sizeChanged() OVERRIDE;
80 virtual void setOpaque(bool) OVERRIDE; 80 virtual void setOpaque(bool) OVERRIDE;
81 virtual double volume() const OVERRIDE; 81 virtual double volume() const OVERRIDE;
82 virtual void playbackStateChanged() OVERRIDE; 82 virtual void playbackStateChanged() OVERRIDE;
83 virtual WebMediaPlayer::Preload preload() const OVERRIDE; 83 virtual WebMediaPlayer::Preload preload() const OVERRIDE;
84
85 // WebEncryptedMediaPlayerClient methods:
86 // FIXME: Remove these once the WebMediaPlayer implementation stop making th ese calls on the WebMediaPlayerClient object.
84 virtual void keyAdded(const WebString& keySystem, const WebString& sessionId ) OVERRIDE; 87 virtual void keyAdded(const WebString& keySystem, const WebString& sessionId ) OVERRIDE;
85 virtual void keyError(const WebString& keySystem, const WebString& sessionId , MediaKeyErrorCode, unsigned short systemCode) OVERRIDE; 88 virtual void keyError(const WebString& keySystem, const WebString& sessionId , MediaKeyErrorCode, unsigned short systemCode) OVERRIDE;
86 virtual void keyMessage(const WebString& keySystem, const WebString& session Id, const unsigned char* message, unsigned messageLength, const WebURL& defaultU RL) OVERRIDE; 89 virtual void keyMessage(const WebString& keySystem, const WebString& session Id, const unsigned char* message, unsigned messageLength, const WebURL& defaultU RL) OVERRIDE;
87 virtual void keyNeeded(const WebString& contentType, const unsigned char* in itData, unsigned initDataLength) OVERRIDE; 90 virtual void keyNeeded(const WebString& contentType, const unsigned char* in itData, unsigned initDataLength) OVERRIDE;
88 virtual WebPlugin* createHelperPlugin(const WebString& pluginType, WebFrame* ) OVERRIDE; 91 virtual WebPlugin* createHelperPlugin(const WebString& pluginType, WebFrame* ) OVERRIDE;
89 virtual void closeHelperPluginSoon(WebFrame*) OVERRIDE; 92 virtual void closeHelperPluginSoon(WebFrame*) OVERRIDE;
93 virtual void playerDestroyed();
94
90 virtual bool needsWebLayerForVideo() const OVERRIDE; 95 virtual bool needsWebLayerForVideo() const OVERRIDE;
91 virtual void setWebLayer(WebLayer*) OVERRIDE; 96 virtual void setWebLayer(WebLayer*) OVERRIDE;
92 virtual void addTextTrack(WebInbandTextTrack*) OVERRIDE; 97 virtual void addTextTrack(WebInbandTextTrack*) OVERRIDE;
93 virtual void removeTextTrack(WebInbandTextTrack*) OVERRIDE; 98 virtual void removeTextTrack(WebInbandTextTrack*) OVERRIDE;
94 virtual void mediaSourceOpened(WebMediaSource*) OVERRIDE; 99 virtual void mediaSourceOpened(WebMediaSource*) OVERRIDE;
95 virtual void requestFullscreen() OVERRIDE; 100 virtual void requestFullscreen() OVERRIDE;
96 virtual void requestSeek(double) OVERRIDE; 101 virtual void requestSeek(double) OVERRIDE;
97 102
98 // MediaPlayer methods: 103 // MediaPlayer methods:
99 virtual void load(WebMediaPlayer::LoadType, const WTF::String& url) OVERRIDE ; 104 virtual void load(WebMediaPlayer::LoadType, const WTF::String& url) OVERRIDE ;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 virtual unsigned audioDecodedByteCount() const OVERRIDE; 137 virtual unsigned audioDecodedByteCount() const OVERRIDE;
133 virtual unsigned videoDecodedByteCount() const OVERRIDE; 138 virtual unsigned videoDecodedByteCount() const OVERRIDE;
134 virtual void showFullscreenOverlay() OVERRIDE; 139 virtual void showFullscreenOverlay() OVERRIDE;
135 virtual void hideFullscreenOverlay() OVERRIDE; 140 virtual void hideFullscreenOverlay() OVERRIDE;
136 virtual bool canShowFullscreenOverlay() const OVERRIDE; 141 virtual bool canShowFullscreenOverlay() const OVERRIDE;
137 142
138 #if ENABLE(WEB_AUDIO) 143 #if ENABLE(WEB_AUDIO)
139 virtual WebCore::AudioSourceProvider* audioSourceProvider() OVERRIDE; 144 virtual WebCore::AudioSourceProvider* audioSourceProvider() OVERRIDE;
140 #endif 145 #endif
141 146
142 virtual WebCore::MediaPlayer::MediaKeyException generateKeyRequest(const Str ing& keySystem, const unsigned char* initData, unsigned initDataLength) OVERRIDE ;
143 virtual WebCore::MediaPlayer::MediaKeyException addKey(const String& keySyst em, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataLength, const String& sessionId) OVERRIDE;
144 virtual WebCore::MediaPlayer::MediaKeyException cancelKeyRequest(const Strin g& keySystem, const String& sessionId) OVERRIDE;
145 virtual void setContentDecryptionModule(WebContentDecryptionModule*) OVERRID E;
146
147 private: 147 private:
148 explicit WebMediaPlayerClientImpl(WebCore::MediaPlayerClient*); 148 explicit WebMediaPlayerClientImpl(WebCore::MediaPlayerClient*);
149 149
150 void startDelayedLoad(); 150 void startDelayedLoad();
151 void loadInternal(); 151 void loadInternal();
152 152
153 #if OS(ANDROID) 153 #if OS(ANDROID)
154 // FIXME: This path "only works" on Android. It is a workaround for the prob lem that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES 154 // FIXME: This path "only works" on Android. It is a workaround for the prob lem that Skia could not handle Android's GL_TEXTURE_EXTERNAL_OES
155 // texture internally. It should be removed and replaced by the normal paint path. 155 // texture internally. It should be removed and replaced by the normal paint path.
156 // https://code.google.com/p/skia/issues/detail?id=1189 156 // https://code.google.com/p/skia/issues/detail?id=1189
157 void paintOnAndroid(WebCore::GraphicsContext*, WebGraphicsContext3D*, const WebCore::IntRect&, uint8_t alpha); 157 void paintOnAndroid(WebCore::GraphicsContext*, WebGraphicsContext3D*, const WebCore::IntRect&, uint8_t alpha);
158 SkBitmap m_bitmap; 158 SkBitmap m_bitmap;
159 #endif 159 #endif
160 160
161 WebCore::MediaPlayerClient* m_client; 161 WebCore::MediaPlayerClient* m_client;
162 OwnPtr<WebMediaPlayer> m_webMediaPlayer; 162 OwnPtr<WebMediaPlayer> m_webMediaPlayer;
163 WebCore::KURL m_url; 163 WebCore::KURL m_url;
164 bool m_delayingLoad; 164 bool m_delayingLoad;
165 WebCore::MediaPlayer::Preload m_preload; 165 WebCore::MediaPlayer::Preload m_preload;
166 OwnPtr<WebHelperPlugin> m_helperPlugin; 166 OwnPtr<WebHelperPlugin> m_helperPlugin;
167 bool m_needsWebLayerForVideo; 167 bool m_needsWebLayerForVideo;
168 double m_volume; 168 double m_volume;
169 bool m_muted; 169 bool m_muted;
170 double m_rate; 170 double m_rate;
171 WebContentDecryptionModule* m_cdm;
172 171
173 #if ENABLE(WEB_AUDIO) 172 #if ENABLE(WEB_AUDIO)
174 // AudioClientImpl wraps an AudioSourceProviderClient. 173 // AudioClientImpl wraps an AudioSourceProviderClient.
175 // When the audio format is known, Chromium calls setFormat() which then dis patches into WebCore. 174 // When the audio format is known, Chromium calls setFormat() which then dis patches into WebCore.
176 175
177 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient { 176 class AudioClientImpl FINAL : public blink::WebAudioSourceProviderClient {
178 public: 177 public:
179 AudioClientImpl(WebCore::AudioSourceProviderClient* client) 178 AudioClientImpl(WebCore::AudioSourceProviderClient* client)
180 : m_client(client) 179 : m_client(client)
181 { 180 {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 216
218 AudioSourceProviderImpl m_audioSourceProvider; 217 AudioSourceProviderImpl m_audioSourceProvider;
219 #endif 218 #endif
220 219
221 WebMediaPlayer::LoadType m_loadType; 220 WebMediaPlayer::LoadType m_loadType;
222 }; 221 };
223 222
224 } // namespace blink 223 } // namespace blink
225 224
226 #endif 225 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698