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

Side by Side Diff: Source/platform/graphics/media/MediaPlayer.h

Issue 203213008: Move deferred loading logic from WebMediaPlayerClientImpl to HTMLMediaElement. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing semicolon Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/web/AssertMatchingEnums.cpp » ('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) 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 class TimeRanges; 51 class TimeRanges;
52 52
53 // 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.
54 // 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.
55 // See crbug.com/328085. 55 // See crbug.com/328085.
56 typedef unsigned GC3Denum; 56 typedef unsigned GC3Denum;
57 typedef int GC3Dint; 57 typedef int GC3Dint;
58 58
59 class MediaPlayerClient { 59 class MediaPlayerClient {
60 public: 60 public:
61 enum CORSMode { Unspecified, Anonymous, UseCredentials };
62
63 virtual ~MediaPlayerClient() { } 61 virtual ~MediaPlayerClient() { }
64 62
65 // the network state has changed 63 // the network state has changed
66 virtual void mediaPlayerNetworkStateChanged() = 0; 64 virtual void mediaPlayerNetworkStateChanged() = 0;
67 65
68 // the ready state has changed 66 // the ready state has changed
69 virtual void mediaPlayerReadyStateChanged() = 0; 67 virtual void mediaPlayerReadyStateChanged() = 0;
70 68
71 // time has jumped, eg. not as a result of normal playback 69 // time has jumped, eg. not as a result of normal playback
72 virtual void mediaPlayerTimeChanged() = 0; 70 virtual void mediaPlayerTimeChanged() = 0;
(...skipping 12 matching lines...) Expand all
85 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d epend on it. 83 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d epend on it.
86 virtual KURL mediaPlayerPosterURL() = 0; 84 virtual KURL mediaPlayerPosterURL() = 0;
87 85
88 // Presentation-related methods 86 // Presentation-related methods
89 // a new frame of video is available 87 // a new frame of video is available
90 virtual void mediaPlayerRepaint() = 0; 88 virtual void mediaPlayerRepaint() = 0;
91 89
92 // the movie size has changed 90 // the movie size has changed
93 virtual void mediaPlayerSizeChanged() = 0; 91 virtual void mediaPlayerSizeChanged() = 0;
94 92
95 virtual CORSMode mediaPlayerCORSMode() const = 0;
96
97 virtual void mediaPlayerSetWebLayer(blink::WebLayer*) = 0; 93 virtual void mediaPlayerSetWebLayer(blink::WebLayer*) = 0;
98 virtual void mediaPlayerSetOpaque(bool) = 0; 94 virtual void mediaPlayerSetOpaque(bool) = 0;
99 95
100 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) = 0; 96 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) = 0;
101 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) = 0; 97 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) = 0;
102 98
103 virtual void mediaPlayerMediaSourceOpened(blink::WebMediaSource*) = 0; 99 virtual void mediaPlayerMediaSourceOpened(blink::WebMediaSource*) = 0;
104 }; 100 };
105 101
106 typedef PassOwnPtr<MediaPlayer> (*CreateMediaEnginePlayer)(MediaPlayerClient*); 102 typedef PassOwnPtr<MediaPlayer> (*CreateMediaEnginePlayer)(MediaPlayerClient*);
107 103
108 class PLATFORM_EXPORT MediaPlayer { 104 class PLATFORM_EXPORT MediaPlayer {
109 WTF_MAKE_NONCOPYABLE(MediaPlayer); 105 WTF_MAKE_NONCOPYABLE(MediaPlayer);
110 public: 106 public:
111 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient*); 107 static PassOwnPtr<MediaPlayer> create(MediaPlayerClient*);
112 static void setMediaEngineCreateFunction(CreateMediaEnginePlayer); 108 static void setMediaEngineCreateFunction(CreateMediaEnginePlayer);
113 109
114 static double invalidTime() { return -1.0; } 110 static double invalidTime() { return -1.0; }
115 111
116 MediaPlayer() { } 112 MediaPlayer() { }
117 virtual ~MediaPlayer() { } 113 virtual ~MediaPlayer() { }
118 114
119 virtual void load(blink::WebMediaPlayer::LoadType, const String& url) = 0; 115 virtual void load(blink::WebMediaPlayer::LoadType, const String& url, blink: :WebMediaPlayer::CORSMode) = 0;
120
121 virtual void prepareToPlay() = 0;
122 116
123 virtual void play() = 0; 117 virtual void play() = 0;
124 virtual void pause() = 0; 118 virtual void pause() = 0;
125 119
126 virtual bool supportsSave() const = 0; 120 virtual bool supportsSave() const = 0;
127 virtual IntSize naturalSize() const = 0; 121 virtual IntSize naturalSize() const = 0;
128 122
129 virtual bool hasVideo() const = 0; 123 virtual bool hasVideo() const = 0;
130 virtual bool hasAudio() const = 0; 124 virtual bool hasAudio() const = 0;
131 125
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 175
182 #if ENABLE(WEB_AUDIO) 176 #if ENABLE(WEB_AUDIO)
183 virtual AudioSourceProvider* audioSourceProvider() = 0; 177 virtual AudioSourceProvider* audioSourceProvider() = 0;
184 #endif 178 #endif
185 virtual blink::WebMediaPlayer* webMediaPlayer() const = 0; 179 virtual blink::WebMediaPlayer* webMediaPlayer() const = 0;
186 }; 180 };
187 181
188 } 182 }
189 183
190 #endif // MediaPlayer_h 184 #endif // MediaPlayer_h
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698