| 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 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. | 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. |
| 6 // It contains Pipeline which is the actual media player pipeline, it glues | 6 // It contains Pipeline which is the actual media player pipeline, it glues |
| 7 // the media player pipeline, data source, audio renderer and renderer. | 7 // the media player pipeline, data source, audio renderer and renderer. |
| 8 // Pipeline would creates multiple threads and access some public methods | 8 // Pipeline would creates multiple threads and access some public methods |
| 9 // of this class, so we need to be extra careful about concurrent access of | 9 // of this class, so we need to be extra careful about concurrent access of |
| 10 // methods and members. | 10 // methods and members. |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 RENDERFRAME_DESTROYED = 1 << 1, | 237 RENDERFRAME_DESTROYED = 1 << 1, |
| 238 }; | 238 }; |
| 239 void Destroy(DestroyReason reason); | 239 void Destroy(DestroyReason reason); |
| 240 | 240 |
| 241 // Lets V8 know that player uses extra resources not managed by V8. | 241 // Lets V8 know that player uses extra resources not managed by V8. |
| 242 void IncrementExternallyAllocatedMemory(); | 242 void IncrementExternallyAllocatedMemory(); |
| 243 | 243 |
| 244 // Actually do the work for generateKeyRequest/addKey so they can easily | 244 // Actually do the work for generateKeyRequest/addKey so they can easily |
| 245 // report results to UMA. | 245 // report results to UMA. |
| 246 MediaKeyException GenerateKeyRequestInternal( | 246 MediaKeyException GenerateKeyRequestInternal( |
| 247 const blink::WebString& key_system, | 247 const std::string& key_system, |
| 248 const unsigned char* init_data, | 248 const unsigned char* init_data, |
| 249 unsigned init_data_length); | 249 unsigned init_data_length); |
| 250 MediaKeyException AddKeyInternal(const blink::WebString& key_system, | 250 MediaKeyException AddKeyInternal(const std::string& key_system, |
| 251 const unsigned char* key, | 251 const unsigned char* key, |
| 252 unsigned key_length, | 252 unsigned key_length, |
| 253 const unsigned char* init_data, | 253 const unsigned char* init_data, |
| 254 unsigned init_data_length, | 254 unsigned init_data_length, |
| 255 const blink::WebString& session_id); | 255 const std::string& session_id); |
| 256 MediaKeyException CancelKeyRequestInternal( | 256 MediaKeyException CancelKeyRequestInternal( |
| 257 const blink::WebString& key_system, | 257 const std::string& key_system, |
| 258 const blink::WebString& session_id); | 258 const std::string& session_id); |
| 259 | 259 |
| 260 // Gets the duration value reported by the pipeline. | 260 // Gets the duration value reported by the pipeline. |
| 261 double GetPipelineDuration() const; | 261 double GetPipelineDuration() const; |
| 262 | 262 |
| 263 // Callbacks from |pipeline_| that are forwarded to |client_|. | 263 // Callbacks from |pipeline_| that are forwarded to |client_|. |
| 264 void OnDurationChange(); | 264 void OnDurationChange(); |
| 265 void OnNaturalSizeChange(gfx::Size size); | 265 void OnNaturalSizeChange(gfx::Size size); |
| 266 | 266 |
| 267 // Called by VideoRendererImpl on its internal thread with the new frame to be | 267 // Called by VideoRendererImpl on its internal thread with the new frame to be |
| 268 // painted. | 268 // painted. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 285 | 285 |
| 286 // Message loops for posting tasks on Chrome's main thread. Also used | 286 // Message loops for posting tasks on Chrome's main thread. Also used |
| 287 // for DCHECKs so methods calls won't execute in the wrong thread. | 287 // for DCHECKs so methods calls won't execute in the wrong thread. |
| 288 const scoped_refptr<base::MessageLoopProxy> main_loop_; | 288 const scoped_refptr<base::MessageLoopProxy> main_loop_; |
| 289 | 289 |
| 290 scoped_ptr<media::Pipeline> pipeline_; | 290 scoped_ptr<media::Pipeline> pipeline_; |
| 291 scoped_refptr<base::MessageLoopProxy> media_loop_; | 291 scoped_refptr<base::MessageLoopProxy> media_loop_; |
| 292 | 292 |
| 293 // The currently selected key system. Empty string means that no key system | 293 // The currently selected key system. Empty string means that no key system |
| 294 // has been selected. | 294 // has been selected. |
| 295 blink::WebString current_key_system_; | 295 std::string current_key_system_; |
| 296 | 296 |
| 297 // The LoadType passed in the |load_type| parameter of the load() call. | 297 // The LoadType passed in the |load_type| parameter of the load() call. |
| 298 LoadType load_type_; | 298 LoadType load_type_; |
| 299 | 299 |
| 300 // Playback state. | 300 // Playback state. |
| 301 // | 301 // |
| 302 // TODO(scherkus): we have these because Pipeline favours the simplicity of a | 302 // TODO(scherkus): we have these because Pipeline favours the simplicity of a |
| 303 // single "playback rate" over worrying about paused/stopped etc... It forces | 303 // single "playback rate" over worrying about paused/stopped etc... It forces |
| 304 // all clients to manage the pause+playback rate externally, but is that | 304 // all clients to manage the pause+playback rate externally, but is that |
| 305 // really a bad thing? | 305 // really a bad thing? |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // TODO(scherkus): Remove after tracking down cause for crashes | 386 // TODO(scherkus): Remove after tracking down cause for crashes |
| 387 // http://crbug.com/341184 http://crbug.com/341186 | 387 // http://crbug.com/341184 http://crbug.com/341186 |
| 388 uint32 destroy_reason_; | 388 uint32 destroy_reason_; |
| 389 | 389 |
| 390 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 390 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 391 }; | 391 }; |
| 392 | 392 |
| 393 } // namespace content | 393 } // namespace content |
| 394 | 394 |
| 395 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 395 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |