| 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 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" | |
| 30 #include "platform/graphics/GraphicsTypes3D.h" | |
| 31 #include "public/platform/WebMediaPlayer.h" | 29 #include "public/platform/WebMediaPlayer.h" |
| 32 #include "wtf/Forward.h" | 30 #include "wtf/Forward.h" |
| 33 #include "wtf/Noncopyable.h" | 31 #include "wtf/Noncopyable.h" |
| 34 | 32 |
| 35 namespace blink { | 33 namespace blink { |
| 36 class WebGraphicsContext3D; | |
| 37 class WebContentDecryptionModule; | 34 class WebContentDecryptionModule; |
| 38 class WebInbandTextTrack; | 35 class WebInbandTextTrack; |
| 39 class WebLayer; | 36 class WebLayer; |
| 40 class WebMediaSource; | 37 class WebMediaSource; |
| 41 } | 38 } |
| 42 | 39 |
| 43 namespace blink { | 40 namespace blink { |
| 44 | 41 |
| 45 class AudioSourceProvider; | 42 class AudioSourceProvider; |
| 46 class GraphicsContext; | |
| 47 class IntRect; | |
| 48 class KURL; | 43 class KURL; |
| 49 class MediaPlayer; | 44 class MediaPlayer; |
| 50 class TimeRanges; | 45 class TimeRanges; |
| 51 | 46 |
| 52 // 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 // See crbug.com/328085. | |
| 55 typedef unsigned GC3Denum; | |
| 56 typedef int GC3Dint; | |
| 57 | |
| 58 class MediaPlayerClient { | 47 class MediaPlayerClient { |
| 59 public: | 48 public: |
| 60 virtual ~MediaPlayerClient() { } | 49 virtual ~MediaPlayerClient() { } |
| 61 | 50 |
| 62 // the network state has changed | 51 // the network state has changed |
| 63 virtual void mediaPlayerNetworkStateChanged() = 0; | 52 virtual void mediaPlayerNetworkStateChanged() = 0; |
| 64 | 53 |
| 65 // the ready state has changed | 54 // the ready state has changed |
| 66 virtual void mediaPlayerReadyStateChanged() = 0; | 55 virtual void mediaPlayerReadyStateChanged() = 0; |
| 67 | 56 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient*); | 94 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient*); |
| 106 static void setMediaEngineCreateFunction(CreateMediaEnginePlayer); | 95 static void setMediaEngineCreateFunction(CreateMediaEnginePlayer); |
| 107 | 96 |
| 108 static double invalidTime() { return -1.0; } | 97 static double invalidTime() { return -1.0; } |
| 109 | 98 |
| 110 MediaPlayer() { } | 99 MediaPlayer() { } |
| 111 virtual ~MediaPlayer() { } | 100 virtual ~MediaPlayer() { } |
| 112 | 101 |
| 113 virtual void load(blink::WebMediaPlayer::LoadType, const String& url, blink:
:WebMediaPlayer::CORSMode) = 0; | 102 virtual void load(blink::WebMediaPlayer::LoadType, const String& url, blink:
:WebMediaPlayer::CORSMode) = 0; |
| 114 | 103 |
| 115 virtual void paint(GraphicsContext*, const IntRect&) = 0; | |
| 116 virtual bool copyVideoTextureToPlatformTexture(blink::WebGraphicsContext3D*,
Platform3DObject, GC3Dint, GC3Denum, GC3Denum, bool, bool) = 0; | |
| 117 | |
| 118 enum Preload { None, MetaData, Auto }; | 104 enum Preload { None, MetaData, Auto }; |
| 119 virtual void setPreload(Preload) = 0; | 105 virtual void setPreload(Preload) = 0; |
| 120 | 106 |
| 121 #if ENABLE(WEB_AUDIO) | 107 #if ENABLE(WEB_AUDIO) |
| 122 virtual AudioSourceProvider* audioSourceProvider() = 0; | 108 virtual AudioSourceProvider* audioSourceProvider() = 0; |
| 123 #endif | 109 #endif |
| 124 virtual blink::WebMediaPlayer* webMediaPlayer() const = 0; | 110 virtual blink::WebMediaPlayer* webMediaPlayer() const = 0; |
| 125 }; | 111 }; |
| 126 | 112 |
| 127 } | 113 } |
| 128 | 114 |
| 129 #endif // MediaPlayer_h | 115 #endif // MediaPlayer_h |
| OLD | NEW |