OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // This path is slower than notifying the compositor directly as it performs | 159 // This path is slower than notifying the compositor directly as it performs |
160 // more work and can trigger layouts. It should only be used in two cases: | 160 // more work and can trigger layouts. It should only be used in two cases: |
161 // 1) Major state changes (e.g., first frame available, run time error | 161 // 1) Major state changes (e.g., first frame available, run time error |
162 // occured) | 162 // occured) |
163 // 2) Compositing not available | 163 // 2) Compositing not available |
164 void InvalidateOnMainThread(); | 164 void InvalidateOnMainThread(); |
165 | 165 |
166 void OnPipelineSeek(media::PipelineStatus status); | 166 void OnPipelineSeek(media::PipelineStatus status); |
167 void OnPipelineEnded(); | 167 void OnPipelineEnded(); |
168 void OnPipelineError(media::PipelineStatus error); | 168 void OnPipelineError(media::PipelineStatus error); |
169 void OnPipelineMetadata(media::PipelineMetadata metadata); | 169 void OnPipelineBufferingState( |
170 void OnPipelinePrerollCompleted(); | 170 media::Pipeline::BufferingState buffering_state); |
171 void OnDemuxerOpened(); | 171 void OnDemuxerOpened(); |
172 void OnKeyAdded(const std::string& session_id); | 172 void OnKeyAdded(const std::string& session_id); |
173 void OnKeyError(const std::string& session_id, | 173 void OnKeyError(const std::string& session_id, |
174 media::MediaKeys::KeyError error_code, | 174 media::MediaKeys::KeyError error_code, |
175 uint32 system_code); | 175 uint32 system_code); |
176 void OnKeyMessage(const std::string& session_id, | 176 void OnKeyMessage(const std::string& session_id, |
177 const std::vector<uint8>& message, | 177 const std::vector<uint8>& message, |
178 const std::string& default_url); | 178 const std::string& default_url); |
179 void OnNeedKey(const std::string& type, | 179 void OnNeedKey(const std::string& type, |
180 const std::vector<uint8>& init_data); | 180 const std::vector<uint8>& init_data); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 scoped_refptr<media::MediaLog> media_log_; | 254 scoped_refptr<media::MediaLog> media_log_; |
255 media::Pipeline pipeline_; | 255 media::Pipeline pipeline_; |
256 | 256 |
257 // The currently selected key system. Empty string means that no key system | 257 // The currently selected key system. Empty string means that no key system |
258 // has been selected. | 258 // has been selected. |
259 std::string current_key_system_; | 259 std::string current_key_system_; |
260 | 260 |
261 // The LoadType passed in the |load_type| parameter of the load() call. | 261 // The LoadType passed in the |load_type| parameter of the load() call. |
262 LoadType load_type_; | 262 LoadType load_type_; |
263 | 263 |
264 // Cache of metadata for answering hasAudio(), hasVideo(), and naturalSize(). | |
265 media::PipelineMetadata pipeline_metadata_; | |
266 | |
267 // Playback state. | 264 // Playback state. |
268 // | 265 // |
269 // TODO(scherkus): we have these because Pipeline favours the simplicity of a | 266 // TODO(scherkus): we have these because Pipeline favours the simplicity of a |
270 // single "playback rate" over worrying about paused/stopped etc... It forces | 267 // single "playback rate" over worrying about paused/stopped etc... It forces |
271 // all clients to manage the pause+playback rate externally, but is that | 268 // all clients to manage the pause+playback rate externally, but is that |
272 // really a bad thing? | 269 // really a bad thing? |
273 // | 270 // |
274 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want | 271 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want |
275 // to hang the render thread during pause(), we record the time at the same | 272 // to hang the render thread during pause(), we record the time at the same |
276 // time we pause and then return that value in currentTime(). Otherwise our | 273 // time we pause and then return that value in currentTime(). Otherwise our |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 scoped_ptr<media::Demuxer> demuxer_; | 316 scoped_ptr<media::Demuxer> demuxer_; |
320 media::ChunkDemuxer* chunk_demuxer_; | 317 media::ChunkDemuxer* chunk_demuxer_; |
321 | 318 |
322 // Temporary for EME v0.1. In the future the init data type should be passed | 319 // Temporary for EME v0.1. In the future the init data type should be passed |
323 // through GenerateKeyRequest() directly from WebKit. | 320 // through GenerateKeyRequest() directly from WebKit. |
324 std::string init_data_type_; | 321 std::string init_data_type_; |
325 | 322 |
326 // Video rendering members. | 323 // Video rendering members. |
327 VideoFrameCompositor compositor_; | 324 VideoFrameCompositor compositor_; |
328 media::SkCanvasVideoRenderer skcanvas_video_renderer_; | 325 media::SkCanvasVideoRenderer skcanvas_video_renderer_; |
| 326 gfx::Size natural_size_; |
329 | 327 |
330 // The compositor layer for displaying the video content when using composited | 328 // The compositor layer for displaying the video content when using composited |
331 // playback. | 329 // playback. |
332 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 330 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; |
333 | 331 |
334 // Text track objects get a unique index value when they're created. | 332 // Text track objects get a unique index value when they're created. |
335 int text_track_index_; | 333 int text_track_index_; |
336 | 334 |
337 // Manages decryption keys and decrypts encrypted frames. | 335 // Manages decryption keys and decrypts encrypted frames. |
338 scoped_ptr<ProxyDecryptor> proxy_decryptor_; | 336 scoped_ptr<ProxyDecryptor> proxy_decryptor_; |
339 | 337 |
340 // Non-owned pointer to the CDM. Updated via calls to | 338 // Non-owned pointer to the CDM. Updated via calls to |
341 // setContentDecryptionModule(). | 339 // setContentDecryptionModule(). |
342 WebContentDecryptionModuleImpl* web_cdm_; | 340 WebContentDecryptionModuleImpl* web_cdm_; |
343 | 341 |
344 media::DecryptorReadyCB decryptor_ready_cb_; | 342 media::DecryptorReadyCB decryptor_ready_cb_; |
345 | 343 |
346 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 344 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
347 }; | 345 }; |
348 | 346 |
349 } // namespace content | 347 } // namespace content |
350 | 348 |
351 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 349 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |