Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: media/blink/webmediaplayer_impl.h

Issue 2707973005: Remove Media.UnderflowCount, add Media.UnderflowDuration for MSE. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 // Overrides the pipeline media duration returned by 439 // Overrides the pipeline media duration returned by
440 // GetPipelineMediaDuration() for tests. 440 // GetPipelineMediaDuration() for tests.
441 void SetPipelineMediaDurationForTest(base::TimeDelta duration); 441 void SetPipelineMediaDurationForTest(base::TimeDelta duration);
442 442
443 // Return the pipeline media duration or the value overridden by tests. 443 // Return the pipeline media duration or the value overridden by tests.
444 base::TimeDelta GetPipelineMediaDuration() const; 444 base::TimeDelta GetPipelineMediaDuration() const;
445 445
446 void ReportTimeFromForegroundToFirstFrame(base::TimeTicks foreground_time, 446 void ReportTimeFromForegroundToFirstFrame(base::TimeTicks foreground_time,
447 base::TimeTicks new_frame_time); 447 base::TimeTicks new_frame_time);
448 448
449 // Records |duration| to the appropriate metric based on whether we're
450 // handling a src= or MSE based playback.
451 void RecordUnderflowDuration(base::TimeDelta duration);
452
449 blink::WebLocalFrame* frame_; 453 blink::WebLocalFrame* frame_;
450 454
451 // The playback state last reported to |delegate_|, to avoid setting duplicate 455 // The playback state last reported to |delegate_|, to avoid setting duplicate
452 // states. 456 // states.
453 // TODO(sandersd): The delegate should be implementing deduplication. 457 // TODO(sandersd): The delegate should be implementing deduplication.
454 DelegateState delegate_state_; 458 DelegateState delegate_state_;
455 bool delegate_has_audio_; 459 bool delegate_has_audio_;
456 460
457 blink::WebMediaPlayer::NetworkState network_state_; 461 blink::WebMediaPlayer::NetworkState network_state_;
458 blink::WebMediaPlayer::ReadyState ready_state_; 462 blink::WebMediaPlayer::ReadyState ready_state_;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 bool use_fallback_path_; 656 bool use_fallback_path_;
653 657
654 // Called sometime after the media is suspended in a playing state in 658 // Called sometime after the media is suspended in a playing state in
655 // OnFrameHidden(), causing the state to change to paused. 659 // OnFrameHidden(), causing the state to change to paused.
656 base::OneShotTimer background_pause_timer_; 660 base::OneShotTimer background_pause_timer_;
657 661
658 // Monitors the watch time of the played content. 662 // Monitors the watch time of the played content.
659 std::unique_ptr<WatchTimeReporter> watch_time_reporter_; 663 std::unique_ptr<WatchTimeReporter> watch_time_reporter_;
660 bool is_encrypted_; 664 bool is_encrypted_;
661 665
662 // Number of times we've reached BUFFERING_HAVE_NOTHING during playback. 666 // Elapsed time since we've last reached BUFFERING_HAVE_NOTHING.
663 int underflow_count_;
664 std::unique_ptr<base::ElapsedTimer> underflow_timer_; 667 std::unique_ptr<base::ElapsedTimer> underflow_timer_;
665 668
666 // Used to track loading progress, used by IsPrerollAttemptNeeded(). 669 // Used to track loading progress, used by IsPrerollAttemptNeeded().
667 // |preroll_attempt_pending_| indicates that the clock has been reset 670 // |preroll_attempt_pending_| indicates that the clock has been reset
668 // (awaiting a resume to start), while |preroll_attempt_start_time_| tracks 671 // (awaiting a resume to start), while |preroll_attempt_start_time_| tracks
669 // when a preroll attempt began. 672 // when a preroll attempt began.
670 bool preroll_attempt_pending_; 673 bool preroll_attempt_pending_;
671 base::TimeTicks preroll_attempt_start_time_; 674 base::TimeTicks preroll_attempt_start_time_;
672 675
673 std::unique_ptr<base::TickClock> tick_clock_; 676 std::unique_ptr<base::TickClock> tick_clock_;
(...skipping 25 matching lines...) Expand all
699 702
700 // Pipeline media duration overridden by tests. 703 // Pipeline media duration overridden by tests.
701 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_; 704 base::Optional<base::TimeDelta> pipeline_media_duration_for_test_;
702 705
703 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 706 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
704 }; 707 };
705 708
706 } // namespace media 709 } // namespace media
707 710
708 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 711 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698