| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef MediaPlayer_h | 26 #ifndef MediaPlayer_h |
| 27 #define MediaPlayer_h | 27 #define MediaPlayer_h |
| 28 | 28 |
| 29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
| 30 #include "platform/graphics/GraphicsTypes3D.h" | 30 #include "platform/graphics/GraphicsTypes3D.h" |
| 31 #include "platform/heap/Handle.h" |
| 31 #include "public/platform/WebMediaPlayer.h" | 32 #include "public/platform/WebMediaPlayer.h" |
| 32 #include "wtf/Forward.h" | 33 #include "wtf/Forward.h" |
| 33 #include "wtf/Noncopyable.h" | 34 #include "wtf/Noncopyable.h" |
| 34 | 35 |
| 35 namespace blink { | 36 namespace blink { |
| 36 class WebGraphicsContext3D; | 37 class WebGraphicsContext3D; |
| 37 class WebContentDecryptionModule; | 38 class WebContentDecryptionModule; |
| 38 class WebInbandTextTrack; | 39 class WebInbandTextTrack; |
| 39 class WebLayer; | 40 class WebLayer; |
| 40 class WebMediaSource; | 41 class WebMediaSource; |
| 41 } | 42 } |
| 42 | 43 |
| 43 namespace WebCore { | 44 namespace WebCore { |
| 44 | 45 |
| 45 class AudioSourceProvider; | 46 class AudioSourceProvider; |
| 46 class GraphicsContext; | 47 class GraphicsContext; |
| 47 class IntRect; | 48 class IntRect; |
| 48 class KURL; | 49 class KURL; |
| 49 class MediaPlayer; | 50 class MediaPlayer; |
| 50 class TimeRanges; | 51 class TimeRanges; |
| 51 | 52 |
| 52 // GL types as defined in OpenGL ES 2.0 header file gl2.h from khronos.org. | 53 // GL types as defined in OpenGL ES 2.0 header file gl2.h from khronos.org. |
| 53 // That header cannot be included directly due to a conflict with NPAPI headers. | 54 // That header cannot be included directly due to a conflict with NPAPI headers. |
| 54 // See crbug.com/328085. | 55 // See crbug.com/328085. |
| 55 typedef unsigned GC3Denum; | 56 typedef unsigned GC3Denum; |
| 56 typedef int GC3Dint; | 57 typedef int GC3Dint; |
| 57 | 58 |
| 58 class MediaPlayerClient { | 59 class MediaPlayerClient : public WillBeGarbageCollectedMixin { |
| 59 public: | 60 public: |
| 60 virtual ~MediaPlayerClient() { } | 61 virtual ~MediaPlayerClient() { } |
| 61 | 62 |
| 63 virtual void trace(Visitor*) { } |
| 64 |
| 62 // the network state has changed | 65 // the network state has changed |
| 63 virtual void mediaPlayerNetworkStateChanged() = 0; | 66 virtual void mediaPlayerNetworkStateChanged() = 0; |
| 64 | 67 |
| 65 // the ready state has changed | 68 // the ready state has changed |
| 66 virtual void mediaPlayerReadyStateChanged() = 0; | 69 virtual void mediaPlayerReadyStateChanged() = 0; |
| 67 | 70 |
| 68 // time has jumped, eg. not as a result of normal playback | 71 // time has jumped, eg. not as a result of normal playback |
| 69 virtual void mediaPlayerTimeChanged() = 0; | 72 virtual void mediaPlayerTimeChanged() = 0; |
| 70 | 73 |
| 71 // the media file duration has changed, or is now known | 74 // the media file duration has changed, or is now known |
| (...skipping 18 matching lines...) Expand all Loading... |
| 90 virtual void mediaPlayerSizeChanged() = 0; | 93 virtual void mediaPlayerSizeChanged() = 0; |
| 91 | 94 |
| 92 virtual void mediaPlayerSetWebLayer(blink::WebLayer*) = 0; | 95 virtual void mediaPlayerSetWebLayer(blink::WebLayer*) = 0; |
| 93 | 96 |
| 94 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) = 0; | 97 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) = 0; |
| 95 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) = 0; | 98 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) = 0; |
| 96 | 99 |
| 97 virtual void mediaPlayerMediaSourceOpened(blink::WebMediaSource*) = 0; | 100 virtual void mediaPlayerMediaSourceOpened(blink::WebMediaSource*) = 0; |
| 98 }; | 101 }; |
| 99 | 102 |
| 100 typedef PassOwnPtr<MediaPlayer> (*CreateMediaEnginePlayer)(MediaPlayerClient*); | 103 typedef PassOwnPtrWillBeRawPtr<MediaPlayer> (*CreateMediaEnginePlayer)(MediaPlay
erClient*); |
| 101 | 104 |
| 102 class PLATFORM_EXPORT MediaPlayer { | 105 class PLATFORM_EXPORT MediaPlayer : public WillBeGarbageCollectedMixin { |
| 103 WTF_MAKE_NONCOPYABLE(MediaPlayer); | 106 WTF_MAKE_NONCOPYABLE(MediaPlayer); |
| 104 public: | 107 public: |
| 105 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient*); | 108 static PassOwnPtrWillBeRawPtr<MediaPlayer> create(MediaPlayerClient*); |
| 106 static void setMediaEngineCreateFunction(CreateMediaEnginePlayer); | 109 static void setMediaEngineCreateFunction(CreateMediaEnginePlayer); |
| 107 | 110 |
| 108 static double invalidTime() { return -1.0; } | 111 static double invalidTime() { return -1.0; } |
| 109 | 112 |
| 110 MediaPlayer() { } | 113 MediaPlayer() { } |
| 111 virtual ~MediaPlayer() { } | 114 virtual ~MediaPlayer() { } |
| 112 | 115 |
| 116 virtual void trace(Visitor*) { } |
| 117 |
| 118 virtual void detach() = 0; |
| 119 |
| 113 virtual void load(blink::WebMediaPlayer::LoadType, const String& url, blink:
:WebMediaPlayer::CORSMode) = 0; | 120 virtual void load(blink::WebMediaPlayer::LoadType, const String& url, blink:
:WebMediaPlayer::CORSMode) = 0; |
| 114 | 121 |
| 115 virtual void play() = 0; | 122 virtual void play() = 0; |
| 116 virtual void pause() = 0; | 123 virtual void pause() = 0; |
| 117 | 124 |
| 118 virtual bool supportsSave() const = 0; | 125 virtual bool supportsSave() const = 0; |
| 119 | 126 |
| 120 virtual double duration() const = 0; | 127 virtual double duration() const = 0; |
| 121 | 128 |
| 122 virtual double currentTime() const = 0; | 129 virtual double currentTime() const = 0; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 164 |
| 158 #if ENABLE(WEB_AUDIO) | 165 #if ENABLE(WEB_AUDIO) |
| 159 virtual AudioSourceProvider* audioSourceProvider() = 0; | 166 virtual AudioSourceProvider* audioSourceProvider() = 0; |
| 160 #endif | 167 #endif |
| 161 virtual blink::WebMediaPlayer* webMediaPlayer() const = 0; | 168 virtual blink::WebMediaPlayer* webMediaPlayer() const = 0; |
| 162 }; | 169 }; |
| 163 | 170 |
| 164 } | 171 } |
| 165 | 172 |
| 166 #endif // MediaPlayer_h | 173 #endif // MediaPlayer_h |
| OLD | NEW |