2 * Copyright (C) 2007-2014 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #include "GraphicsTypes3D.h"
31 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
32 #include "MediaPlayerProxy.h"
35 #include "AudioTrackPrivate.h"
36 #include "CDMSession.h"
37 #include "InbandTextTrackPrivate.h"
40 #include "LayoutRect.h"
41 #include "MediaSession.h"
42 #include "NativeImagePtr.h"
43 #include "PlatformLayer.h"
45 #include "VideoTrackPrivate.h"
46 #include <runtime/Uint8Array.h>
47 #include <wtf/Forward.h>
48 #include <wtf/HashSet.h>
49 #include <wtf/MediaTime.h>
50 #include <wtf/Noncopyable.h>
51 #include <wtf/OwnPtr.h>
52 #include <wtf/PassOwnPtr.h>
53 #include <wtf/text/StringHash.h>
55 #if ENABLE(AVF_CAPTIONS)
56 #include "PlatformTextTrack.h"
59 #if USE(PLATFORM_TEXT_TRACK_MENU)
60 #include "PlatformTextTrackMenu.h"
69 class QTMovieVisualContext;
73 class AudioSourceProvider;
74 class AuthenticationChallenge;
76 #if ENABLE(MEDIA_SOURCE)
77 class MediaSourcePrivateClient;
79 class MediaPlayerPrivateInterface;
80 class TextTrackRepresentation;
82 // Structure that will hold every native
83 // types supported by the current media player.
84 // We have to do that has multiple media players
85 // backend can live at runtime.
86 struct PlatformMedia {
91 QTMovieVisualContextType,
92 ChromiumMediaPlayerType,
94 AVFoundationMediaPlayerType,
95 AVFoundationCFMediaPlayerType,
96 AVFoundationAssetType,
101 QTMovieGWorld* qtMovieGWorld;
102 QTMovieVisualContext* qtMovieVisualContext;
103 MediaPlayerPrivateInterface* chromiumMediaPlayer;
104 MediaPlayerPrivateInterface* qtMediaPlayer;
105 AVPlayer* avfMediaPlayer;
106 AVCFPlayer* avcfMediaPlayer;
111 struct MediaEngineSupportParameters {
115 #if ENABLE(ENCRYPTED_MEDIA)
118 #if ENABLE(MEDIA_SOURCE)
122 MediaEngineSupportParameters()
123 #if ENABLE(MEDIA_SOURCE)
124 : isMediaSource(false)
130 extern const PlatformMedia NoPlatformMedia;
132 class CachedResourceLoader;
135 class GraphicsContext;
136 class GraphicsContext3D;
141 struct MediaPlayerFactory;
142 class PlatformTimeRanges;
144 #if PLATFORM(WIN) && USE(AVFOUNDATION)
145 struct GraphicsDeviceAdapter;
148 class MediaPlayerClient {
150 enum CORSMode { Unspecified, Anonymous, UseCredentials };
152 virtual ~MediaPlayerClient() { }
154 // Get the document which the media player is owned by
155 virtual Document* mediaPlayerOwningDocument() { return 0; }
157 // the network state has changed
158 virtual void mediaPlayerNetworkStateChanged(MediaPlayer*) { }
160 // the ready state has changed
161 virtual void mediaPlayerReadyStateChanged(MediaPlayer*) { }
163 // the volume state has changed
164 virtual void mediaPlayerVolumeChanged(MediaPlayer*) { }
166 // the mute state has changed
167 virtual void mediaPlayerMuteChanged(MediaPlayer*) { }
169 // time has jumped, eg. not as a result of normal playback
170 virtual void mediaPlayerTimeChanged(MediaPlayer*) { }
172 // the media file duration has changed, or is now known
173 virtual void mediaPlayerDurationChanged(MediaPlayer*) { }
175 // the playback rate has changed
176 virtual void mediaPlayerRateChanged(MediaPlayer*) { }
178 // the play/pause status changed
179 virtual void mediaPlayerPlaybackStateChanged(MediaPlayer*) { }
181 // The MediaPlayer has found potentially problematic media content.
182 // This is used internally to trigger swapping from a <video>
183 // element to an <embed> in standalone documents
184 virtual void mediaPlayerSawUnsupportedTracks(MediaPlayer*) { }
186 // The MediaPlayer could not discover an engine which supports the requested resource.
187 virtual void mediaPlayerResourceNotSupported(MediaPlayer*) { }
189 // Presentation-related methods
190 // a new frame of video is available
191 virtual void mediaPlayerRepaint(MediaPlayer*) { }
193 // the movie size has changed
194 virtual void mediaPlayerSizeChanged(MediaPlayer*) { }
196 virtual void mediaPlayerEngineUpdated(MediaPlayer*) { }
198 // The first frame of video is available to render. A media engine need only make this callback if the
199 // first frame is not available immediately when prepareForRendering is called.
200 virtual void mediaPlayerFirstVideoFrameAvailable(MediaPlayer*) { }
202 // A characteristic of the media file, eg. video, audio, closed captions, etc, has changed.
203 virtual void mediaPlayerCharacteristicChanged(MediaPlayer*) { }
205 // whether the rendering system can accelerate the display of this MediaPlayer.
206 virtual bool mediaPlayerRenderingCanBeAccelerated(MediaPlayer*) { return false; }
208 // called when the media player's rendering mode changed, which indicates a change in the
209 // availability of the platformLayer().
210 virtual void mediaPlayerRenderingModeChanged(MediaPlayer*) { }
212 #if PLATFORM(WIN) && USE(AVFOUNDATION)
213 virtual GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const { return 0; }
216 #if ENABLE(ENCRYPTED_MEDIA)
217 enum MediaKeyErrorCode { UnknownError = 1, ClientError, ServiceError, OutputError, HardwareChangeError, DomainError };
218 virtual void mediaPlayerKeyAdded(MediaPlayer*, const String& /* keySystem */, const String& /* sessionId */) { }
219 virtual void mediaPlayerKeyError(MediaPlayer*, const String& /* keySystem */, const String& /* sessionId */, MediaKeyErrorCode, unsigned short /* systemCode */) { }
220 virtual void mediaPlayerKeyMessage(MediaPlayer*, const String& /* keySystem */, const String& /* sessionId */, const unsigned char* /* message */, unsigned /* messageLength */, const URL& /* defaultURL */) { }
221 virtual bool mediaPlayerKeyNeeded(MediaPlayer*, const String& /* keySystem */, const String& /* sessionId */, const unsigned char* /* initData */, unsigned /* initDataLength */) { return false; }
224 #if ENABLE(ENCRYPTED_MEDIA_V2)
225 virtual bool mediaPlayerKeyNeeded(MediaPlayer*, Uint8Array*) { return false; }
228 #if ENABLE(IOS_AIRPLAY)
229 virtual void mediaPlayerCurrentPlaybackTargetIsWirelessChanged(MediaPlayer*) { };
230 virtual void mediaPlayerPlaybackTargetAvailabilityChanged(MediaPlayer*) { };
233 virtual String mediaPlayerReferrer() const { return String(); }
234 virtual String mediaPlayerUserAgent() const { return String(); }
235 virtual CORSMode mediaPlayerCORSMode() const { return Unspecified; }
236 virtual void mediaPlayerEnterFullscreen() { }
237 virtual void mediaPlayerExitFullscreen() { }
238 virtual bool mediaPlayerIsFullscreen() const { return false; }
239 virtual bool mediaPlayerIsFullscreenPermitted() const { return false; }
240 virtual bool mediaPlayerIsVideo() const { return false; }
241 virtual LayoutRect mediaPlayerContentBoxRect() const { return LayoutRect(); }
242 virtual void mediaPlayerSetSize(const IntSize&) { }
243 virtual void mediaPlayerPause() { }
244 virtual void mediaPlayerPlay() { }
245 virtual bool mediaPlayerPlatformVolumeConfigurationRequired() const { return false; }
246 virtual bool mediaPlayerIsPaused() const { return true; }
247 virtual bool mediaPlayerIsLooping() const { return false; }
248 virtual HostWindow* mediaPlayerHostWindow() { return 0; }
249 virtual IntRect mediaPlayerWindowClipRect() { return IntRect(); }
250 virtual CachedResourceLoader* mediaPlayerCachedResourceLoader() { return 0; }
251 virtual bool doesHaveAttribute(const AtomicString&, AtomicString* = 0) const { return false; }
253 #if ENABLE(VIDEO_TRACK)
254 virtual void mediaPlayerDidAddAudioTrack(PassRefPtr<AudioTrackPrivate>) { }
255 virtual void mediaPlayerDidAddTextTrack(PassRefPtr<InbandTextTrackPrivate>) { }
256 virtual void mediaPlayerDidAddVideoTrack(PassRefPtr<VideoTrackPrivate>) { }
257 virtual void mediaPlayerDidRemoveAudioTrack(PassRefPtr<AudioTrackPrivate>) { }
258 virtual void mediaPlayerDidRemoveTextTrack(PassRefPtr<InbandTextTrackPrivate>) { }
259 virtual void mediaPlayerDidRemoveVideoTrack(PassRefPtr<VideoTrackPrivate>) { }
261 virtual void textTrackRepresentationBoundsChanged(const IntRect&) { }
262 #if ENABLE(AVF_CAPTIONS)
263 virtual Vector<RefPtr<PlatformTextTrack>> outOfBandTrackSources() { return Vector<RefPtr<PlatformTextTrack>>(); }
267 virtual bool mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&) { return false; }
268 virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType) { }
271 class MediaPlayerSupportsTypeClient {
273 virtual ~MediaPlayerSupportsTypeClient() { }
275 virtual bool mediaPlayerNeedsSiteSpecificHacks() const { return false; }
276 virtual String mediaPlayerDocumentHost() const { return String(); }
280 WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED;
283 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient* client)
285 return adoptPtr(new MediaPlayer(client));
287 virtual ~MediaPlayer();
289 // Media engine support.
290 enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
291 static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&, const MediaPlayerSupportsTypeClient*);
292 static void getSupportedTypes(HashSet<String>&);
293 static bool isAvailable();
294 static void getSitesInMediaCache(Vector<String>&);
295 static void clearMediaCache();
296 static void clearMediaCacheForSite(const String&);
297 static bool supportsKeySystem(const String& keySystem, const String& mimeType);
299 bool supportsFullscreen() const;
300 bool supportsSave() const;
301 bool supportsScanning() const;
302 bool requiresImmediateCompositing() const;
303 bool doesHaveAttribute(const AtomicString&, AtomicString* value = nullptr) const;
304 PlatformMedia platformMedia() const;
305 PlatformLayer* platformLayer() const;
307 void setVideoFullscreenLayer(PlatformLayer*);
308 void setVideoFullscreenFrame(FloatRect);
309 enum VideoGravity { VideoGravityResize, VideoGravityResizeAspect, VideoGravityResizeAspectFill };
310 void setVideoFullscreenGravity(VideoGravity);
312 IntSize naturalSize();
313 bool hasVideo() const;
314 bool hasAudio() const;
316 void setFrameView(FrameView* frameView) { m_frameView = frameView; }
317 FrameView* frameView() { return m_frameView; }
318 bool inMediaDocument();
320 IntSize size() const { return m_size; }
321 void setSize(const IntSize& size);
323 bool load(const URL&, const ContentType&, const String& keySystem);
324 #if ENABLE(MEDIA_SOURCE)
325 bool load(const URL&, const ContentType&, MediaSourcePrivateClient*);
329 bool visible() const;
330 void setVisible(bool);
332 void prepareToPlay();
336 #if ENABLE(ENCRYPTED_MEDIA) || ENABLE(ENCRYPTED_MEDIA_V2)
337 // Represents synchronous exceptions that can be thrown from the Encrypted Media methods.
338 // This is different from the asynchronous MediaKeyError.
339 enum MediaKeyException { NoError, InvalidPlayerState, KeySystemNotSupported };
342 #if ENABLE(ENCRYPTED_MEDIA)
343 MediaKeyException generateKeyRequest(const String& keySystem, const unsigned char* initData, unsigned initDataLength);
344 MediaKeyException addKey(const String& keySystem, const unsigned char* key, unsigned keyLength, const unsigned char* initData, unsigned initDataLength, const String& sessionId);
345 MediaKeyException cancelKeyRequest(const String& keySystem, const String& sessionId);
348 #if ENABLE(ENCRYPTED_MEDIA_V2)
349 std::unique_ptr<CDMSession> createSession(const String& keySystem);
353 bool seeking() const;
355 static double invalidTime() { return -1.0;}
356 double duration() const;
357 double currentTime() const;
358 void seek(double time);
359 void seekWithTolerance(double time, double negativeTolerance, double positiveTolerance);
361 double startTime() const;
363 double initialTime() const;
366 void setRate(double);
368 bool preservesPitch() const;
369 void setPreservesPitch(bool);
371 std::unique_ptr<PlatformTimeRanges> buffered();
372 std::unique_ptr<PlatformTimeRanges> seekable();
373 double minTimeSeekable();
374 double maxTimeSeekable();
376 bool didLoadingProgress();
378 double volume() const;
379 void setVolume(double);
380 bool platformVolumeConfigurationRequired() const { return m_mediaPlayerClient->mediaPlayerPlatformVolumeConfigurationRequired(); }
385 bool hasClosedCaptions() const;
386 void setClosedCaptionsVisible(bool closedCaptionsVisible);
388 bool autoplay() const;
389 void setAutoplay(bool);
391 void paint(GraphicsContext*, const IntRect&);
392 void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
394 // copyVideoTextureToPlatformTexture() is used to do the GPU-GPU textures copy without a readback to system memory.
395 // The first five parameters denote the corresponding GraphicsContext, destination texture, requested level, requested type and the required internalFormat for destination texture.
396 // The last two parameters premultiplyAlpha and flipY denote whether addtional premultiplyAlpha and flip operation are required during the copy.
397 // It returns true on success and false on failure.
399 // In the GPU-GPU textures copy, the source texture(Video texture) should have valid target, internalFormat and size, etc.
400 // The destination texture may need to be resized to to the dimensions of the source texture or re-defined to the required internalFormat.
401 // The current restrictions require that format shoud be RGB or RGBA, type should be UNSIGNED_BYTE and level should be 0. It may be lifted in the future.
403 // Each platform port can have its own implementation on this function. The default implementation for it is a single "return false" in MediaPlayerPrivate.h.
404 // In chromium, the implementation is based on GL_CHROMIUM_copy_texture extension which is documented at
405 // http://src.chromium.org/viewvc/chrome/trunk/src/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt and implemented at
406 // http://src.chromium.org/viewvc/chrome/trunk/src/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc via shaders.
407 bool copyVideoTextureToPlatformTexture(GraphicsContext3D*, Platform3DObject texture, GC3Dint level, GC3Denum type, GC3Denum internalFormat, bool premultiplyAlpha, bool flipY);
409 PassNativeImagePtr nativeImageForCurrentTime();
411 enum NetworkState { Empty, Idle, Loading, Loaded, FormatError, NetworkError, DecodeError };
412 NetworkState networkState();
414 enum ReadyState { HaveNothing, HaveMetadata, HaveCurrentData, HaveFutureData, HaveEnoughData };
415 ReadyState readyState();
417 enum MovieLoadType { Unknown, Download, StoredStream, LiveStream };
418 MovieLoadType movieLoadType() const;
420 enum Preload { None, MetaData, Auto };
421 Preload preload() const;
422 void setPreload(Preload);
424 void networkStateChanged();
425 void readyStateChanged();
426 void volumeChanged(double);
427 void muteChanged(bool);
431 void playbackStateChanged();
432 void durationChanged();
433 void firstVideoFrameAvailable();
434 void characteristicChanged();
438 MediaPlayerClient* mediaPlayerClient() const { return m_mediaPlayerClient; }
439 void clearMediaPlayerClient() { m_mediaPlayerClient = 0; }
441 bool hasAvailableVideoFrame() const;
442 void prepareForRendering();
444 bool canLoadPoster() const;
445 void setPoster(const String&);
447 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
448 void deliverNotification(MediaPlayerProxyNotificationType notification);
449 void setMediaPlayerProxy(WebMediaPlayerProxy* proxy);
450 void setControls(bool);
453 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO) || USE(NATIVE_FULLSCREEN_VIDEO)
454 void enterFullscreen();
455 void exitFullscreen();
458 #if ENABLE(IOS_AIRPLAY)
459 bool isCurrentPlaybackTargetWireless() const;
461 enum WirelessPlaybackTargetType { TargetTypeNone, TargetTypeAirPlay, TargetTypeTVOut };
462 WirelessPlaybackTargetType wirelessPlaybackTargetType() const;
464 String wirelessPlaybackTargetName() const;
466 void showPlaybackTargetPicker();
468 bool hasWirelessPlaybackTargets() const;
470 bool wirelessVideoPlaybackDisabled() const;
471 void setWirelessVideoPlaybackDisabled(bool);
473 void currentPlaybackTargetIsWirelessChanged();
474 void playbackTargetAvailabilityChanged();
476 void setHasPlaybackTargetAvailabilityListeners(bool);
479 #if USE(NATIVE_FULLSCREEN_VIDEO)
480 bool canEnterFullscreen() const;
483 // whether accelerated rendering is supported by the media engine for the current media.
484 bool supportsAcceleratedRendering() const;
485 // called when the rendering system flips the into or out of accelerated rendering mode.
486 void acceleratedRenderingStateChanged();
488 bool shouldMaintainAspectRatio() const;
489 void setShouldMaintainAspectRatio(bool);
491 #if PLATFORM(WIN) && USE(AVFOUNDATION)
492 GraphicsDeviceAdapter* graphicsDeviceAdapter() const;
495 bool hasSingleSecurityOrigin() const;
497 bool didPassCORSAccessCheck() const;
499 double mediaTimeForTimeValue(double) const;
501 double maximumDurationToCacheMediaTime() const;
503 unsigned decodedFrameCount() const;
504 unsigned droppedFrameCount() const;
505 unsigned audioDecodedByteCount() const;
506 unsigned videoDecodedByteCount() const;
508 void setPrivateBrowsingMode(bool);
510 #if ENABLE(WEB_AUDIO)
511 AudioSourceProvider* audioSourceProvider();
514 #if ENABLE(ENCRYPTED_MEDIA)
515 void keyAdded(const String& keySystem, const String& sessionId);
516 void keyError(const String& keySystem, const String& sessionId, MediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode);
517 void keyMessage(const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const URL& defaultURL);
518 bool keyNeeded(const String& keySystem, const String& sessionId, const unsigned char* initData, unsigned initDataLength);
521 #if ENABLE(ENCRYPTED_MEDIA_V2)
522 bool keyNeeded(Uint8Array* initData);
525 String referrer() const;
526 String userAgent() const;
528 String engineDescription() const;
531 void attributeChanged(const String& name, const String& value);
532 bool readyForPlayback() const;
535 CachedResourceLoader* cachedResourceLoader();
537 #if ENABLE(VIDEO_TRACK)
538 void addAudioTrack(PassRefPtr<AudioTrackPrivate>);
539 void addTextTrack(PassRefPtr<InbandTextTrackPrivate>);
540 void addVideoTrack(PassRefPtr<VideoTrackPrivate>);
541 void removeAudioTrack(PassRefPtr<AudioTrackPrivate>);
542 void removeTextTrack(PassRefPtr<InbandTextTrackPrivate>);
543 void removeVideoTrack(PassRefPtr<VideoTrackPrivate>);
545 bool requiresTextTrackRepresentation() const;
546 void setTextTrackRepresentation(TextTrackRepresentation*);
547 #if ENABLE(AVF_CAPTIONS)
548 void notifyTrackModeChanged();
549 Vector<RefPtr<PlatformTextTrack>> outOfBandTrackSources();
553 static void resetMediaEngines();
555 #if USE(PLATFORM_TEXT_TRACK_MENU)
556 bool implementsTextTrackControls() const;
557 PassRefPtr<PlatformTextTrackMenuInterface> textTrackMenu();
561 void simulateAudioInterruption();
564 String languageOfPrimaryAudioTrack() const;
566 size_t extraMemoryCost() const;
568 unsigned long long fileSize() const;
570 #if ENABLE(MEDIA_SOURCE)
571 unsigned long totalVideoFrames();
572 unsigned long droppedVideoFrames();
573 unsigned long corruptedVideoFrames();
574 double totalFrameDelay();
577 bool shouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge&);
578 void handlePlaybackCommand(MediaSession::RemoteControlCommandType);
581 MediaPlayer(MediaPlayerClient*);
582 MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const;
583 void loadWithNextMediaEngine(MediaPlayerFactory*);
584 void reloadTimerFired(Timer<MediaPlayer>&);
586 static void initializeMediaEngines();
588 MediaPlayerClient* m_mediaPlayerClient;
589 Timer<MediaPlayer> m_reloadTimer;
590 OwnPtr<MediaPlayerPrivateInterface> m_private;
591 MediaPlayerFactory* m_currentMediaEngine;
593 String m_contentMIMEType;
594 String m_contentTypeCodecs;
596 FrameView* m_frameView;
603 bool m_preservesPitch;
604 bool m_privateBrowsing;
605 bool m_shouldPrepareToRender;
606 bool m_contentMIMETypeWasInferredFromExtension;
607 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
608 WebMediaPlayerProxy* m_playerProxy; // not owned or used, passed to m_private
611 #if ENABLE(MEDIA_SOURCE)
612 RefPtr<MediaSourcePrivateClient> m_mediaSource;
616 typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*);
617 typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types);
618 typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters& parameters);
619 typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&);
620 typedef void (*MediaEngineClearMediaCache)();
621 typedef void (*MediaEngineClearMediaCacheForSite)(const String&);
622 typedef bool (*MediaEngineSupportsKeySystem)(const String& keySystem, const String& mimeType);
624 typedef void (*MediaEngineRegistrar)(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType,
625 MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem);
626 typedef void (*MediaEngineRegister)(MediaEngineRegistrar);
628 class MediaPlayerFactorySupport {
630 static void callRegisterMediaEngine(MediaEngineRegister);
635 #endif // ENABLE(VIDEO)