| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 class MediaLog; | 60 class MediaLog; |
| 61 } | 61 } |
| 62 | 62 |
| 63 namespace webkit { | 63 namespace webkit { |
| 64 class WebLayerImpl; | 64 class WebLayerImpl; |
| 65 } | 65 } |
| 66 | 66 |
| 67 namespace webkit_media { | 67 namespace webkit_media { |
| 68 | 68 |
| 69 class BufferedDataSource; | 69 class BufferedDataSource; |
| 70 class MediaStreamClient; | |
| 71 class WebAudioSourceProviderImpl; | 70 class WebAudioSourceProviderImpl; |
| 72 class WebMediaPlayerDelegate; | 71 class WebMediaPlayerDelegate; |
| 73 class WebMediaPlayerParams; | 72 class WebMediaPlayerParams; |
| 74 class WebTextTrackImpl; | 73 class WebTextTrackImpl; |
| 75 | 74 |
| 76 class WebMediaPlayerImpl | 75 class WebMediaPlayerImpl |
| 77 : public WebKit::WebMediaPlayer, | 76 : public WebKit::WebMediaPlayer, |
| 78 public cc::VideoFrameProvider, | 77 public cc::VideoFrameProvider, |
| 79 public base::MessageLoop::DestructionObserver, | 78 public base::MessageLoop::DestructionObserver, |
| 80 public base::SupportsWeakPtr<WebMediaPlayerImpl> { | 79 public base::SupportsWeakPtr<WebMediaPlayerImpl> { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void OnNeedKey(const std::string& type, | 199 void OnNeedKey(const std::string& type, |
| 201 const std::string& session_id, | 200 const std::string& session_id, |
| 202 scoped_ptr<uint8[]> init_data, | 201 scoped_ptr<uint8[]> init_data, |
| 203 int init_data_size); | 202 int init_data_size); |
| 204 scoped_ptr<media::TextTrack> OnTextTrack(media::TextKind kind, | 203 scoped_ptr<media::TextTrack> OnTextTrack(media::TextKind kind, |
| 205 const std::string& label, | 204 const std::string& label, |
| 206 const std::string& language); | 205 const std::string& language); |
| 207 void SetOpaque(bool); | 206 void SetOpaque(bool); |
| 208 | 207 |
| 209 private: | 208 private: |
| 210 // Contains common logic used across the different types loading. | 209 // Called after |defer_load_cb_| has decided to allow the load. If |
| 211 void LoadSetup(const WebKit::WebURL& url); | 210 // |defer_load_cb_| is null this is called immediately. |
| 211 void DoLoad(const WebKit::WebURL& url, |
| 212 WebKit::WebMediaSource* media_source, |
| 213 CORSMode cors_mode); |
| 212 | 214 |
| 213 // Called after asynchronous initialization of a data source completed. | 215 // Called after asynchronous initialization of a data source completed. |
| 214 void DataSourceInitialized(const GURL& gurl, bool success); | 216 void DataSourceInitialized(const GURL& gurl, bool success); |
| 215 | 217 |
| 216 // Called when the data source is downloading or paused. | 218 // Called when the data source is downloading or paused. |
| 217 void NotifyDownloading(bool is_downloading); | 219 void NotifyDownloading(bool is_downloading); |
| 218 | 220 |
| 219 // Finishes starting the pipeline due to a call to load(). | 221 // Finishes starting the pipeline due to a call to load(). |
| 220 // | 222 // |
| 221 // A non-null |media_source| will construct a Media Source pipeline. | 223 // A non-null |media_source| will construct a Media Source pipeline. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 302 |
| 301 // Seek gets pending if another seek is in progress. Only last pending seek | 303 // Seek gets pending if another seek is in progress. Only last pending seek |
| 302 // will have effect. | 304 // will have effect. |
| 303 bool pending_seek_; | 305 bool pending_seek_; |
| 304 double pending_seek_seconds_; | 306 double pending_seek_seconds_; |
| 305 | 307 |
| 306 WebKit::WebMediaPlayerClient* client_; | 308 WebKit::WebMediaPlayerClient* client_; |
| 307 | 309 |
| 308 base::WeakPtr<WebMediaPlayerDelegate> delegate_; | 310 base::WeakPtr<WebMediaPlayerDelegate> delegate_; |
| 309 | 311 |
| 310 MediaStreamClient* media_stream_client_; | 312 base::Callback<void(const base::Closure&)> defer_load_cb_; |
| 311 | 313 |
| 312 scoped_refptr<media::MediaLog> media_log_; | 314 scoped_refptr<media::MediaLog> media_log_; |
| 313 | 315 |
| 314 // Since accelerated compositing status is only known after the first layout, | 316 // Since accelerated compositing status is only known after the first layout, |
| 315 // we delay reporting it to UMA until that time. | 317 // we delay reporting it to UMA until that time. |
| 316 bool accelerated_compositing_reported_; | 318 bool accelerated_compositing_reported_; |
| 317 | 319 |
| 318 bool incremented_externally_allocated_memory_; | 320 bool incremented_externally_allocated_memory_; |
| 319 | 321 |
| 320 // Factories for supporting GpuVideoDecoder. May be null. | 322 // Factories for supporting GpuVideoDecoder. May be null. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 | 368 |
| 367 // Text track objects get a unique index value when they're created. | 369 // Text track objects get a unique index value when they're created. |
| 368 int text_track_index_; | 370 int text_track_index_; |
| 369 | 371 |
| 370 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 372 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
| 371 }; | 373 }; |
| 372 | 374 |
| 373 } // namespace webkit_media | 375 } // namespace webkit_media |
| 374 | 376 |
| 375 #endif // WEBKIT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ | 377 #endif // WEBKIT_RENDERER_MEDIA_WEBMEDIAPLAYER_IMPL_H_ |
| OLD | NEW |