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 MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 // Return the pipeline media duration or the value overridden by tests. | 450 // Return the pipeline media duration or the value overridden by tests. |
451 base::TimeDelta GetPipelineMediaDuration() const; | 451 base::TimeDelta GetPipelineMediaDuration() const; |
452 | 452 |
453 void ReportTimeFromForegroundToFirstFrame(base::TimeTicks foreground_time, | 453 void ReportTimeFromForegroundToFirstFrame(base::TimeTicks foreground_time, |
454 base::TimeTicks new_frame_time); | 454 base::TimeTicks new_frame_time); |
455 | 455 |
456 // Records |duration| to the appropriate metric based on whether we're | 456 // Records |duration| to the appropriate metric based on whether we're |
457 // handling a src= or MSE based playback. | 457 // handling a src= or MSE based playback. |
458 void RecordUnderflowDuration(base::TimeDelta duration); | 458 void RecordUnderflowDuration(base::TimeDelta duration); |
459 | 459 |
| 460 // Called by the data source when loading progresses. |
| 461 // Can be called quite often. |
| 462 void OnProgress(); |
| 463 |
| 464 // Returns true when we estimate that we can play the rest of the media |
| 465 // without buffering. |
| 466 bool CanPlayThrough(); |
| 467 |
460 // Records |natural_size| to MediaLog and video height to UMA. | 468 // Records |natural_size| to MediaLog and video height to UMA. |
461 void RecordVideoNaturalSize(const gfx::Size& natural_size); | 469 void RecordVideoNaturalSize(const gfx::Size& natural_size); |
462 | 470 |
463 blink::WebLocalFrame* frame_; | 471 blink::WebLocalFrame* frame_; |
464 | 472 |
465 // The playback state last reported to |delegate_|, to avoid setting duplicate | 473 // The playback state last reported to |delegate_|, to avoid setting duplicate |
466 // states. | 474 // states. |
467 // TODO(sandersd): The delegate should be implementing deduplication. | 475 // TODO(sandersd): The delegate should be implementing deduplication. |
468 DelegateState delegate_state_; | 476 DelegateState delegate_state_; |
469 bool delegate_has_audio_; | 477 bool delegate_has_audio_; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 base::CancelableCallback<void(base::TimeTicks)> frame_time_report_cb_; | 732 base::CancelableCallback<void(base::TimeTicks)> frame_time_report_cb_; |
725 | 733 |
726 bool initial_video_height_recorded_ = false; | 734 bool initial_video_height_recorded_ = false; |
727 | 735 |
728 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); | 736 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); |
729 }; | 737 }; |
730 | 738 |
731 } // namespace media | 739 } // namespace media |
732 | 740 |
733 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ | 741 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ |
OLD | NEW |