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 OnPipelineBufferingState( | 169 void OnPipelineMetadata(media::PipelineMetadata metadata); |
170 media::Pipeline::BufferingState buffering_state); | 170 void OnPipelinePrerollCompleted(); |
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 |
264 // Playback state. | 267 // Playback state. |
265 // | 268 // |
266 // TODO(scherkus): we have these because Pipeline favours the simplicity of a | 269 // TODO(scherkus): we have these because Pipeline favours the simplicity of a |
267 // single "playback rate" over worrying about paused/stopped etc... It forces | 270 // single "playback rate" over worrying about paused/stopped etc... It forces |
268 // all clients to manage the pause+playback rate externally, but is that | 271 // all clients to manage the pause+playback rate externally, but is that |
269 // really a bad thing? | 272 // really a bad thing? |
270 // | 273 // |
271 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want | 274 // TODO(scherkus): since SetPlaybackRate(0) is asynchronous and we don't want |
272 // to hang the render thread during pause(), we record the time at the same | 275 // to hang the render thread during pause(), we record the time at the same |
273 // time we pause and then return that value in currentTime(). Otherwise our | 276 // 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... |
316 scoped_ptr<media::Demuxer> demuxer_; | 319 scoped_ptr<media::Demuxer> demuxer_; |
317 media::ChunkDemuxer* chunk_demuxer_; | 320 media::ChunkDemuxer* chunk_demuxer_; |
318 | 321 |
319 // Temporary for EME v0.1. In the future the init data type should be passed | 322 // Temporary for EME v0.1. In the future the init data type should be passed |
320 // through GenerateKeyRequest() directly from WebKit. | 323 // through GenerateKeyRequest() directly from WebKit. |
321 std::string init_data_type_; | 324 std::string init_data_type_; |
322 | 325 |
323 // Video rendering members. | 326 // Video rendering members. |
324 VideoFrameCompositor compositor_; | 327 VideoFrameCompositor compositor_; |
325 media::SkCanvasVideoRenderer skcanvas_video_renderer_; | 328 media::SkCanvasVideoRenderer skcanvas_video_renderer_; |
326 gfx::Size natural_size_; | |
327 | 329 |
328 // The compositor layer for displaying the video content when using composited | 330 // The compositor layer for displaying the video content when using composited |
329 // playback. | 331 // playback. |
330 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 332 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; |
331 | 333 |
332 // Text track objects get a unique index value when they're created. | 334 // Text track objects get a unique index value when they're created. |
333 int text_track_index_; | 335 int text_track_index_; |
334 | 336 |
335 // Manages decryption keys and decrypts encrypted frames. | 337 // Manages decryption keys and decrypts encrypted frames. |
336 scoped_ptr<ProxyDecryptor> proxy_decryptor_; | 338 scoped_ptr<ProxyDecryptor> proxy_decryptor_; |
337 | 339 |
338 // Non-owned pointer to the CDM. Updated via calls to | 340 // Non-owned pointer to the CDM. Updated via calls to |
339 // setContentDecryptionModule(). | 341 // setContentDecryptionModule(). |
340 WebContentDecryptionModuleImpl* web_cdm_; | 342 WebContentDecryptionModuleImpl* web_cdm_; |
341 | 343 |
342 media::DecryptorReadyCB decryptor_ready_cb_; | 344 media::DecryptorReadyCB decryptor_ready_cb_; |
343 | 345 |
344 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 346 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
345 }; | 347 }; |
346 | 348 |
347 } // namespace content | 349 } // namespace content |
348 | 350 |
349 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 351 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |