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

Side by Side Diff: webkit/media/webmediaplayer_proxy.h

Issue 10855188: media::BindToLoop() is born, with example uses to slim down WebMediaPlayerProxy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: now with tests and CallbackForward Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ 5 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_
6 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ 6 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 // TODO(scherkus): remove this once VideoRendererBase::PaintCB passes 57 // TODO(scherkus): remove this once VideoRendererBase::PaintCB passes
58 // ownership of the VideoFrame http://crbug.com/108435 58 // ownership of the VideoFrame http://crbug.com/108435
59 void set_frame_provider(media::VideoRendererBase* frame_provider) { 59 void set_frame_provider(media::VideoRendererBase* frame_provider) {
60 frame_provider_ = frame_provider; 60 frame_provider_ = frame_provider;
61 } 61 }
62 62
63 // Methods for Filter -> WebMediaPlayerImpl communication. 63 // Methods for Filter -> WebMediaPlayerImpl communication.
64 void Repaint(); 64 void Repaint();
65 void SetOpaque(bool opaque);
66 65
67 // Methods for WebMediaPlayerImpl -> Filter communication. 66 // Methods for WebMediaPlayerImpl -> Filter communication.
68 void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect, uint8_t alpha); 67 void Paint(SkCanvas* canvas, const gfx::Rect& dest_rect, uint8_t alpha);
69 void Detach(); 68 void Detach();
70 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); 69 void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out);
71 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); 70 void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame);
72 bool HasSingleOrigin(); 71 bool HasSingleOrigin();
73 bool DidPassCORSAccessCheck() const; 72 bool DidPassCORSAccessCheck() const;
74 73
75 void AbortDataSource(); 74 void AbortDataSource();
76 75
77 // Methods for Pipeline -> WebMediaPlayerImpl communication.
78 void PipelineInitializationCallback(media::PipelineStatus status);
79 void PipelineSeekCallback(media::PipelineStatus status);
80 void PipelineEndedCallback(media::PipelineStatus status);
81 void PipelineErrorCallback(media::PipelineStatus error);
82
83 // ChunkDemuxerClient implementation. 76 // ChunkDemuxerClient implementation.
84 virtual void DemuxerOpened(media::ChunkDemuxer* demuxer) OVERRIDE; 77 virtual void DemuxerOpened(media::ChunkDemuxer* demuxer) OVERRIDE;
85 virtual void DemuxerClosed() OVERRIDE; 78 virtual void DemuxerClosed() OVERRIDE;
86 virtual void DemuxerNeedKey(scoped_array<uint8> init_data, 79 virtual void DemuxerNeedKey(scoped_array<uint8> init_data,
87 int init_data_size) OVERRIDE; 80 int init_data_size) OVERRIDE;
88 81
89 // Methods for Demuxer communication. 82 // Methods for Demuxer communication.
90 void DemuxerStartWaitingForSeek(); 83 void DemuxerStartWaitingForSeek();
91 void DemuxerCancelPendingSeek(); 84 void DemuxerCancelPendingSeek();
92 media::ChunkDemuxer::Status DemuxerAddId(const std::string& id, 85 media::ChunkDemuxer::Status DemuxerAddId(const std::string& id,
(...skipping 24 matching lines...) Expand all
117 scoped_array<uint8> init_data, 110 scoped_array<uint8> init_data,
118 int init_data_size) OVERRIDE; 111 int init_data_size) OVERRIDE;
119 112
120 private: 113 private:
121 friend class base::RefCountedThreadSafe<WebMediaPlayerProxy>; 114 friend class base::RefCountedThreadSafe<WebMediaPlayerProxy>;
122 virtual ~WebMediaPlayerProxy(); 115 virtual ~WebMediaPlayerProxy();
123 116
124 // Invoke |webmediaplayer_| to perform a repaint. 117 // Invoke |webmediaplayer_| to perform a repaint.
125 void RepaintTask(); 118 void RepaintTask();
126 119
127 // Notify |webmediaplayer_| that initialization has finished.
128 void PipelineInitializationTask(media::PipelineStatus status);
129
130 // Notify |webmediaplayer_| that a seek has finished.
131 void PipelineSeekTask(media::PipelineStatus status);
132
133 // Notify |webmediaplayer_| that the media has ended.
134 void PipelineEndedTask(media::PipelineStatus status);
135
136 // Notify |webmediaplayer_| that a pipeline error has occurred during
137 // playback.
138 void PipelineErrorTask(media::PipelineStatus error);
139
140 // Inform |webmediaplayer_| whether the video content is opaque.
141 void SetOpaqueTask(bool opaque);
142
143 void DemuxerOpenedTask(const scoped_refptr<media::ChunkDemuxer>& demuxer); 120 void DemuxerOpenedTask(const scoped_refptr<media::ChunkDemuxer>& demuxer);
144 void DemuxerClosedTask(); 121 void DemuxerClosedTask();
145 122
146 // Notify |webmediaplayer_| that a key has been added. 123 // Notify |webmediaplayer_| that a key has been added.
147 void KeyAddedTask(const std::string& key_system, 124 void KeyAddedTask(const std::string& key_system,
148 const std::string& session_id); 125 const std::string& session_id);
149 126
150 // Notify |webmediaplayer_| that a key error occurred. 127 // Notify |webmediaplayer_| that a key error occurred.
151 void KeyErrorTask(const std::string& key_system, 128 void KeyErrorTask(const std::string& key_system,
152 const std::string& session_id, 129 const std::string& session_id,
(...skipping 25 matching lines...) Expand all
178 int outstanding_repaints_; 155 int outstanding_repaints_;
179 156
180 scoped_refptr<media::ChunkDemuxer> chunk_demuxer_; 157 scoped_refptr<media::ChunkDemuxer> chunk_demuxer_;
181 158
182 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerProxy); 159 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerProxy);
183 }; 160 };
184 161
185 } // namespace webkit_media 162 } // namespace webkit_media
186 163
187 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_ 164 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698